Class
ArgumentParser
Stores multiple ArgParseOption objects and parses the command line arguments for these options.
ArgumentParser
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
ArgumentParserConstructor
Functions
addArgumentAdds a ArgParseArgument object to the ArgumentParser.
addDefaultValueAdd to the default values of an option of an ArgumentParser.
addDescriptionAppends a description paragraph to the ArgumentParser documentation.
addLineAdds a line of text to the help output of the ArgumentParser in the block of ArgParseOptions.
addListItemAppends a list item to the ArgumentParser.
addOptionAdds a ArgParseOption object to the ArgumentParser.
addSectionBegins a new section of ArgParseOption the help output of the ArgumentParser.
addTextAppends a text paragraph to the ArgumentParser.
addTextSectionAdds a text section to the ArgumentParser.
addTextSubSectionAdds a text subsection to the ArgumentParser.
addUsageLineAdds a line of text to the usage output of the ArgumentParser.
getAppNameGet tool name of ArgumentParser object.
getArgumentReturns a reference to the specified argument.
getArgumentValueRetrieves the value of an argument given by its position.
getArgumentValueCountReturns the number of values stored in the specified option.
getArgumentValuesReturns all values of an option given on the command line.
getCategoryGet tool category of ArgumentParser object.
getOptionReturns a reference to the specified option.
getOptionValueRetrieves the value of an option given either the short or long name.
getOptionValueCountReturns the number of values stored in the specified option.
getOptionValuesReturns all values of an option given on the command line.
getShortDescriptionGets short description of ArgumentParser.
getVersionGet version string from ArgumentParser object.
hasDefaultReturns whether an option has a default value or not.
hasOptionReturns whether a certain option is registered in the parser.
hideOptionHides the ArgParseOption defined by the parameter name (which can be either the short or the long name) from the help screen.
isSetReturns whether an option was set on the parsed command line.
parseParses the command line.
printHelpPrints the complete help message for the parser to a stream.
printShortHelpPrints a short help message for the parser to a stream
printVersionPrints the version information of the parser to a stream.
setAppNameSets application name of ArgumentParser.
setCategorySet tool category for ArgumentParser object.
setDateSets date string of ArgumentParser.
setDefaultValueSet default value of an option of an ArgumentParser.
setHelpTextSet help text of argument parser.
setMaxValueSet largest allowed value for an option or argument of an ArgumentParser.
setMinValueSet smallest allowed value for an option or argument of an ArgumentParser.
setRequiredSets whether or not the option defined by the parameter name (which can be either the short or the long name) is mandatory.
setShortDescriptionSets short description of the ArgumentParser object.
setValidValuesSet valid values for an argument or option of an ArgumentParser.
setVersionSets version string of ArgumentParser.
writeCTDExports the app's interface description to a .ctd file.
Examples
The following gives a simple example of how to use the ArgumentParser.
ArgumentParser parser("alf");
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");
SeqAn - Sequence Analysis Library - www.seqan.de
 

Page built @2013/07/11 09:12:16