[Bash-completion-commits] [SCM] bash-completion branch, master, updated. fcce6cc263d10466c6134618a9eee69fefe41deb
Ville Skyttä
ville.skytta at iki.fi
Wed Apr 15 12:37:34 UTC 2009
The following commit has been merged in the master branch:
commit 78f2e7cd91b8bbb4d5363df3494985dfbecce647
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Wed Apr 15 11:20:00 2009 +0300
Use _split_longopt in _chkconfig.
diff --git a/CHANGES b/CHANGES
index b856e17..ad02cb1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -34,8 +34,8 @@ bash-completion (1.x)
input in external command arguments.
* Add _split_longopt() helper for improved handling of long options that
take arguments in both "--foo bar" and "--foo=bar" formats.
- * Use _split_longopt to improve and clean up aspell, chgrp, chown, and
- generic long option completion.
+ * Use _split_longopt to improve and clean up aspell, chgrp, chown, chkconfig,
+ and generic long option completion.
* Add chown --from and --reference value completions.
* Add chgrp --reference value completion.
* Do not assume all --foo= options take filenames in generic long option
diff --git a/bash_completion b/bash_completion
index 2bd7114..d89e2c6 100644
--- a/bash_completion
+++ b/bash_completion
@@ -2636,14 +2636,16 @@ complete -F _chsh chsh
have chkconfig &&
_chkconfig()
{
- local cur prev
+ local cur prev split=false
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
+ _split_longopt && split=true
+
case "$prev" in
- @([1-6]|--@(list|add|del)))
+ @(?(--level=)[1-6]|--@(list|add|del|override)))
_services
return 0
;;
@@ -2653,6 +2655,8 @@ _chkconfig()
;;
esac
+ $split && return 0
+
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--list --add --del --override \
--level' -- $cur ) )
--
bash-completion
More information about the Bash-completion-commits
mailing list