home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / doc / bash / completion-contrib / sitecopy < prev    next >
Encoding:
Text File  |  2006-08-28  |  748 b   |  31 lines

  1. # sitecopy(1) completion
  2. # Copyright 2003 Eelco Lempsink <eelcolempsink@gmx.net>
  3. # License: GNU GPL v2 or later
  4. #
  5. # $Id: sitecopy,v 1.3 2005/01/03 02:44:22 ianmacd Exp $
  6.  
  7. _sitecopy()
  8. {
  9.     local cur
  10.  
  11.     COMPREPLY=()
  12.     cur=${COMP_WORDS[COMP_CWORD]}
  13.  
  14.     case "$cur" in
  15.         --*)
  16.             COMPREPLY=( $( compgen -W "$(sitecopy -h | grep -e '--\w' | awk '{sub (/=(FILE|PATH)/, "", $2); print $2}')" -- $cur ) )
  17.         ;;
  18.         -*)
  19.             COMPREPLY=( $( compgen -W "$(sitecopy -h | grep -e '-\w' | awk '{sub (",", "", $1); print $1}')" -- $cur ) )
  20.         ;;
  21.         *)
  22.         if [ -r ~/.sitecopyrc ]; then
  23.             COMPREPLY=( $( compgen -W "$(grep '^["$'\t '"]*site'  ~/.sitecopyrc | awk '{print $2}')" -- $cur ) )
  24.         fi
  25.         ;;
  26.     esac
  27.  
  28.     return 0
  29. }
  30. complete -F _sitecopy -o default sitecopy
  31.