Skip to content

Commit 43beafc

Browse files
yedayakscop
authored andcommitted
feat(ip): Complete ip route list options
1 parent ba80203 commit 43beafc

File tree

1 file changed

+20
-5
lines changed
  • completions

1 file changed

+20
-5
lines changed

completions/ip

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,26 @@ _comp_cmd_ip()
249249
r | route)
250250
case $subcmd in
251251
list | flush | save)
252-
if [[ $prev == proto ]]; then
253-
_comp_cmd_ip__iproute2_etc rt_protos
254-
else
255-
: # TODO
256-
fi
252+
case "$prev" in
253+
proto)
254+
_comp_cmd_ip__iproute2_etc rt_protos
255+
;;
256+
table)
257+
_comp_compgen -- -W 'local main default all'
258+
;;
259+
scope)
260+
_comp_cmd_ip__iproute2_etc rt_scopes
261+
;;
262+
root | match | exact | vrf)
263+
: # TODO: Can we complete vrf?
264+
;;
265+
type)
266+
_comp_compgen -- -W 'unicast local broadcast multicast throw unreachable prohibit blackhole nat'
267+
;;
268+
*)
269+
_comp_compgen -- -W 'root match exact table vrf proto type scope'
270+
;;
271+
esac
257272
;;
258273
get)
259274
case $prev in

0 commit comments

Comments
 (0)