From 8db9698f506976f053a2422fab8dcba0a88829a6 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 5 Jun 2010 01:37:45 +0200 Subject: [PATCH] network: Add help for zone command. --- functions.cli | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/functions.cli b/functions.cli index 21bb3c52..3c8bccef 100644 --- a/functions.cli +++ b/functions.cli @@ -148,6 +148,11 @@ function cli_device_discover() { } function cli_zone() { + if cli_help_requested $@; then + cli_usage root-zone + exit ${EXIT_OK} + fi + local action local zone @@ -160,6 +165,11 @@ function cli_zone() { config|down|edit|port|show|status|up) zone_${action} ${zone} $@ ;; + *) + error "Unrecognized argument: ${action}" + cli_usage root-zone-subcommands + exit ${EXIT_ERROR} + ;; esac else action=${1} @@ -169,8 +179,14 @@ function cli_zone() { create|remove) zone_${action} $@ ;; - *) - error "Unrecognized argument: '${action}'" + ""|*) + if [ -n "${action}" ]; then + error "Unrecognized argument: '${action}'" + echo + fi + + cli_usage root-zone + exit ${EXIT_ERROR} ;; esac fi @@ -279,6 +295,24 @@ function cli_usage() { echo " be processed." echo ;; + root-zone) + echo "${0}: ${what#root-} [ ]" + echo + echo " Create or remove a zone." + echo + echo -e " ${BOLD}create ${NORMAL}" + echo " Create a new zone of type where is an allowed" + echo " zone name." + echo + echo -e " ${BOLD}remove ${NORMAL}" + echo " Remove the zone ." + echo + echo " You may also edit the configuration of the zones." + echo + echo -e " ${BOLD} ...${NORMAL}" + echo " Edit the zone ." + echo + ;; usage) echo echo " Run '${0} help' to get information how to use this tool." -- 2.39.5