COMPREPLY=( $(compgen -W "$(network raw list-zones)" -- "${cur}") )
}
+_network_color() {
+ local words=( $@ )
+
+ local commands="set reset"
+ local cmd="$(_network_find_on_cmdline "${commands}")"
+ if [[ -z "${cmd}" ]]; then
+ COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") )
+ return 0
+ fi
+}
+
_network_device() {
local words=( $@ )
COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") )
return 0
fi
-
+
case "${cmd}" in
ussd)
# TODO
_network_port_subcommand() {
local words=( $@ )
- local commands="create down edit identify remove status up"
+ local commands="color create down edit identify remove status up"
local cmd="$(_network_find_on_cmdline "${commands}")"
if [[ -z "${cmd}" ]]; then
COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") )
return 0
fi
+
+ local args="${words[@]:1}"
+ case "${cmd}" in
+ color)
+ _network_color ${args}
+ ;;
+ esac
+
}
_network_route() {
local words=( $@ )
- local commands="config disable down edit enable identify port rename status up"
+ local commands="color config 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}") )
return 0
fi
-
+
local args="${words[@]:1}"
case "${cmd}" in
config)
port)
_network_zone_subcommand_port "${zone}" ${args}
;;
+ color)
+ _network_color ${args}
+ ;;
esac
}