pwgen: New completion.

This commit is contained in:
Ville Skyttä 2011-07-10 15:29:32 +03:00
parent 102a19c8a2
commit 1daff31f2e
4 changed files with 56 additions and 0 deletions

View File

@ -129,6 +129,7 @@ bashcomp_DATA = abook \
procps \
protoc \
puppet \
pwgen \
python \
qdbus \
qemu \

34
completions/pwgen Normal file
View File

@ -0,0 +1,34 @@
have pwgen || return
_pwgen()
{
local cur prev words cword split
_init_completion -s || return
case $prev in
-N|--num-passwords|-h|--help)
return
;;
-H|--sha1)
_filedir
return
;;
esac
$split && return
if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
return
fi
} &&
complete -F _pwgen pwgen
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
# sh-indent-comment: t
# indent-tabs-mode: nil
# End:
# ex: ts=4 sw=4 et filetype=sh

View File

@ -0,0 +1 @@
assert_source_completions pwgen

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "pwgen -"
sync_after_int
teardown