summaryrefslogtreecommitdiff
path: root/bash-completion/devlink
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2020-04-04 18:16:16 +0200
committerStephen Hemminger <stephen@networkplumber.org>2020-04-06 10:00:32 -0700
commit0b1875cdc69f49184445781a62e0bf603bdfc414 (patch)
tree016d267d0f35763f276a3bd2764218691435f01d /bash-completion/devlink
parent90ce848b05fc1883ddafcf57af4c7fcbafd85833 (diff)
downloadiproute2-0b1875cdc69f49184445781a62e0bf603bdfc414.tar.gz
devlink: fix encap mode manupulation
DEVLINK_ATTR_ESWITCH_ENCAP_MODE netlink attribute carries enum. But the code assumes bool value. Fix this by treating the encap mode in the same way as other eswitch mode attributes, switching from "enable"/"disable" to "basic"/"none", according to the enum. Maintain the backward compatibility to allow user to pass "enable"/"disable" too. Also to be in-sync with the rest of the "mode" commands, rename to "encap-mode". Adjust the help and man page accordingly. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'bash-completion/devlink')
-rw-r--r--bash-completion/devlink8
1 files changed, 4 insertions, 4 deletions
diff --git a/bash-completion/devlink b/bash-completion/devlink
index 45ca1fe6..8518e7aa 100644
--- a/bash-completion/devlink
+++ b/bash-completion/devlink
@@ -105,11 +105,11 @@ _devlink_dev_eswitch_set()
local -A settings=(
[mode]=notseen
[inline-mode]=notseen
- [encap]=notseen
+ [encap-mode]=notseen
)
if [[ $cword -eq 5 ]]; then
- COMPREPLY=( $( compgen -W "mode inline-mode encap" -- "$cur" ) )
+ COMPREPLY=( $( compgen -W "mode inline-mode encap-mode" -- "$cur" ) )
fi
# Mark seen settings
@@ -132,8 +132,8 @@ _devlink_dev_eswitch_set()
"$cur" ) )
return
;;
- encap)
- COMPREPLY=( $( compgen -W "disable enable" -- "$cur" ) )
+ encap-mode)
+ COMPREPLY=( $( compgen -W "none basic" -- "$cur" ) )
return
;;
esac