/bash_completion.d/pbuilder

http://github.com/brinkman83/bashrc · #! · 27 lines · 23 code · 4 blank · 0 comment · 0 complexity · 6af3c8c99796ab77971de5ffac83a0f8 MD5 · raw file

  1. # Debian GNU/Linux cowbuilder(1) completion
  2. # Copyright 2007 Cyril Brulebois <cyril.brulebois@enst-bretagne.fr>
  3. #
  4. # This script can be distributed under the same license as the
  5. # cowdancer or bash packages.
  6. #
  7. # adapted to pbuilder, the license is GPLv2 or later.
  8. # Copyright 2007 Junichi Uekawa <dancer@debian.org>
  9. have pbuilder &&
  10. _pbuilder()
  11. {
  12. local cur options
  13. COMPREPLY=()
  14. cur=${COMP_WORDS[COMP_CWORD]}
  15. options='--create --update --build --login --execute --dumpconfig'
  16. if [ $COMP_CWORD -eq 1 ]; then
  17. COMPREPLY=( $( compgen -W "$options" | grep "^$cur" ) )
  18. elif [ "${COMP_WORDS[1]}" = --build ]; then
  19. COMPREPLY=( $( compgen -o filenames -G "$cur*.dsc" ) )
  20. fi
  21. return 0
  22. }
  23. [ "$have" ] && complete -F _pbuilder -o filenames pbuilder