[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 69e956e17422dc1ea192f8ace008d0236aab3131
David Paleino
d.paleino at gmail.com
Fri Jun 5 06:35:34 UTC 2009
The following commit has been merged in the master branch:
commit 69e956e17422dc1ea192f8ace008d0236aab3131
Author: David Paleino <d.paleino at gmail.com>
Date: Fri Jun 5 08:35:24 2009 +0200
Split chkconfig completion to contrib/chkconfig
diff --git a/CHANGES b/CHANGES
index 885a4e8..7ecb63d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -20,6 +20,7 @@ bash-completion (1.x)
* Don't install _subversion anymore
* Split autorpm completion to contrib/autorpm
* Split jar completion to contrib/jar
+ * Split chkconfig completion to contrib/chkconfig
[ Ville Skyttä ]
* Split yum and yum-arch completion into contrib/yum.
diff --git a/Makefile.am b/Makefile.am
index fa03f99..8524ea1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,6 +12,7 @@ bashcomp_DATA = contrib/ant \
contrib/bluez-utils \
contrib/brctl \
contrib/bzip2 \
+ contrib/chkconfig \
contrib/cfengine \
contrib/cksfv \
contrib/clisp \
diff --git a/bash_completion b/bash_completion
index cce580c..0b022e0 100644
--- a/bash_completion
+++ b/bash_completion
@@ -2138,46 +2138,6 @@ _chsh()
}
complete -F _chsh chsh
-# chkconfig(8) completion
-#
-have chkconfig &&
-_chkconfig()
-{
- local cur prev split=false
-
- COMPREPLY=()
- cur=`_get_cword`
- prev=${COMP_WORDS[COMP_CWORD-1]}
-
- _split_longopt && split=true
-
- case "$prev" in
- @(?(--level=)[1-6]|--@(list|add|del|override)))
- _services
- return 0
- ;;
- --level)
- COMPREPLY=( $( compgen -W '1 2 3 4 5 6' -- $cur ) )
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--list --add --del --override \
- --level' -- $cur ) )
- else
- if [ $COMP_CWORD -eq 2 -o $COMP_CWORD -eq 4 ]; then
- COMPREPLY=( $( compgen -W 'on off reset \
- resetpriorities' -- $cur ) )
- else
- _services
- fi
- fi
-} &&
-complete -F _chkconfig chkconfig
-
# This function provides simple user at host completion
#
_user_at_host() {
diff --git a/contrib/chkconfig b/contrib/chkconfig
new file mode 100644
index 0000000..d992bf9
--- /dev/null
+++ b/contrib/chkconfig
@@ -0,0 +1,39 @@
+# chkconfig(8) completion
+#
+have chkconfig &&
+_chkconfig()
+{
+ local cur prev split=false
+
+ COMPREPLY=()
+ cur=`_get_cword`
+ prev=${COMP_WORDS[COMP_CWORD-1]}
+
+ _split_longopt && split=true
+
+ case "$prev" in
+ @(?(--level=)[1-6]|--@(list|add|del|override)))
+ _services
+ return 0
+ ;;
+ --level)
+ COMPREPLY=( $( compgen -W '1 2 3 4 5 6' -- $cur ) )
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--list --add --del --override \
+ --level' -- $cur ) )
+ else
+ if [ $COMP_CWORD -eq 2 -o $COMP_CWORD -eq 4 ]; then
+ COMPREPLY=( $( compgen -W 'on off reset \
+ resetpriorities' -- $cur ) )
+ else
+ _services
+ fi
+ fi
+} &&
+complete -F _chkconfig chkconfig
--
bash-completion
More information about the Bash-completion-commits
mailing list