3. GS Amplicon Variant Analyzer Command Line Interface
:
3.5 Creating and Computing a Project with the AVA-CLI
: 3.5.1 Setting CLI Parameters
3.5.1
Setting CLI Parameters
You can use the “set” command to change some of the CLI environment parameters within a script (see section
3.4.14
for the usage statement). The “set” command allows you to change the value of three parameters (verbose, onErrors, and currDir).
set verbose false
set verbose true
set onErrors stop
set onErrors continue
set currDir <
path>
Setting verbose to true enables additional logging to enhance troubleshooting capabilities. Each command is logged as it is executed. This is particularly useful for commands that are dynamically synthesized as a side effect of reading tabular input (see section
3.3.2.3
). However, whether or not verbose mode is set to true, the CLI will report detailed locations (including, as appropriate, the file name of the script, the line of the script, and the line of any external file or table being read) when it encounters errors.
The onErrors parameter controls how the command interpreter handles any errors it encounters. If onErrors is set to stop (the default, unless running the interpreter in “interactive mode”), the command interpreter will halt and exit with a non-zero exit code when an error is encountered. If onErrors is set to continue, the command that encountered an error will be aborted, but the command interpreter will continue running and execute the rest of the commands in the script.
Because changes to a Project’s definition are not permanent until a “save” command is executed, setting the onErrors parameter set to “stop” allows the creation of “transactional” scripts that leave the Project in a consistent state and do not modify the Project definition unless all commands complete without error. This is simply achieved by placing the save command after all the commands that modify the project and with onErrors set to stop: if any of the commands fail, the script will halt, the save command will not be executed, and the Project definition will remain in its original state.
Setting the currDir parameter controls how relative file paths are interpreted by the commands to the CLI. For more information on file paths, see section
3.3.2.6
.