Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/utility/parse-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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

Expand Down