From 983477d740f3aeb5b9d4bc7034fd9b73e7e9f61e Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Mar 08 2011 17:21:41 +0000 Subject: Update cli_doParseArguments.sh: - Do not implement "required options", that is ambiguous. No matter if the same option is passed more than once, the last option value is the one used. Likewise, if some option that provides required information (e.g., --render) is not passed, there is no problem since when the such required information be verified centos-art output an error message explaining that required information need to be provided. --- diff --git a/Scripts/Bash/Cli/Functions/cli_doParseArguments.sh b/Scripts/Bash/Cli/Functions/cli_doParseArguments.sh index 3b8718d..b6ad3d8 100755 --- a/Scripts/Bash/Cli/Functions/cli_doParseArguments.sh +++ b/Scripts/Bash/Cli/Functions/cli_doParseArguments.sh @@ -26,27 +26,6 @@ function cli_doParseArguments { - local ARG1='' - local ARG2='' - local COUNT=0 - - # Verify no option has been passed twice in the command-line. - for ARG1 in $ARGUMENTS;do - ARG1=$(echo $ARG1 | sed -r "s!^'(--[[:alpha:]-]+)=?.+'!\1!") - for ARG2 in $ARGUMENTS;do - ARG2=$(echo $ARG2 | sed -r "s!^'(--[[:alpha:]-]+)=?.+'!\1!") - if [[ $ARG1 == $ARG2 ]];then - COUNT=$(($COUNT + 1)) - fi - #echo "$ARG1 : $ARG2 : $COUNT" - if [[ $COUNT -gt 1 ]];then - cli_printMessage "`eval_gettext "The option \\\`\\\$ARG1' can't be duplicated."`" 'AsErrorLine' - cli_printMessage "$(caller)" 'AsToKnowMoreLine' - fi - done - COUNT=0 - done - # Reset positional parameters using optional arguments. eval set -- "$ARGUMENTS"