Signed-off-by: Jonatan Schlag jonatan.schlag@ipfire.org --- src/bash-completion/network | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/bash-completion/network b/src/bash-completion/network index 091c1cb..f7c58a9 100644 --- a/src/bash-completion/network +++ b/src/bash-completion/network @@ -59,6 +59,16 @@ _network_color() { fi }
+_network_description() { + local words=( $@ ) + + local commands="edit show" + local cmd="$(_network_find_on_cmdline "${commands}")" + if [[ -z "${cmd}" ]]; then + COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") ) + return 0 + fi +} _network_device() { local words=( $@ )
@@ -258,7 +268,7 @@ _network_port() { _network_port_subcommand() { local words=( $@ )
- local commands="color create down edit identify remove status up" + local commands="color create description down edit identify remove status up" local cmd="$(_network_find_on_cmdline "${commands}")" if [[ -z "${cmd}" ]]; then COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") ) @@ -270,6 +280,9 @@ _network_port_subcommand() { color) _network_color ${args} ;; + description) + _network_description ${args} + ;; esac
} @@ -378,7 +391,7 @@ _network_zone_subcommand() {
local words=( $@ )
- local commands="color config disable down edit enable identify port rename status up" + local commands="color config description disable down edit enable identify port rename status up" local cmd="$(_network_find_on_cmdline "${commands}")" if [[ -z "${cmd}" ]]; then COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") ) @@ -396,6 +409,9 @@ _network_zone_subcommand() { color) _network_color ${args} ;; + description) + _network_description ${args} + ;; esac }