~ubuntu-branches/ubuntu/trusty/cdargs/trusty-proposed

« back to all changes in this revision

Viewing changes to contrib/cdargs-bash.sh

  • Committer: Bazaar Package Importer
  • Author(s): Francois Marier
  • Date: 2009-03-29 13:21:09 UTC
  • Revision ID: james.westby@ubuntu.com-20090329132109-tpsi5sog60w84eyw
Tags: 1.35-4
* Adopt this package (closes: #521484)
* Move the packaging to git.debian.org
* Update FSF address in manpage (closes: #470446)

* Apply Fedora patch to fix parse errors when the login shell is not bash,
  see https://bugzilla.redhat.com/show_bug.cgi?id=479398 (LP: #319489)
* Adapt upstream's patch to add support for zsh,
  see http://www.skamphausen.de/cgi-bin/ska/cdargs-zsh-completion.patch

* Bump Standards-Version to 3.8.1
* Bump debhelper compatibility to 7
* debian/rules: make use of dh_prep and stop ignoring distclean errors
* Update upstream URLs
* Add watch file
* Fix hyphens in manpage
* Expand long description

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
1
# (C) 2002-2003 Dan Allen and Stefan Kamphausen
4
2
 
5
3
# Written by Dan Allen <dan@mojavelinux.com>
166
164
    local tmpfile
167
165
 
168
166
    # first clear any bookmarks with this same alias, if file exists
169
 
    if [[ "$CDARGS_NODUPS" && -e "$HOME/.cdargs" ]]; then
 
167
    if [ "$CDARGS_NODUPS" -a -e "$HOME/.cdargs" ]; then
170
168
        tmpfile=`echo ${TEMP:-${TMPDIR:-/tmp}} | /bin/sed -e "s/\\/$//"`
171
169
        tmpfile=$tmpfile/cdargs.$USER.$$.$RANDOM
172
170
        /bin/grep -v "^$1 " "$HOME/.cdargs" > $tmpfile && 'mv' -f $tmpfile "$HOME/.cdargs";
256
254
  complete $nospace -S / -X '*/' -F _cdargs_aliases cv cb cdb
257
255
}
258
256
 
 
257
# Support ZSH via its BASH completion emulation
 
258
if [ -n "$ZSH_VERSION" ]; then
 
259
       autoload bashcompinit
 
260
       bashcompinit
 
261
elif [ -z "${BASH_VERSION}" ]; then
 
262
    # we do not support anything besides bash completion
 
263
    # (however patches to support other shells are very welcome)
 
264
    return 100
 
265
fi
 
266
 
259
267
_cdargs_complete