[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3

David Paleino dapal at debian.org
Sun Feb 6 20:13:07 UTC 2011


The following commit has been merged in the master branch:
commit aab38f6160dfc94b6f1afafbd02458182a0b5e84
Merge: a170d886a293dc24bb03c1ff8872ee313469094a 1322b88cecf1859d560d6389de70d23f7d09d8bf
Author: David Paleino <dapal at debian.org>
Date:   Thu Jun 10 08:49:28 2010 +0200

    Merge branch 'master' into 1.x

diff --combined bash_completion
index f02a62d,1573d03..b6476a8
--- a/bash_completion
+++ b/bash_completion
@@@ -23,7 -23,7 +23,7 @@@
  #
  #   http://bash-completion.alioth.debian.org/
  #
 -#   RELEASE: 2.x
 +#   RELEASE: 1.1
  
  if [[ $- == *v* ]]; then
      BASH_COMPLETION_ORIGINAL_V_VALUE="-v"
@@@ -1082,292 -1082,6 +1082,6 @@@ _dvd_devices(
      patch configure build install reinstall deinstall clean clean-depends \
      kernel buildworld' make
  
- # This completes on a list of all available service scripts for the
- # 'service' command and/or the SysV init.d directory, followed by
- # that script's available commands
- #
- { have service || [ -d /etc/init.d/ ]; } &&
- _service()
- {
-     local cur prev sysvdir
- 
-     COMPREPLY=()
-     prev=${COMP_WORDS[COMP_CWORD-1]}
-     cur=`_get_cword`
- 
-     # don't complete for things like killall, ssh and mysql if it's
-     # the standalone command, rather than the init script
-     [[ ${COMP_WORDS[0]} != @(*init.d/!(functions|~)|service) ]] && return 0
- 
-     # don't complete past 2nd token
-     [ $COMP_CWORD -gt 2 ] && return 0
- 
-     [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d
- 
-     if [[ $COMP_CWORD -eq 1 ]] && [[ $prev == "service" ]]; then
-         _services
-     else
-         COMPREPLY=( $( compgen -W '`sed -e "y/|/ /" \
-             -ne "s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \
-             $sysvdir/${prev##*/} 2>/dev/null`' -- "$cur" ) )
-     fi
- 
-     return 0
- } &&
- complete -F _service service
- [ -d /etc/init.d/ ] && complete -F _service -o default \
-     $(for i in /etc/init.d/*; do printf '%s\n' ${i##*/}; done)
- 
- 
- # chown(1) completion
- #
- _chown()
- {
-     local cur prev split=false
- 
-     # Get cur and prev words; but don't treat user:group as separate words.
-     cur=`_get_cword :`
-     prev=`_get_pword :`
- 
-     _split_longopt && split=true
- 
-     case "$prev" in
-         --from)
-             _usergroup
-             return 0
-             ;;
-         --reference)
-             _filedir
-             return 0
-             ;;
-     esac
- 
-     $split && return 0
- 
-     if [[ "$cur" == -* ]]; then
-         # Complete -options
-         local w opts
-         for w in "${COMP_WORDS[@]}" ; do
-             [[ "$w" == -@(R|-recursive) ]] && opts="-H -L -P" && break
-         done
-         COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference \
-             --no-dereference --from --silent --quiet --reference --recursive \
-             --verbose --help --version $opts' -- "$cur" ) )
-     else
-         local args
- 
-         # The first argument is an usergroup; the rest are filedir.
-         _count_args :
- 
-         if [[ $args == 1 ]]; then
-             _usergroup
-         else
-             _filedir
-         fi
-     fi
- } # _chown()
- complete -F _chown -o filenames chown
- 
- 
- # chgrp(1) completion
- #
- _chgrp()
- {
-     local cur prev split=false
- 
-     COMPREPLY=()
-     cur=`_get_cword`
-     cur=${cur//\\\\/}
-     prev=${COMP_WORDS[COMP_CWORD-1]}
- 
-     _split_longopt && split=true
- 
-     if [[ "$prev" == --reference ]]; then
-         _filedir
-         return 0
-     fi
- 
-     $split && return 0
- 
-     # options completion
-     if [[ "$cur" == -* ]]; then
-         local w opts
-         for w in "${COMP_WORDS[@]}" ; do
-             [[ "$w" == -@(R|-recursive) ]] && opts="-H -L -P" && break
-         done
-         COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference \
-             --no-dereference --silent --quiet --reference --recursive \
-             --verbose --help --version $opts' -- "$cur" ) )
-         return 0
-     fi
- 
-     # first parameter on line or first since an option?
-     if [[ $COMP_CWORD -eq 1 && "$cur" != -* || "$prev" == -* ]]; then
-         local IFS=$'\n'
-         COMPREPLY=( $( compgen -g "$cur" 2>/dev/null ) )
-     else
-         _filedir || return 0
-     fi
- 
-     return 0
- } # _chgrp()
- complete -F _chgrp -o filenames chgrp
- 
- 
- # renice(8) completion
- #
- _renice()
- {
-     local command cur curopt i
- 
-     COMPREPLY=()
-     cur=`_get_cword`
-     command=$1
- 
-     i=0
-     # walk back through command line and find last option
-     while [[ $i -le $COMP_CWORD && ${#COMPREPLY[@]} -eq 0 ]]; do
-         curopt=${COMP_WORDS[COMP_CWORD-$i]}
-         case "$curopt" in
-             -u)
-                 COMPREPLY=( $( compgen -u -- "$cur" ) )
-                 ;;
-             -g)
-                 _pgids
-                 ;;
-             -p|$command)
-                 _pids
-                 ;;
-         esac
-         i=$(( ++i ))
-     done
- }
- complete -F _renice renice
- 
- 
- # kill(1) completion
- #
- _kill()
- {
-     local cur
- 
-     COMPREPLY=()
-     cur=`_get_cword`
- 
-     if [[ $COMP_CWORD -eq 1 && "$cur" == -* ]]; then
-         # return list of available signals
-         _signals
-     else
-         # return list of available PIDs
-         _pids
-     fi
- }
- complete -F _kill kill
- 
- # killall(1) (Linux and FreeBSD) and pkill(1) completion.
- #
- [[ $UNAME == Linux || $UNAME == FreeBSD ]] || have pkill &&
- _killall()
- {
-     local cur
- 
-     COMPREPLY=()
-     cur=`_get_cword`
- 
-     if [[ $COMP_CWORD -eq 1 && "$cur" == -* ]]; then
-         _signals
-     else
-         _pnames
-     fi
- 
-     return 0
- }
- [[ $UNAME == Linux || $UNAME == FreeBSD ]] && complete -F _killall killall
- have pkill && complete -F _killall pkill
- 
- # pgrep(1) completion.
- #
- [ $UNAME = Linux ] || have pgrep &&
- _pgrep()
- {
-     local cur
- 
-     COMPREPLY=()
-     cur=`_get_cword`
- 
-     _pnames
- 
-     return 0
- }
- have pgrep && complete -F _pgrep pgrep
- 
- # Linux pidof(8) completion.
- [ $UNAME = Linux ] && complete -F _pgrep pidof
- 
- # Red Hat & Debian GNU/Linux if{up,down} completion
- #
- [ $USERLAND = GNU ] && { have ifup || have ifdown; } &&
- _ifupdown()
- {
-     local cur
- 
-     COMPREPLY=()
-     cur=`_get_cword`
- 
-     if [ $COMP_CWORD -eq 1 ]; then
-         _configured_interfaces
-         COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") )
-     fi
- 
-     return 0
- } &&
- complete -F _ifupdown ifup ifdown
- [ $USERLAND = GNU ] && have ifstatus && complete -F _ifupdown ifstatus
- 
- # Linux ipsec(8) completion (for FreeS/WAN)
- #
- [ $UNAME = Linux ] && have ipsec &&
- _ipsec()
- {
-     local cur
- 
-     COMPREPLY=()
-     cur=`_get_cword`
- 
- 
-     if [ $COMP_CWORD -eq 1 ]; then
-         COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual \
-             pluto ranbits rsasigkey setup showdefaults showhostkey spi spigrp \
-             tncfg whack' -- "$cur" ) )
-         return 0
-     fi
- 
-     case ${COMP_WORDS[1]} in
-         auto)
-             COMPREPLY=( $( compgen -W '--asynchronous --up --add --delete \
-                 --replace --down --route --unroute \
-                 --ready --status --rereadsecrets' \
-                 -- "$cur" ) )
-             ;;
-         manual)
-             COMPREPLY=( $( compgen -W '--up --down --route --unroute \
-                 --union' -- "$cur" ) )
-             ;;
-         ranbits)
-             COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \
-                 -- "$cur" ) )
-             ;;
-         setup)
-             COMPREPLY=( $( compgen -W '--start --stop --restart' -- "$cur" ) )
-             ;;
-         *)
-             ;;
-     esac
- 
-     return 0
- } &&
- complete -F _ipsec ipsec
- 
  # This function provides simple user at host completion
  #
  _user_at_host() {
@@@ -1779,41 -1493,6 +1493,6 @@@ for i in env netstat seq uname units; d
  done
  unset i
  
- # look(1) completion
- #
- have look &&
- _look()
- {
-     local cur
- 
-     COMPREPLY=()
-     cur=`_get_cword`
- 
-     if [ $COMP_CWORD = 1 ]; then
-         COMPREPLY=( $( compgen -W '$(look "$cur" 2>/dev/null)' -- "$cur" ) )
-     fi
- } &&
- complete -F _look -o default look
- 
- # id(1) completion
- #
- have id &&
- _id()
- {
-     local cur
- 
-     COMPREPLY=()
-     cur=`_get_cword`
- 
-     if [[ "$cur" == -* ]]; then
-         COMPREPLY=( $( compgen -W '-a -g --group -G --groups -n --name\
-             -r --real -u --user --help --version' -- "$cur" ) )
-     else
-         COMPREPLY=( $( compgen -u "$cur" ) )
-     fi
- } &&
- complete -F _id id
- 
  _filedir_xspec()
  {
      local IFS cur xspec

-- 
bash-completion



More information about the Bash-completion-commits mailing list