home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / bash_completion.d / apt-build < prev    next >
Encoding:
Text File  |  2010-11-16  |  1.7 KB  |  67 lines

  1. # Debian apt-build(1) completion.
  2.  
  3. have apt-build &&
  4. _apt_build()
  5. {
  6.     local cur prev special i
  7.  
  8.     COMPREPLY=()
  9.     _get_comp_words_by_ref cur prev
  10.  
  11.     for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
  12.         if [[ ${COMP_WORDS[i]} == @(install|remove|source|info|clean) ]]; then
  13.             special=${COMP_WORDS[i]}
  14.         fi
  15.     done
  16.  
  17.     if [ -n "$special" ]; then
  18.         case $special in
  19.             install|source|info)
  20.                 COMPREPLY=( $( apt-cache pkgnames "$cur" 2> /dev/null ) )
  21.                 return 0
  22.                 ;;
  23.             remove)
  24.                 COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) )
  25.                 return 0
  26.                 ;;
  27.             *)
  28.                 return 0
  29.                 ;;
  30.         esac
  31.     fi
  32.  
  33.     case $prev in
  34.          --patch|--build-dir|--repository-dir)
  35.                _filedir
  36.                return 0
  37.                ;;
  38.          -h|--help)
  39.                return 0
  40.                ;;
  41.     esac
  42.  
  43.     if [[ "$cur" == -* ]]; then
  44.         COMPREPLY=( $( compgen -W '--help --show-upgraded -u --build-dir \
  45.             --repository-dir --build-only --build-command --reinstall \
  46.             --rebuild --remove-builddep --no-wrapper --purge --patch \
  47.             --patch-strip -p --yes -y --version -v --no-source' -- "$cur" ) )
  48.  
  49.     else
  50.         COMPREPLY=( $( compgen -W 'update upgrade install remove source \
  51.             dist-upgrade world clean info clean-build update-repository' \
  52.             -- "$cur" ) )
  53.     fi
  54.  
  55.  
  56.     return 0
  57. } &&
  58. complete -F _apt_build -o filenames apt-build
  59.  
  60. # Local variables:
  61. # mode: shell-script
  62. # sh-basic-offset: 4
  63. # sh-indent-comment: t
  64. # indent-tabs-mode: nil
  65. # End:
  66. # ex: ts=4 sw=4 et filetype=sh
  67.