diff --git a/src/utility/parse-commands.sh b/src/utility/parse-commands.sh index b227248f..afc7e157 100644 --- a/src/utility/parse-commands.sh +++ b/src/utility/parse-commands.sh @@ -95,7 +95,7 @@ function parse_commands_checkParameterDefinitionIsPair() { } function parseCommands { - if (($# < 5)); then + if (($# < 4)); then logError "At least five arguments need to be passed to parseCommands, given \033[0;36m%s\033[0m\nFollowing a description of the parameters:" "$#" echo >&2 '1: commands the name of an array which contains the command definitions' echo >&2 '2: version the version which shall be shown if one uses --version' @@ -113,6 +113,12 @@ function parseCommands { local -r fnPrefix=$4 shift 4 || die "could not shift by 4" + if (($# < 5 )); then + logError "no command passed to %s, following the output of --help" + echo "" + parse_commands_printHelp parseCommands_paramArr "$version" + fi + parse_commands_checkParameterDefinitionIsPair parseCommands_paramArr exitIfArgIsNotFunction "$sourceFn" 3