From f62945eaacd54f39be57456599d95a908f52a202 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Jan 03 2011 14:37:13 +0000 Subject: Update `shell' functionality: - Start using 2009-2011 year range in copyright note. - Move command-line argument interpretation from shell_updateCopyright to shell_getActions. - Move regular expression re-definition from shell_updateCopyright to shell_getActions.sh. The regular expression definition (REGEX) in shell_getActions is valid for all actions that take place inside `shell' functionality. If a specific regular expression value is required for an specific action then, the regular expression needs to be redefined inside that specific action to overlap shell_getActions definition. --- diff --git a/Scripts/Bash/Functions/Shell/shell.sh b/Scripts/Bash/Functions/Shell/shell.sh index 40a17d2..bd3323c 100755 --- a/Scripts/Bash/Functions/Shell/shell.sh +++ b/Scripts/Bash/Functions/Shell/shell.sh @@ -3,7 +3,7 @@ # shell.sh -- This function provides very basic string manipulations # to help you maintain Bash scripts inside repository. # -# Copyright (C) 2009, 2010 Alain Reguera Delgado +# Copyright (C) 2009-2011 Alain Reguera Delgado # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as diff --git a/Scripts/Bash/Functions/Shell/shell_getActions.sh b/Scripts/Bash/Functions/Shell/shell_getActions.sh index cd63d9f..a2584cb 100755 --- a/Scripts/Bash/Functions/Shell/shell_getActions.sh +++ b/Scripts/Bash/Functions/Shell/shell_getActions.sh @@ -3,7 +3,7 @@ # shell_getActions.sh -- This function interpretes arguments passed to # `shell' functionality and calls actions accordingly. # -# Copyright (C) 2009, 2010 Alain Reguera Delgado +# Copyright (C) 2009-2011 Alain Reguera Delgado # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -88,6 +88,9 @@ function shell_getActions { cli_printMessage "$(caller)" 'AsToKnowMoreLine' fi + # Re-define regular expression to match shell files only. + REGEX=$(echo "${REGEX}.*\.(bash|shell|sh)") + # Execute action name. if [[ $ACTIONNAM =~ "^${FUNCNAM}_[A-Za-z]+$" ]];then eval $ACTIONNAM diff --git a/Scripts/Bash/Functions/Shell/shell_updateCopyright.sh b/Scripts/Bash/Functions/Shell/shell_updateCopyright.sh index 9f1076b..7578e3a 100755 --- a/Scripts/Bash/Functions/Shell/shell_updateCopyright.sh +++ b/Scripts/Bash/Functions/Shell/shell_updateCopyright.sh @@ -5,7 +5,7 @@ # templates available. Use this function to maintain shell scripts top # comments inside repository. # -# Copyright (C) 2009, 2010 Alain Reguera Delgado +# Copyright (C) 2009-2011 Alain Reguera Delgado # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -121,34 +121,6 @@ function shell_updateCopyright { done - # Define short options we want to support. - local ARGSS="" - - # Define long options we want to support. - local ARGSL="filter:" - - # Parse arguments using getopt(1) command parser. - cli_doParseArguments - - # Reset positional parameters using output from (getopt) argument - # parser. - eval set -- "$ARGUMENTS" - - # Define action to take for each option passed. - while true; do - case "$1" in - --filter ) - REGEX="$2" - shift 2 - ;; - * ) - break - esac - done - - # Re-define regular expression to match shell files only. - REGEX=$(echo "${REGEX}.*\.(bash|shell|sh)") - # Define list of files to process. cli_getFilesList