patool/patool.bash-completion

45 lines
729 B
Plaintext
Raw Normal View History

# patool completion
#
have patool &&
{
_patool()
{
local cur prev commands options command
COMPREPLY=()
cur=`_get_cword`
commands='extract list test create diff formats'
if [[ $COMP_CWORD -eq 1 ]] ; then
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--help' -- $cur ) )
else
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
fi
else
command=${COMP_WORDS[1]}
if [[ "$cur" == -* ]]; then
# possible options for the command
2010-03-08 17:28:11 +00:00
options=''
case $command in
2010-03-08 17:28:11 +00:00
extract|list|test|create)
options='--verbose'
;;
esac
options="$options --help"
COMPREPLY=( $( compgen -W "$options" -- $cur ) )
else
_filedir
fi
fi
return 0
}
complete -F _patool $filenames patool
}