Wiki

Clone wiki

jcRelationAnalysis / Commander

Commander

jcRA uses a scripting system called "Commander" to dynamically control program flow.

Commander scripts (sets of Commander instructions) can be passed on the command-line or in file(s) to be processed.

Command-Line Operation

Including a File

The easiest option is to just specify a file URL (file://PATH) as the first argument:

#!bash

java -jar jcRelationAnalysis.jar file://script.txt
Would start and then follow the instructions contained within script.txt. Note paths can be relative or absolute and do not affect the working directory.

It's also possible to use an internal command (LoadFile) via the arguments to load a file as part of a set, or using a macro (see below).

Command Line Commands

Commands can be used directly as arguments. The underscore (_) is used to delimitate commands, to show where one commands' options end and the next begins.

#!bash

java -jar jcRelationAnalysis.jar X Y Z _ A B _ C
Would load with the commands X (with options Y Z), A (with option B), and C (with no option).

Comments

Comments are indicated by the # character, and means everything after that on the line is ignored.

Macros

Macros can be used to dynamically replace items in commands, options, and other places. By default they are enabled only for options. The characters given here as delimiters are the default and can be changed at runtime or in the code if needed.

Macros contain identifiers and text, and the identifiers are replaced in the text whenever requested. Macros cannot contain other macros. When a macro is undefined the original text including delimiters is returned.

Setting a Macro

Macros are set by using $ followed by a name and then the value, separated by whitespace (as of current version do not use spaces or gaps in macro values).

:::text

$ Name Value
Once set macros are referred to as $Name$
:::text

$ MyName Dave
! Print Hello $MyName$
! Print Hello $AnotherName$
would output:
:::text

Hello Dave
Hello $AnotherName$

Internal Commands

Internal commands are designated with a ! and are those commands executed purely within Commander (no interaction with jcRA at all).

LoadFile

! LoadFile abc.txt

Loads the file abc.txt

Print | Echo

! Print Hello

Prints hello (echo can be used interchangeably)

Updated