Class CmdLineArgsProcessor
- java.lang.Object
-
- org.opennms.nephron.testing.benchmark.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, ...)
-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=1and--a=1 --b=0
--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.argandfile2.arg. Parameter lists are treated as alternatives.
--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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCmdLineArgsProcessor.ArgsRepresents an expression for specifying pipeline parameters.static classCmdLineArgsProcessor.ArgValuestatic classCmdLineArgsProcessor.CmdLineArgsstatic classCmdLineArgsProcessor.ParamsRepresents parameter lists for pipeline execution.
-
Field Summary
Fields Modifier and Type Field Description static org.jparsec.pattern.CharPredicateIS_SIMPLE_VALUE
-
Constructor Summary
Constructors Constructor Description CmdLineArgsProcessor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CmdLineArgsProcessor.CmdLineArgsprocess(String... strings)Processes the given command line arguments and derives pipeline arguments as well as additional options.
-
-
-
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.
-
-