summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Paleino <d.paleino@gmail.com>2009-02-05 09:48:44 +0100
committerDavid Paleino <d.paleino@gmail.com>2009-02-05 09:48:44 +0100
commit7058a9b442e6a39a904c7f07f7fd38000ca59755 (patch)
tree436a0ce7c76b2b49f43583d14c2c37446508f8ec
parent6e43c5220af5a6f8077eb82b2651149c2b95a220 (diff)
downloadbash-completion-7058a9b442e6a39a904c7f07f7fd38000ca59755.tar.gz
Added net-tools (mii-tool and mii-diag) completions
-rw-r--r--contrib/net-tools (renamed from to_review/net-tools)23
-rw-r--r--debian/changelog3
2 files changed, 19 insertions, 7 deletions
diff --git a/to_review/net-tools b/contrib/net-tools
index 0fe5a5e0..3a2d545b 100644
--- a/to_review/net-tools
+++ b/contrib/net-tools
@@ -9,15 +9,20 @@ _mii-tool()
local cur prev
COMPREPLY=()
- cur=${COMP_WORDS[COMP_CWORD]}
+ cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
# --name value style option
case $prev in
- -@(F|A))
+ -F)
COMPREPLY=( $( compgen -W '100baseTx-FD 100baseTx-HD \
10baseT-FD 10baseT-HD' -- $cur ) )
- return 0
+ return 0
+ ;;
+ -A)
+ COMPREPLY=( $( compgen -W '100baseT4 100baseTx-FD 100baseTx-HD \
+ 10baseT-FD 10baseT-HD' -- $cur ) )
+ return 0
;;
esac
@@ -27,7 +32,13 @@ _mii-tool()
prev=${cur/=*/}
cur=${cur/*=/}
case "$prev" in
- --@(force|advertise))
+ --force)
+ COMPREPLY=( $( compgen -W '100baseTx-FD \
+ 100baseTx-HD 10baseT-FD \
+ 10baseT-HD' -- $cur ) )
+ return 0
+ ;;
+ --advertise)
COMPREPLY=( $( compgen -W '100baseT4 \
100baseTx-FD 100baseTx-HD 10baseT-FD \
10baseT-HD' -- $cur ) )
@@ -52,7 +63,7 @@ _mii-diag()
local cur prev
COMPREPLY=()
- cur=${COMP_WORDS[COMP_CWORD]}
+ cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
# --name value style option
@@ -70,7 +81,7 @@ _mii-diag()
--all-interfaces -s --status -D --debug -g \
--read-parameters -G --set-parameters -M --msg-level \
-p --phy -r --restart -R --reset -v -V -w --watch \
- -?' -- $cur ) )
+ -? --help' -- $cur ) )
else
_available_interfaces -a
fi
diff --git a/debian/changelog b/debian/changelog
index 1672c6d3..3668416a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ bash-completion (200902xx) UNRELEASED; urgency=low
* Added brctl completion
* Added cpan2dist completion
* Added qemu completion
+ * Added net-tools (mii-tool and mii-diag) completions
[ David Paleino ]
* Added .kar to Timidity completion.
@@ -126,7 +127,7 @@ bash-completion (200902xx) UNRELEASED; urgency=low
* Prevent completion dir from being sourced twice if
BASH_COMPLETION_DIR and BASH_COMPLETION_COMPAT_DIR are equal (Alioth#311433)
- -- David Paleino <d.paleino@gmail.com> Thu, 05 Feb 2009 00:27:02 +0100
+ -- David Paleino <d.paleino@gmail.com> Thu, 05 Feb 2009 09:48:08 +0100
bash-completion (20080705) unstable; urgency=low