]> git.ipfire.org Git - people/ms/network.git/commitdiff
route: rename route to route static
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Wed, 7 Jun 2017 06:17:38 +0000 (08:17 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 7 Jun 2017 16:32:17 +0000 (18:32 +0200)
Fixes: #11374
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/bash-completion/network
src/network

index 27272e9b09c1eabef8a6102a37f36e251f38db22..ae358bdcb750b67dd25229eb09639ed108e5bada 100644 (file)
@@ -258,6 +258,25 @@ _network_port_subcommand() {
 _network_route() {
        local words=( $@ )
 
+       local commands="static"
+       local cmd="$(_network_find_on_cmdline "${commands}")"
+       if [[ -z "${cmd}" ]]; then
+               COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") )
+               return 0
+       fi
+
+       case "${cmd}" in
+               static)
+                       local args="${words[@]}"
+                       _network_route_static ${args}
+                       ;;
+       esac
+
+}
+
+_network_route_static() {
+       local words=( $@ )
+
        local commands="add list remove reload"
        local cmd="$(_network_find_on_cmdline "${commands}")"
        if [[ -z "${cmd}" ]]; then
index fbb7e9ab67a2ebb7a73efa64602afd5608247886..4d5955fa78c408a7f33566d76f341443df8db7de 100644 (file)
@@ -751,6 +751,32 @@ cli_route() {
        local action=${1}
        shift
 
+       case "${action}" in
+               static)
+                       cli_route_static $@
+                       ;;
+               *)
+                       error "Unrecognized action: ${action}"
+                       cli_run_help network route
+
+                       exit ${EXIT_ERROR}
+                       ;;
+       esac
+
+       exit ${EXIT_OK}
+
+
+}
+
+cli_route_static() {
+       if cli_help_requested $@; then
+               cli_show_man network-route-static
+               exit ${EXIT_OK}
+       fi
+
+       local action=${1}
+       shift
+
        case "${action}" in
                # Add a new route.
                add)