PageRenderTime 64ms CodeModel.GetById 62ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/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
10have pbuilder &&
11_pbuilder()
12{
13    local cur options
14
15    COMPREPLY=()
16    cur=${COMP_WORDS[COMP_CWORD]}
17    options='--create --update --build --login --execute --dumpconfig'
18
19    if [ $COMP_CWORD -eq 1 ]; then
20        COMPREPLY=( $( compgen -W "$options" | grep "^$cur" ) )
21    elif [ "${COMP_WORDS[1]}" = --build ]; then
22        COMPREPLY=( $( compgen -o filenames -G "$cur*.dsc" ) )
23    fi
24
25    return 0
26}
27[ "$have" ] && complete -F _pbuilder -o filenames pbuilder