4b8e06 Update verify functionality:

Authored and Committed by areguera 14 years ago
    Update verify functionality:
    
        - Rename OPTIONNAM and OPTIONVAL variable names to ACTIONNAM and
          ACTIONVAL respectively.
    
        - Add positional parameters interpretation using getopt(1) inside
          verify_doEnvironment.sh function.
    
        - The first item (i.e., `[0]') specification, was not specified in
          some arrays. To such arrays, the index specification was added.
          Just to clarify we are working with an array variable.
    
    
        
Scripts/Bash/Functions/Verify/verify.sh CHANGED
@@ -26,7 +26,7 @@
26
26
27
27
function verify {
28
28
29
- # Define global varibales.
29
+ # Define global variables.
30
30
31
31
# Define command-line interface.
32
32
verify_getActions
Scripts/Bash/Functions/Verify/verify_doEnvironment.sh CHANGED
@@ -45,9 +45,34 @@ function verify_doEnvironment {
45
45
INFO[3]="`gettext "Default directory used to retrive translated messages"`"
46
46
INFO[4]="`gettext "Default locale information"`"
47
47
48
+ # Define short options we want to support.
49
+ ARGSS=""
50
+
51
+ # Define long options we want to support.
52
+ ARGSL="filter:"
53
+
54
+ # Parse arguments using getopt(1) command parser.
55
+ cli_doParseArguments
56
+
57
+ # Reset positional parameters using output from (getopt) argument
58
+ # parser.
59
+ eval set -- "$ARGUMENTS"
60
+
61
+ # Define action to take for each option passed.
62
+ while true; do
63
+ case "$1" in
64
+ --filter )
65
+ REGEX="$2"
66
+ shift 2
67
+ ;;
68
+ * )
69
+ break
70
+ esac
71
+ done
72
+
48
73
until [[ $COUNT -eq ${#VARS[*]} ]];do
49
74
50
- # Let the user reduce output using regular expression as
75
+ # Let user to reduce output using regular expression as
51
76
# reference.
52
77
if [[ ${VARS[$COUNT]} =~ $REGEX ]];then
53
78
Scripts/Bash/Functions/Verify/verify_getActions.sh CHANGED
@@ -26,7 +26,7 @@
26
26
27
27
function verify_getActions {
28
28
29
- case $OPTIONNAM in
29
+ case $ACTIONNAM in
30
30
31
31
--packages )
32
32
verify_doPackages
Scripts/Bash/Functions/Verify/verify_pathToCli.sh CHANGED
@@ -39,11 +39,11 @@ function verify_pathToCli {
39
39
40
40
# Define files required by the centos-art.sh script command line
41
41
# interface.
42
- REPOFILES=${REPODIRS[2]}/centos-art.sh
42
+ REPOFILES[0]=${REPODIRS[2]}/centos-art.sh
43
43
44
44
# Define symbolic links required by the centos-art.sh script
45
45
# command line interface.
46
- REPOLINKS=${REPODIRS[1]}/centos-art
46
+ REPOLINKS[0]=${REPODIRS[1]}/centos-art
47
47
48
48
# Check defined directories.
49
49
for FILE in "${REPODIRS[@]}";do
Scripts/Bash/Functions/Verify/verify_pathToFonts.sh CHANGED
@@ -40,10 +40,10 @@ function verify_pathToFonts {
40
40
REPODIRS[1]=/home/centos/artwork/trunk/Identity/Fonts/Ttf
41
41
42
42
# Define font related files.
43
- REPOFILES=${REPODIRS[1]}/denmark.ttf
43
+ REPOFILES[0]=${REPODIRS[1]}/denmark.ttf
44
44
45
45
# Define font related symbolic links.
46
- REPOLINKS=${REPODIRS[0]}/denmark.ttf
46
+ REPOLINKS[0]=${REPODIRS[0]}/denmark.ttf
47
47
48
48
# Check defined directories.
49
49
for FILE in "${REPODIRS[@]}";do
Scripts/Bash/Functions/Verify/verify_pathToInkscape.sh CHANGED
@@ -40,11 +40,11 @@ function verify_pathToInkscape {
40
40
41
41
# Define files required by the centos-art.sh script command line
42
42
# interface.
43
- REPOFILES=${REPODIRS[1]}/CentOS.gpl
43
+ REPOFILES[0]=${REPODIRS[1]}/CentOS.gpl
44
44
45
45
# Define symbolic links required by the centos-art.sh script
46
46
# command line interface.
47
- REPOLINKS=${REPODIRS[0]}/CentOS.gpl
47
+ REPOLINKS[0]=${REPODIRS[0]}/CentOS.gpl
48
48
49
49
# Check defined directories.
50
50
for FILE in "${REPODIRS[@]}";do