We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5fb991e commit a06b5f8Copy full SHA for a06b5f8
completions/brctl
@@ -1,4 +1,19 @@
1
# bash completion for brctl -*- shell-script -*-
2
+_brctl_interfaces()
3
+{
4
+ local PATH=$PATH:/sbin
5
+ COMPREPLY=($({
6
+ if [[ -z "$1" ]]; then
7
+ brctl show
8
+ else
9
+ brctl show "$1"
10
+ fi
11
+ } 2>/dev/null | awk \
12
+ '(NR == 1) { next }; (/^\t/) { print $1; next }; { print $4 }'))
13
+
14
+ ((${#COMPREPLY[@]})) &&
15
+ COMPREPLY=($(compgen -W '"${COMPREPLY[@]/%[[:punct:]]/}"' -- "$cur"))
16
+}
17
18
_brctl()
19
{
@@ -25,9 +40,12 @@ _brctl()
25
40
;;
26
41
3)
27
42
case $command in
28
- addif | delif)
43
+ addif)
29
44
_available_interfaces
30
45
46
+ delif)
47
+ _brctl_interfaces "$prev"
48
+ ;;
31
49
stp)
32
50
COMPREPLY=($(compgen -W 'on off' -- "$cur"))
33
51
0 commit comments