caching: output error on invalid action param

for bootstrap, the check is moved to the case statement for greater
robustness, and for consistency with other scripts.

Gbp-Dch: Ignore
This commit is contained in:
Lyndon Brown 2020-05-02 13:43:22 +01:00
parent da1fab1161
commit b20979334c
2 changed files with 10 additions and 5 deletions

View File

@ -21,11 +21,6 @@ USAGE="${PROGRAM} {restore|save} [--force]"
_ACTION="${1}" _ACTION="${1}"
shift shift
if ! In_list "${_ACTION}" restore save; then
Echo_error "Invalid action parameter"
exit 1
fi
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
@ -98,4 +93,9 @@ case "${_ACTION}" in
# Creating stage file # Creating stage file
Create_stagefile "${STAGE_FILE}" Create_stagefile "${STAGE_FILE}"
;; ;;
*)
Echo_error "Invalid action parameter: '${_ACTION}'"
Usage --fail
;;
esac esac

View File

@ -76,4 +76,9 @@ case "${_ACTION}" in
# Creating stage file # Creating stage file
Create_stagefile "${STAGE_FILE}" Create_stagefile "${STAGE_FILE}"
;; ;;
*)
Echo_error "Invalid action parameter: '${_ACTION}'"
Usage --fail
;;
esac esac