summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Hill <dirtyepic@gentoo.org>2012-10-21 21:40:53 -0600
committerRyan Hill <dirtyepic@gentoo.org>2012-10-21 21:40:53 -0600
commit06eab778510f2c40adb5c87efe974ca1035aaa7f (patch)
treeeb3c4884615eb3c7e48e9dc0506789e81634f1c5
parentAdd modelines and retab. (diff)
downloadgentoo-bashcomp-06eab778510f2c40adb5c87efe974ca1035aaa7f.tar.gz
gentoo-bashcomp-06eab778510f2c40adb5c87efe974ca1035aaa7f.tar.bz2
gentoo-bashcomp-06eab778510f2c40adb5c87efe974ca1035aaa7f.zip
Clean up metagen completion.
-rw-r--r--gentoo34
1 files changed, 15 insertions, 19 deletions
diff --git a/gentoo b/gentoo
index 1e58fa9..d15745f 100644
--- a/gentoo
+++ b/gentoo
@@ -1906,34 +1906,30 @@ _epm() {
complete -o filenames -F _epm epm
}
-#
-# metagen completion
-#
-
-have metagen && {
+have metagen &&
_metagen() {
local cur prev opts
COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
- opts="-h --help -H -e -n -m -d -l -o -f -v -q -Q"
-
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
- COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
- return 0
- fi
+ _get_comp_words_by_ref cur prev
+ opts="$(_parse_help ${COMP_WORDS[0]})"
- case "${prev}" in
- -H|-e|-n|-d|-l|-o)
- COMPREPLY=()
+ case $prev in
+ -h|--help|--version)
+ return 0
;;
- *)
- COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
+ -H|-e|-n|-d|-l)
+ return 0
+ ;;
+ -o)
+ _filedir
+ return 0
;;
esac
+
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
}
complete -F _metagen metagen
-}
have rc-service && {
_rc_service() {