From a23bb7d19aab04bf9482051ca1406ede1b4f9a28 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Sep 23 2010 16:58:55 +0000 Subject: * Reorganize variable definition inside base cli_* scripts. * Move license definition into centos-art.sh script license action. --- diff --git a/Scripts/Bash/Functions/License/license.sh b/Scripts/Bash/Functions/License/license.sh index f01ea97..f998e45 100755 --- a/Scripts/Bash/Functions/License/license.sh +++ b/Scripts/Bash/Functions/License/license.sh @@ -25,12 +25,32 @@ function license { + # Define command-line information. + local COMMAND="centos-art.sh" + local DESCRIPTION="$COMMAND - `gettext "Automate frequent tasks inside CentOS Artwork Repository."`" + local RELEASE="alpha" + local COPYRIGHT="Copyright (C) 2009-2010 Alain Reguera Delgado." + local LICENSE="This program is free software; you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA." + # Build license message. - local LICENSE="$CLI_DESCRIPTION + local LICENSE="$DESCRIPTION - $CLI_COPYRIGHT + $COPYRIGHT - $CLI_LICENSE" + $LICENSE" # Output license message. cli_printMessage "$LICENSE" "AsHeadingLine" diff --git a/Scripts/Bash/Functions/cli.sh b/Scripts/Bash/Functions/cli.sh index 36f2f88..40d2b29 100644 --- a/Scripts/Bash/Functions/cli.sh +++ b/Scripts/Bash/Functions/cli.sh @@ -31,26 +31,6 @@ function cli { # Define action variable using first argument (lowercase) value. ACTION=$(cli_getRepoName 'f' "$1") - # Define command-line information. - CLI_COMMAND="centos-art.sh" - CLI_DESCRIPTION="$CLI_COMMAND - `gettext "Automate frequent tasks inside CentOS Artwork Repository."`" - CLI_RELEASE="alpha" - CLI_COPYRIGHT="Copyright (C) 2009-2010 Alain Reguera Delgado." - CLI_LICENSE="This program is free software; you can redistribute - it and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA." - # Define option name (OPTIONNAM) and option value (OPTIONVAL) # variables passed as second argument to the command line # interface when the format is `--option=value' without the value @@ -117,17 +97,6 @@ function cli { OPTIONVAL=$OPTIONVAL/$REGEX fi - # Define centos-art.sh standard paths. - REPO_PATHS[0]=/home/centos - REPO_PATHS[1]=${REPO_PATHS[0]}/bin - REPO_PATHS[2]=${REPO_PATHS[1]}/centos-art - REPO_PATHS[3]=${REPO_PATHS[0]}/artwork/trunk/Scripts/Bash/$CLI_COMMAND - REPO_PATHS[4]=${REPO_PATHS[0]}/artwork/trunk/Scripts/Bash - REPO_PATHS[5]=${REPO_PATHS[0]}/artwork/trunk/Translations - REPO_PATHS[6]=${REPO_PATHS[0]}/.fonts - REPO_PATHS[7]=${REPO_PATHS[0]}/artwork/trunk/Identity/Fonts/Ttf - REPO_PATHS[8]=${REPO_PATHS[0]}/artwork/trunk/Scripts/Bash/Functions - # Define positive answer. Y="`gettext "y"`" diff --git a/Scripts/Bash/Functions/cli_getActions.sh b/Scripts/Bash/Functions/cli_getActions.sh index 1bd8a2e..c2e3e73 100644 --- a/Scripts/Bash/Functions/cli_getActions.sh +++ b/Scripts/Bash/Functions/cli_getActions.sh @@ -31,12 +31,17 @@ function cli_getActions { local ACTIONFILES='' local ACTIONSCRIPT='' local ACTIONFUN='' + local REPOFUNDIR='' + + # Define path to directory where actions are stored inside the + # repository. + REPOFUNDIR=/home/centos/artwork/trunk/Scripts/Bash/Functions # Define action directory. ACTIONDIR=$(cli_getRepoName 'd' $ACTION) # Define action file name. - ACTIONSCRIPT=${REPO_PATHS[8]}/${ACTIONDIR}/${ACTION}.sh + ACTIONSCRIPT=${REPOFUNDIR}/${ACTIONDIR}/${ACTION}.sh # Check action existence. if [[ ! -f $ACTIONSCRIPT ]];then @@ -45,7 +50,7 @@ function cli_getActions { fi # Build action-specifc script file list. - ACTIONFILES=$(ls ${REPO_PATHS[8]}/${ACTIONDIR}/${ACTION}*.sh) + ACTIONFILES=$(ls ${REPOFUNDIR}/${ACTIONDIR}/${ACTION}*.sh) for FILE in $ACTIONFILES;do