From c25cec16e4276158c351cbd5d8efb7236d6fb181 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Mar 11 2011 18:31:39 +0000 Subject: Update identity_getActions.sh: - Stop using --copy and --render options in favor of start using remaining arguments from option processing to build the action value we previously passed to --render functionality. Also, using remaining arguments is very useful to pass more than one argument in the command line and so process them in just one command. - The --copy option will be completly removed from rendition functionality. The --copy option will have its own functionality. --- diff --git a/Scripts/Bash/Cli/Functions/Identity/identity_getActions.sh b/Scripts/Bash/Cli/Functions/Identity/identity_getActions.sh index bf6c691..4f0e5cd 100644 --- a/Scripts/Bash/Cli/Functions/Identity/identity_getActions.sh +++ b/Scripts/Bash/Cli/Functions/Identity/identity_getActions.sh @@ -44,18 +44,6 @@ function identity_getActions { case "$1" in - --render ) - ACTIONNAM="${FUNCNAM}_render" - ACTIONVAL="$2" - shift 2 - ;; - - --copy ) - ACTIONVAL="$2" - ACTIONNAM="${FUNCNAME}_copy" - shift 2 - ;; - --releasever ) FLAG_RELEASE="$2" if [[ ! $FLAG_RELEASE =~ $(cli_getPathComponent '--release-pattern') ]];then @@ -100,25 +88,30 @@ function identity_getActions { esac done - # Check action value. Be sure the action value matches the - # convenctions defined for source locations inside the working - # copy. - cli_checkRepoDirSource - - # Syncronize changes between the working copy and the central - # repository to bring down changes. - cli_syncroRepoChanges - - # Execute action name. - if [[ $ACTIONNAM =~ "^${FUNCNAM}_[A-Za-z]+$" ]];then - eval $ACTIONNAM - else - cli_printMessage "`gettext "A valid action is required."`" 'AsErrorLine' - cli_printMessage "$(caller)" 'AsToKnowMoreLine' - fi - - # Syncronize changes between the working copy and the central - # repository to commit up changes. - cli_commitRepoChanges + # Read remaining arguments and build the action value from them. + # At this point all options should be processed. + for ACTIONVAL in "$@";do + + if [[ $ACTIONVAL == '--' ]];then + continue + fi + + # Check action value. Be sure the action value matches the + # convenctions defined for source locations inside the working + # copy. + cli_checkRepoDirSource + + # Syncronize changes between the working copy and the central + # repository to bring down changes. + cli_syncroRepoChanges + + # Execute action name. + eval ${FUNCNAM}_render + + # Syncronize changes between the working copy and the central + # repository to commit up changes. + cli_commitRepoChanges + + done }