[Bash-completion-commits] [SCM] bash-completion branch, master, updated. eced7126a30bb62c49924f0b2dc61f0131317c00
Guillaume Rousse
guillomovitch at zarb.org
Sun May 17 20:13:22 UTC 2009
The following commit has been merged in the master branch:
commit 49940913e8cbd2fe15cfad78cb174ca0facf848b
Author: Guillaume Rousse <guillomovitch at zarb.org>
Date: Sun May 17 22:07:58 2009 +0200
split dhclient completion
diff --git a/bash_completion b/bash_completion
index f232582..cb584b9 100644
--- a/bash_completion
+++ b/bash_completion
@@ -6761,36 +6761,6 @@ _info()
} &&
complete -F _info $filenames info
-# dhclient(1) completion
-#
-have dhclient && _dhclient()
-{
- local cur prev
-
- COMPREPLY=()
- cur=`_get_cword`
- prev=${COMP_WORDS[COMP_CWORD-1]}
-
- case "$prev" in
- -@(cf|lf|pf|sf))
- _filedir
- return 0
- ;;
- -s)
- _known_hosts
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '-p -d -q -1 -r -lf -pf \
- -cf -sf -s -g -n -nw -w' -- $cur ) )
- else
- _available_interfaces
- fi
-} &&
-complete -F _dhclient dhclient
-
# id(1) completion
#
have id &&
diff --git a/contrib/ntpdate b/contrib/dhclient
similarity index 52%
copy from contrib/ntpdate
copy to contrib/dhclient
index 3d5f2b3..0b466d7 100644
--- a/contrib/ntpdate
+++ b/contrib/dhclient
@@ -1,10 +1,9 @@
# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
# ex: ts=8 sw=8 noet filetype=sh
#
-# bash completion for ntpdate
+# bash completion for dhclient
-have ntpdate &&
-_ntpdate()
+have dhclient && _dhclient()
{
local cur prev
@@ -12,22 +11,22 @@ _ntpdate()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
- case $prev in
- -k)
+ case "$prev" in
+ -@(cf|lf|pf|sf))
_filedir
return 0
;;
- -U)
- COMPREPLY=( $( compgen -u $cur ) )
+ -s)
+ _known_hosts
return 0
;;
esac
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '-4 -6 -b -B -d -Q -q -s -u -v -a\
- -e -k -p -o -r -t' -- $cur ) )
+ COMPREPLY=( $( compgen -W '-p -d -q -1 -r -lf -pf \
+ -cf -sf -s -g -n -nw -w' -- $cur ) )
else
- _known_hosts
+ _available_interfaces
fi
} &&
-complete -F _ntpdate ntpdate
+complete -F _dhclient dhclient
--
bash-completion
More information about the Bash-completion-commits
mailing list