|
| | CommandlineParser (String tool_name, String tool_description, String tool_version, String build_date, String category="") |
| |
| void | setToolManual (const String &manual) |
| |
| void | registerParameter (String name, String description, ParameterType type, bool mandatory=false, String default_value="", bool hidden=false) |
| |
| void | registerFlag (String name, String description, bool default_gui_value=false, bool hidden=false) |
| |
| void | registerAdvancedParameters (Options &options) |
| |
| void | setParameterAsAdvanced (String name) |
| |
| void | setParameterRestrictions (String par_name, double min_value, double max_value) |
| |
| void | setParameterRestrictions (String par_name, list< String > &allowed_values) |
| |
| void | setOutputFormatSource (String output_parname, String input_parname) |
| |
| void | setSupportedFormats (String par_name, String supported_formats) |
| |
| void | parse (int argc, char *argv[]) |
| |
| void | copyAdvancedParametersToOptions (Options &options) |
| |
| const String & | get (String name) |
| |
| bool | has (String name) |
| |
| const list< String > & | getList (String name) |
| |
| void | printHelp (const std::set< String > ¶meter_names=std::set< String >(), bool show_manual=true) |
| |
| void | printToolInfo () |
| |
| const String & | getStartTime () |
| |
| const String & | getStartCommand () |
| |
Class for parsing parameters specified on the command line.
Register the parameters and flags of your tool with registerParameter(), resp. registerFlag() and have the command-line parsed with parse(). After this, you can retrieve the values of all parameters with get().
In addition to this, you can also register a tool-manual text, define restrictions on parameters and register file-formats that are supported for in- or output-files.
If the parameter '-write_par somefilename.xml' is given to the program, an xml-based parameter-file will be automatically written, containing the specification the tool, all its parameters and all parameter values used on the commend-line.
If the parameter '-par somefilename.xml' is used, such a file can be read, so that the parameter-values stored in it will be used. However, if, although this is not necessary, parameters (other than -par) are specified on the command-line, their values will automatically overload those stored in the xml-file.
The parameter '-env' allows to differentiate between command line ('cmdline') behaviour and special adaptions to workflow systems like galaxy or knime.
Definition at line 45 of file commandlineParser.h.
| void BALL::CommandlineParser::setOutputFormatSource |
( |
String |
output_parname, |
|
|
String |
input_parname |
|
) |
| |
In case of output-files, this functions allows to specify the name of an input-parameter, whose format should be used for the given output-parameter.
Note, that this function will only have an effect on the creation of config-files for workflow-systems (Galaxy, Knime, etc.) and not for the command-line interface, where the user will directly specify output-filenames.