Skip to content

Commit 6ccea5f

Browse files
committed
feat(ip): Complete addr add/change/replace options
1 parent 27a0ef8 commit 6ccea5f

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
@@ -181,13 +181,24 @@ _comp_cmd_ip()
181181
a | addr | address)
182182
case $subcmd in
183183
add | change | replace)
184-
if [[ $prev == dev ]]; then
185-
_comp_compgen_available_interfaces
186-
elif [[ $prev == scope ]]; then
187-
_comp_cmd_ip__iproute2_etc rt_scopes
188-
else
189-
: # TODO
190-
fi
184+
case $prev in
185+
dev | label)
186+
_comp_compgen_available_interfaces
187+
;;
188+
scope)
189+
_comp_cmd_ip__iproute2_etc rt_scopes
190+
;;
191+
broadcast | anycast | peer | metric)
192+
:
193+
;;
194+
valid_lft | preferred_lft)
195+
_comp_compgen -- -W 'forever'
196+
;;
197+
*)
198+
_comp_compgen -- -W 'anycast broadcast dev home label scope nodad metric mngtmpaddr
199+
noprefixroute valid_lft peer preferred_lft'
200+
;;
201+
esac
191202
;;
192203
del)
193204
if [[ $prev == dev ]]; then

0 commit comments

Comments
 (0)