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. | |
Add to the default values of an option of an ArgumentParser. | |
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. | |
Appends a list item to the ArgumentParser. | |
Adds a ArgParseOption object to the ArgumentParser. | |
Begins a new section of ArgParseOption the help output of the ArgumentParser. | |
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. | |
Retrieves the value of an argument given by its position. | |
Returns the number of values stored in the specified option. | |
Returns all values of an option given on the command line. | |
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. | |
Gets short description of ArgumentParser. | |
Get version string from ArgumentParser object. | |
Returns whether an option has a default value or not. | |
Returns whether a certain option is registered in the parser. | |
Hides the ArgParseOption defined by the parameter | |
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 ArgumentParser object. | |
Sets date string of ArgumentParser. | |
Set default value of an option of an ArgumentParser. | |
Set help text of argument parser. | |
Set largest allowed value for an option or argument of an ArgumentParser. | |
Set smallest allowed value for an option or argument of an ArgumentParser. | |
Sets whether or not the option defined by the parameter | |
Sets short description of the ArgumentParser object. | |
Set valid values for an argument or option of an ArgumentParser. | |
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