[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-399-g1daff31
Ville Skyttä
ville.skytta at iki.fi
Sun Jul 10 12:29:42 UTC 2011
The following commit has been merged in the master branch:
commit 1daff31f2efb33412ab5d3f27f4d5681d9ac6568
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sun Jul 10 15:29:32 2011 +0300
pwgen: New completion.
diff --git a/completions/Makefile.am b/completions/Makefile.am
index 62d6188..b009fbc 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -129,6 +129,7 @@ bashcomp_DATA = abook \
procps \
protoc \
puppet \
+ pwgen \
python \
qdbus \
qemu \
diff --git a/completions/_yum-utils b/completions/pwgen
similarity index 53%
copy from completions/_yum-utils
copy to completions/pwgen
index b11c95e..40bf376 100644
--- a/completions/_yum-utils
+++ b/completions/pwgen
@@ -1,27 +1,29 @@
-# Use of this file is deprecated. Upstream completion is available in
-# yum-utils >= 1.1.24, use that instead.
+have pwgen || return
-# bash completion for repomanage
-
-have repomanage || return
-
-_repomanage()
+_pwgen()
{
local cur prev words cword split
_init_completion -s || return
- [[ "$prev" == -@(h|-help|k|-keep) ]] && return 0
+ case $prev in
+ -N|--num-passwords|-h|--help)
+ return
+ ;;
+ -H|--sha1)
+ _filedir
+ return
+ ;;
+ esac
$split && return
- if [[ "$cur" == -* ]] ; then
+ if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
- else
- _filedir -d
+ return
fi
} &&
-complete -F _repomanage repomanage
+complete -F _pwgen pwgen
# Local variables:
# mode: shell-script
diff --git a/test/completion/pwgen.exp b/test/completion/pwgen.exp
new file mode 100644
index 0000000..bba75ec
--- /dev/null
+++ b/test/completion/pwgen.exp
@@ -0,0 +1 @@
+assert_source_completions pwgen
diff --git a/test/lib/completions/a2ps.exp b/test/lib/completions/pwgen.exp
similarity index 79%
copy from test/lib/completions/a2ps.exp
copy to test/lib/completions/pwgen.exp
index 77cd07f..b8882b6 100644
--- a/test/lib/completions/a2ps.exp
+++ b/test/lib/completions/pwgen.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "a2ps "
+assert_complete_any "pwgen -"
sync_after_int
--
bash-completion
More information about the Bash-completion-commits
mailing list