From e6a03d560a89a9a749f520fab6279a1f12a6520e Mon Sep 17 00:00:00 2001 From: Jonatan Schlag Date: Wed, 5 Jul 2017 16:19:52 +0200 Subject: [PATCH] zone: change edit syntax for config. The syntax to edit a config is now network zone upl0 config edit similar to the syntax if a zone is edited. The cmd variable is setted to the content of ${1}, because we need the content in this variable if the ${id} is not valid, to print a nice error message. Signed-off-by: Jonatan Schlag Signed-off-by: Michael Tremer --- src/functions/functions.zone | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/functions/functions.zone b/src/functions/functions.zone index 441bf5f..776b63b 100644 --- a/src/functions/functions.zone +++ b/src/functions/functions.zone @@ -556,9 +556,18 @@ zone_config() { zone_config_edit "${zone}" "$@" ;; *) - error "Unrecognized argument: ${cmd}" - cli_usage root-zone-config-subcommands - exit ${EXIT_ERROR} + # Check is we get a valid id + # TODO This could be also a valid hid + local id=${cmd} + + if zone_config_id_is valid ${zone} ${id} && [[ ${1} == "edit" ]]; then + shift 1 + zone_config_edit "${zone}" "${id}""$@" + else + error "Unrecognized argument: ${cmd}" + cli_usage root-zone-config-subcommands + exit ${EXIT_ERROR} + fi ;; esac } -- 2.39.2