Class CmdLineArgsProcessor


  • public class CmdLineArgsProcessor
    extends Object
    Processes command line arguments into a corresponding argument expression and additional options.

    For testing it is convenient to run the pipeline for several different parameter lists. There is a combinatorial explosion if multiple parameters are varied. In order to define parameter lists succinctly, argument expressions are used to describe possible argument lists. Simpler argument expressions can be combined by '&' and '|' combinators into more complex argument expressions. The following simple arguments expressions are supported:

    --arg=simpleValue
    standard argument assignment
    --arg=(value1|value2|value3)
    enumerated alternative argument values
    --arg=(start#step#count)
    start, step, and count are long numbers that describe a set of values, namely (start, start+step, start+2*step, ...)
    Simple argument expressions can directly be supplied on the command line. Using the -e "<expr>" command line option, argument expressions using the 'amp;' and '|' combinator can be supplied. E.g.:
    -e "--arg1=(a|b) & --arg2=(u|v)
    Defines 4 parameter lists, namely: "--arg1=a --arg2=u", "--arg1=a --arg2=v", "--arg1=b --arg2=u", and "--arg1=b --arg2=v"
    Note that the '&' can be omitted, i.e. the same result is achieved by -e "--arg1=(a|b) --arg2=(u|v)
    -e "--a=0 --b=1 | --a=1 --b=0"
    Defines two parameter lists, namely: --a=0 --b=1 and --a=1 --b=0
    It is also possible to store argument expressions in files and include these using an --include=<file> argument. Argument expression files can contain multiple lines where each line represents an alternative list of parameters. Empty lines and lines starting with a '#' character are skipped. Multiple alternative files can also be included:
    --include=file1.arg
    Includes a single file
    --include(file1.arg|file2.arg)
    Includes parameter lists from file1.arg and file2.arg. Parameter lists are treated as alternatives.
    In argument expression files the '&' and '|' operator can be used. Argument expression files can also contain nested --include=... arguments, thereby allowing modularization of argument expressions.

    If an argument is specified several times then the first occurrence takes precedence. This allows to override argument values in argument files by specifying their values on the command line before --include=... arguments.

    The benchmark launcher supports a couple of options that can only be used directly on the command line (i.e. not in argument expressions). All of these options start with a single '-'. These options are:

    -e "expr"
    Specifies argument definition expression. (Can be used multiple times.)
    -before <commmand>
    A command that is executed before each pipeline run.
    -after <commmand>
    A command that is executed after each pipeline run.
    -out <file>
    A file where execution times, parameters, and results are recorded.
    • Field Detail

      • IS_SIMPLE_VALUE

        public static final org.jparsec.pattern.CharPredicate IS_SIMPLE_VALUE
    • Constructor Detail

      • CmdLineArgsProcessor

        public CmdLineArgsProcessor()
    • Method Detail

      • process

        public static CmdLineArgsProcessor.CmdLineArgs process​(String... strings)
        Processes the given command line arguments and derives pipeline arguments as well as additional options.