The main class to run JudoScript on the command-line is judo
. It normally runs a
script file, but can run a short program specified on the command-line itself, or compile
a script without executing.
To run a script, this is the general format:
java [ java-options ] judo [ judo-option ] script_name [ script-parameters ]JudoScript script file names normally end with
.judo
, although it can be anything;
included file names normally end with .judi
.
The script file and its included files, if any, are located in this order:
JUDOPATH
$HOME/.judobase
c:/judobase
on Windows or /usr/judobase
otherwise
-Dnocp
Java option.)
JUDOPATH
uses the same format as Java CLASSPATH
except that ZIP or JAR files are not
supported. It is optional, and is defined as a JVM system property (the -D option).
JVM CLASSPATH is searched last, ZIP and JAR files can include JudoScript scripts. This can be
turned off if the JVM system property nocp
is specified.
Judo-Option:
-c
: to compile the script only to check for the syntax.
-q
: quite mode, not to display the copy notice.
-x
: to execute the code specified on the command-line. All on rest of the
command-line are concatenated, and an extra Script-Parameters: any further parameters on the command-line are passed in
to the script as its parameters; they are accessible in the program by the predefined constant
array, -name=value
or -name:value
, it is deemed as an option; the
value can be omitted which will be defaulted to 1. These options are accessible in the program
by the predefined constant ordered map
A special JudoScript option, -?
or --helper
, tells the JudoScript engine to print
out a help message, specified at the beginning of the script as UsageDeclaration. The
UsageDeclaration can also specify a minimum number of arguments, and if the number of
arguments on the command-line is less than that, the engine also displays the help message and aborts.