From 8b03abbab1b4e4e27d743b3fd7a3b3a63d0e868a Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Wed, 8 May 2024 20:22:22 +0300 Subject: [PATCH] feat(ip): Complete ip route list options --- completions/ip | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/completions/ip b/completions/ip index 76e44c521f5..5c148f8755b 100644 --- a/completions/ip +++ b/completions/ip @@ -249,11 +249,26 @@ _comp_cmd_ip() r | route) case $subcmd in list | flush | save) - if [[ $prev == proto ]]; then - _comp_cmd_ip__iproute2_etc rt_protos - else - : # TODO - fi + case "$prev" in + proto) + _comp_cmd_ip__iproute2_etc rt_protos + ;; + table) + _comp_compgen -- -W 'local main default all' + ;; + scope) + _comp_cmd_ip__iproute2_etc rt_scopes + ;; + root | match | exact | vrf) + : # TODO: Can we complete vrf? + ;; + type) + _comp_compgen -- -W 'unicast local broadcast multicast throw unreachable prohibit blackhole nat' + ;; + *) + _comp_compgen -- -W 'root match exact table vrf proto type scope' + ;; + esac ;; get) case $prev in