Skip to content

Commit

Permalink
feat(ip): Complete addr add/change/replace options
Browse files Browse the repository at this point in the history
  • Loading branch information
yedayak authored and scop committed May 9, 2024
1 parent b74076c commit 8262664
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions completions/ip
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,24 @@ _comp_cmd_ip()
a | addr | address)
case $subcmd in
add | change | replace)
if [[ $prev == dev ]]; then
_comp_compgen_available_interfaces
elif [[ $prev == scope ]]; then
_comp_cmd_ip__iproute2_etc rt_scopes
else
: # TODO
fi
case $prev in
dev | label)
_comp_compgen_available_interfaces
;;
scope)
_comp_cmd_ip__iproute2_etc rt_scopes
;;
broadcast | anycast | peer | metric)
:
;;
valid_lft | preferred_lft)
_comp_compgen -- -W 'forever'
;;
*)
_comp_compgen -- -W 'anycast autojoin broadcast dev home label scope nodad metric mngtmpaddr
noprefixroute valid_lft peer preferred_lft'
;;
esac
;;
del)
if [[ $prev == dev ]]; then
Expand Down

0 comments on commit 8262664

Please sign in to comment.