Show help for zone creation
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Aug 2015 22:28:20 +0000 (00:28 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Aug 2015 22:28:20 +0000 (00:28 +0200)
If a too small number of arguments is passed, we will
show a help page to create a new zone.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/network

index b036f4e..12e9742 100644 (file)
@@ -603,7 +603,7 @@ cli_zone() {
 
                case "${action}" in
                        new)
-                               zone_new $@
+                               cli_zone_new $@
                                ;;
                        destroy)
                                cli_zone_destroy $@
@@ -624,6 +624,15 @@ cli_zone() {
        fi
 }
 
+cli_zone_new() {
+       if cli_help_requested $@ || [ $# -lt 2 ]; then
+               cli_show_man network-zone-new
+               exit ${EXIT_OK}
+       fi
+
+       zone_new $@
+}
+
 # Removes a zone either immediately, if it is currently down,
 # or adds a tag that the removal will be done when the zone
 # is brought down the next time.