Class
ArgumentParser
Stores multiple ArgParseOption objects and parses the command line arguments for these options.
Include Headers
seqan/arg_parse.h
Remarks
See the documentation of ToolDoc on how to format text.
Where possible, formatting is added automatically for you.
You have to use formatting in the following places: (1) usage lines, (2) option help texts, (3) description and additional text sections.
Member Functions
Constructor |
Functions
Adds a ArgParseArgument object to the ArgumentParser. | |
Adds/appends a new value to the list of default values. | |
Appends a description paragraph to the ArgumentParser documentation. | |
Adds a line of text to the help output of the ArgumentParser in the block of ArgParseOptions. | |
Add list item to ToolDoc object. Appends a list item to the ArgumentParser. | |
Adds a ArgParseOption object to the ArgumentParser. | |
Add section to ToolDoc object. Begins a new section of ArgParseOption the help output of the ArgumentParser. | |
Add text line/paragraph to ToolDoc. Appends a text paragraph to the ArgumentParser. | |
Adds a text section to the ArgumentParser. | |
Adds a text subsection to the ArgumentParser. | |
Adds a line of text to the usage output of the ArgumentParser. | |
Get tool name of ArgumentParser object. | |
Returns a reference to the specified argument. | |
Returns the value of the ArgParseArgument object. If the ArgParseArgument is a list or can hold multiple values (numberOfArguments) you can specify which value you want to get. If not set the first value will be returned. Retrieves the value of an argument given by its position. | |
Returns the number of values stored in the specified option. | |
Returns all values of the ArgParseArgument object as const std::vector. Returns all values of an option given on the command line. | |
Get tool category of ToolDoc object. Get tool category of ArgumentParser object. | |
Returns a reference to the specified option. | |
Retrieves the value of an option given either the short or long name. | |
Returns the number of values stored in the specified option. | |
Returns all values of an option given on the command line. | |
Get short description of ToolDoc object. Gets short description of ArgumentParser. | |
Get version string from ToolDoc object. Get version string from ArgumentParser object. | |
Returns true if a default value was given for that argument. Returns whether an option has a default value or not. | |
Returns whether a certain option is registered in the parser. | |
Hides the ArgParseOption from the help screen.
Hides the ArgParseOption defined by the parameter | |
Returns true if a value was assigned to the argument. Returns whether an option was set on the parsed command line. | |
Parses the command line. | |
Prints the complete help message for the parser to a stream. | |
Prints a short help message for the parser to a stream | |
Prints the version information of the parser to a stream. | |
Sets application name of ArgumentParser. | |
Set tool category for ToolDoc object. Set tool category for ArgumentParser object. | |
Set date string for ToolDoc object. Sets date string of ArgumentParser. | |
Sets the default value for the given option. | |
Sets the maximum value of a ArgParseArgument object. | |
Sets the minimum value of a ArgParseArgument object. | |
Sets whether or not the option is mandatory.
Sets whether or not the option defined by the parameter | |
Set short description for ToolDoc object. Sets short description of the ArgumentParser object. | |
Sets the set of allowed values of a ArgParseArgument object. | |
Set version string for ToolDoc object. Sets version string of ArgumentParser. | |
Exports the app's interface description to a .ctd file. |
Examples
The following gives a simple example of how to use the ArgumentParser.
setShortDescription(parser, "Alignment free sequence comparison");
setVersion(parser, "1.0");
setDate(parser, "Jan 2010");
addUsageLine(parser, "[\fIOPTIONS\fP] \fB-i\fP \fIIN\fP \fB-o\fP \fIOUT\fP");
addDescription(parser,
"ALF can be used to calculate the pairwise similarity of sequences "
"using alignment-free methods. All methods which are implemented are "
"based on k-mer counts.");
addOption(parser, ArgParseOption("i", "inputFile", "Name of the multi-FASTA input.",
ArgParseArgument(ArgParseArgument::INPUTFILE, "IN")));
setRequired(parser, "i");
addOption(parser, ArgParseOption("o", "outputFile", "Name of the multi-FASTA input.",
ArgParseArgument(ArgParseArgument::OUTPUTFILE, "OUT")));
setRequired(parser, "o");
addTextSection(parser, "See Also");
addText(parser, "http://www.seqan.de/projects/alf");
See Also
SeqAn - Sequence Analysis Library - www.seqan.de