Goals
-----

The trunk/Scripts/Bash directory exists to organize the trunk development line of centos-art.sh automation script.  The centos-art.sh script standardizes frequent tasks inside your working copy of CentOS Artwork Repository.

Description
-----------

The best way to understand centos-art.sh automation script is studying its source code. The centos-art.sh script is splited in several configuration and function files which are loaded when the centos-art.sh script is executed. This section describes the order in which centos-art.sh loads its configuration and function files.

When you type the centos-art command in your terminal, the operating system trys to execute that command. In order to execute the command, the operating system needs to know where it is, so the operating system uses the PATH environment variable to look for that command's location. If your system was prepared to use CentOS Artwork Repository correctly (see trunk Scripts Bash Functions Verify), you should have a symbolic link inside ~/bin/ directory that points to the centos-art.sh script file. As ~/bin/ directory is, by default, inside PATH environment variable, the execution of centos-art command runs the centos-art.sh script.

When centos-art.sh script is executed, the first it does is executing the trunk/Scripts/Bash/initFunctions.sh script to initialize global variables (e.g., gettext's variables) and global function scripts.  Global function scripts are located inside trunk/Scripts/Bash/Functions directory and their file names begin with cli. Global function scripts provide common functionalities that can be used anywhere inside centos-art.sh script execution environment.

Once global variables and function scripts have been loaded, centos-art.sh script executes the cli global function from cli.sh function script to retrive command-line arguments and define some default values that may be used later by specific function scripts (see trunk Scripts Bash Functions).

As convenction, the centos-art.sh command-line arguments have the following format:

centos-art arg1 --arg2=val2 --arg3=val3

In the above example, centos-art is the command you use to invoke centos-art.sh script. The arg1 represents the action you want to do (e.g., verify, render, locale, help, etc.). The remaining arguments are modifiers to arg1. The --arg2 definition is required.  The --arg3 is optional. For example, if you want to render all anaconda progress slides, for all major releases of CentOS distribution, for all languages availabe using TreeFlower motif as background, you use the following command:

centos-art render --entry=trunk/Identity/Themes/Motifs/TreeFlower/Distro/Anaconda/Progress

Now, if you only want to render anaconda progress 01-welcome.png slide, for CentOS distribution major release 5, in English language, you need to add the third argument as follows:

centos-art render --entry=trunk/Identity/Themes/Motifs/TreeFlower/Distro/Anaconda/Progress --filter=5/en/01-welcome

Once command-line arguments have been retrived, the centos-art.sh script loads specific functions using the cli_getActions.sh function script.  For example, if you run the command centos-art render --entry, the centos-art.sh script will look for trunk/Scripts/Bash/Functions/Render directory and will load the render function from render.sh function script; this, in order to achive the rendering task as it defines.

+------------------------------------------------------------------+
| [centos@host]$ centos-art action 'path/to/dir' --option='value'  |
+------------------------------------------------------------------+
| ~/bin/centos-art --> ~/artwork/trunk/Scripts/Bash/centos-art.sh  |
+---v-----------------------------------------v--------------------+
    | centos-art.sh                           |
    +---v---------------------------------v---+
    .   | initFunctions.sh                |   .
    .   +---------------------------------+   .
    .   | cli $@                          |   .
    .   +---v-------------------------v---+   .
    .   .   | cli_getActions $@       |   .   .
    .   .   +---v-----------------v---+   .   .
    .   .   .   | function call 1 |   .   .   .
    .   .   .   | function call 2 |   .   .   .
    .   .   .   | function call n |   .   .   .
    .   .   .   +-----------------+   .   .   .
    .   .   ...........................   .   .
    .   ...................................   .
    ...........................................
Figure: The centos-art.sh initialization environment.

Usage
-----

The centos-art.sh script usage information is described inside each specific function documentation (see trunk Scripts Bash Functions).

See also
--------