Skip to content

Commit 8262664

Browse files
yedayakscop
authored andcommitted
feat(ip): Complete addr add/change/replace options
1 parent b74076c commit 8262664

File tree

1 file changed

+18
-7
lines changed
  • completions

1 file changed

+18
-7
lines changed

completions/ip

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,24 @@ _comp_cmd_ip()
188188
a | addr | address)
189189
case $subcmd in
190190
add | change | replace)
191-
if [[ $prev == dev ]]; then
192-
_comp_compgen_available_interfaces
193-
elif [[ $prev == scope ]]; then
194-
_comp_cmd_ip__iproute2_etc rt_scopes
195-
else
196-
: # TODO
197-
fi
191+
case $prev in
192+
dev | label)
193+
_comp_compgen_available_interfaces
194+
;;
195+
scope)
196+
_comp_cmd_ip__iproute2_etc rt_scopes
197+
;;
198+
broadcast | anycast | peer | metric)
199+
:
200+
;;
201+
valid_lft | preferred_lft)
202+
_comp_compgen -- -W 'forever'
203+
;;
204+
*)
205+
_comp_compgen -- -W 'anycast autojoin broadcast dev home label scope nodad metric mngtmpaddr
206+
noprefixroute valid_lft peer preferred_lft'
207+
;;
208+
esac
198209
;;
199210
del)
200211
if [[ $prev == dev ]]; then

0 commit comments

Comments
 (0)