Class NBCLIArgsFile

java.lang.Object
io.nosqlbench.engine.cli.NBCLIArgsFile

public class NBCLIArgsFile extends Object

Synopsis

ArgsFile is a command-line modifier which can take linked list of command args and modify it, and/or modify argsfile refrenced in this way.

ArgsFile Selection

During processing, any occurence of '--argsfile' selects the active argsfile and loads it into the command line in place of the '--argsfile' argument. By default the args file will be loaded if it exists, and a warning will be given if it does not. The '--argsfile-required <somepath>' version will throw an error if the args file is not present, but it will not report any warnings or details otherwise. The `--argsfile-optional <somepath> version will not throw an error if the args file is not present, and it will not report any warnings or details otherwise. A prefix command line can be given to ArgsFile to pre-load any settings. In this way it is possible to easily provide a default args file which will be loaded. For example, A prefix command of '--argsfile-optional <somepath>' will load options if they are available in the specified file, but will otherwise provide no feedback to the user.

ArgsFile Injection

When an argsfile is loaded, it reads a command from each line into the current position of the command line. No parsing is done. Blank lines are ignored. Newlines are used as the argument delimiter, and lines that end with a backslash before the newline are automatically joined together.

ArgsFile Diagnostics

All modifications to the command line should be reported to the logging facility at INFO level. This assumes that the calling layer wants to inform users of command line injections, and that the user can select to be notified of warnings only if desired.

Environment Variables

Simple environment variable substitution is attempted for any pattern which appears as '$' followed by all uppercase letters and underscores. Any references of this type which are not resolvable will cause an error to be thrown.