The commandline interface reference

< CLI Introduction Expressions >

Commandline options

The terp launcher supports a -help option that lists all available commandline arguments. Currently, an invocation with the -help argument displays the following:

C:\terp\bin>terp -help
terp [options] [text|expr]
Options:
  -help, -h              print this message
  -version               print the version information and exit
  -diagnostics           print information that might be helpful to
                         diagnose or report problems.
  -encoding, -enc        set the encoding used for console output
  -quiet, -q             be extra quiet
  -verbose, -v           be extra verbose
  -cmd, -c <expr>        execute the given command 
  -debug, -d             print debugging information
  -expr, -e              expression evaluation mode
  -interactive, -i       interactive evaluation mode 
  -text, -t              text expansion mode
  -script, -s <file>     script file (implies expression mode)
  -file, -f <file>       template file (implies text mode)
  -D<property>=<value>   use value for given property
  -props, -p <file>      load all properties from file with -D
                         properties taking precedence
  -E<property>=<expr>    use evaluated expression for given property
  -eprops, -ep <file>    load all properties from file with -E
                         properties taking precedence
  -lib <path>            specifies a path to search for jars and classes
  -noexit                don't call System.exit() when done
  -nouserlib             Run terp without using the jar files from
                         ${user.home}/.terp/lib
  -noclasspath           Run terp without using CLASSPATH
  -main <class>          override terp's normal entry point

The most important options are described in the CLI introduction and won't be revisited here. Instead, we'll focus on the options that you don't have to use unless you try to extend terp's built-in capabilities. terp has many built-in types, but you can add support for your own types to the expansion engine. This requires that terp be made aware of the external types. You can do this in multiple ways, following closely the way ANT deals with the same problem.

Where terp finds Java classes

The easiest way of adding jar files to terp is via the system CLASSPATH. The terp launcher will add any CLASSPATH roots to its classloader. You can suppress this standard behavior with the -noclasspath option.

The second easiest way, which has the benefit of not polluting the system-wide CLASSPATH with your terp libraries, is to put the jar files into a .terp/lib subdirectory in your home directory. The terp launcher searches this directory for valid classpath roots and adds them to its classloader. You can suppress this standard behavior with the -nouserlib option.

The most flexible way of adding jar files to the terp engine involves the -lib option. For every invocation of terp, the path following the -lib option is searched for jar files which are then added to the terp classloader. Please note that you will typically supply a path consisting of directories that are expected to contain jar files. This is different from modifying the CLASSPATH where you are expected to add the actual jar files rather than the directories containing the jar files.

Extending terp

The -main option is for system integrators who wish to change major parts of terp's behavior and have access to terp's source code. By supplying an alternate entry point for terp, you can completely change what the terp launcher will do and how it interprets commandline arguments.


Copyright 2006-2016 by Codemesh, Inc., ALL RIGHTS RESERVED

:
terp command line interface
codemesh.com home expressions templates ant about us contact us download   

Commandline