59b678 Update initFunctions.sh and cli.sh scripts.

Authored and Committed by areguera 14 years ago
    Update initFunctions.sh and cli.sh scripts.
    
    
        
file modified
+0 -10
Scripts/Bash/Functions/cli.sh CHANGED
@@ -34,16 +34,6 @@ function cli {
34
34
local ACTIONVAL=''
35
35
local REGEX=''
36
36
local ARGUMENTS=''
37
- local CLINAME=''
38
- local CLIVERSION=''
39
- local CLIDESCRIP=''
40
- local CLICOPYRIGHT=''
41
-
42
- # Define centos-art.sh script personal information.
43
- CLINAME='centos-art.sh'
44
- CLIVERSION='Beta'
45
- CLIDESCRIP="`gettext "Automate frequent tasks inside CentOS Artwork Repository."`"
46
- CLICOPYRIGHT="Copyright (C) 2009, 2010 Alain Reguera Delgado"
47
37
48
38
# Redefine positional parameters stored inside ARGUMENTS variable.
49
39
cli_doParseArgumentsReDef "$@"
file modified
+14 -17
Scripts/Bash/initFunctions.sh CHANGED
@@ -1,7 +1,7 @@
1
1
#!/bin/bash
2
2
#
3
- # initFunctions.sh -- Initializes functions and sets environment
4
- # variables used by centos-art.sh scripts.
3
+ # initFunctions.sh -- Initializes environment variables and functions
4
+ # used by centos-art.sh scripts.
5
5
#
6
6
# Copyright (C) 2009-2010 Alain Reguera Delgado
7
7
#
@@ -24,35 +24,32 @@
24
24
# $Id: initFunctions.sh 80 2010-09-18 06:57:26Z al $
25
25
# ----------------------------------------------------------------------
26
26
27
- # Initizalize gettext internazionalization.
27
+ # Initizalize centos-art.sh gettext internazionalization.
28
28
. gettext.sh
29
29
export TEXTDOMAIN=centos-art.sh
30
30
export TEXTDOMAINDIR=/home/centos/artwork/trunk/Scripts/Bash/Locale
31
31
32
- # Initialize centos-art.sh script functions.
32
+ # Initialize centos-art.sh personal information.
33
+ export CLINAME='centos-art.sh'
34
+ export CLIVERSION='Beta'
35
+ export CLIDESCRIP="`gettext "Automate frequent tasks inside CentOS Artwork Repository."`"
36
+ export CLICOPYRIGHT="Copyright (C) 2009-2010 Alain Reguera Delgado"
37
+
38
+ # Initialize centos-art.sh function scripts.
33
39
FILES=$(ls /home/centos/artwork/trunk/Scripts/Bash/Functions/{cli,cli_*}.sh)
34
- MISSINGFILES=''
35
40
for FILE in $FILES;do
36
41
if [[ -x $FILE ]];then
37
42
. $FILE
38
43
FUNCTION=$(grep '^function ' $FILE | cut -d' ' -f2)
39
44
export -f $FUNCTION
40
45
else
41
- MISSINGFILES="$FILE $MISSINGFILES"
46
+ echo `gettext "The $FILE needs to have execution rights."`
47
+ exit
42
48
fi
43
49
done
44
50
45
- if [[ $MISSINGFILES != '' ]];then
46
- for FILE in $MISSINGFILES;do
51
+ # Unset all variables not considered global in order to start cli
52
+ # execution with a clean environment.
47
- echo `gettext "The $FILE needs to have execution rights."`
48
- done
49
- exit
50
- fi
51
-
52
- # Unset all except gettext's initialization variables in order to
53
- # start cli execution with a clean environment. Only gettext's
54
- # initialization variables are required to pass.
55
53
unset FILE
56
54
unset FILES
57
- unset MISSINGFILES
58
55
unset FUNCTION