1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
#include <iostream>
#include <seqan/arg_parse.h>
int main()
{
seqan::ArgumentParser parser("base");
//![setMinMax]
seqan::addOption(parser, seqan::ArgParseOption(
"i", "integer-value", "An integer option",
seqan::ArgParseArgument::INTEGER, "INT"));
seqan::setMinValue(parser, "i", "10");
seqan::setMaxValue(parser, "integer-value", "20");
//![setMinMax]
//![setRequired]
seqan::addOption(parser, seqan::ArgParseOption(
"ir", "required-integer", "An required integer option",
seqan::ArgParseArgument::INTEGER, "INT"));
setRequired(parser, "ir");
//![setRequired]
//![setValidValues]
seqan::addOption(parser, seqan::ArgParseOption(
"", "distance-model", "Distance model, either HAMMING or EDIT.",
seqan::ArgParseArgument::STRING, "STR"));
seqan::setValidValues(parser, "distance-model", "HAMMING EDIT");
//![setValidValues]
//![addFileOption]
seqan::addOption(parser, seqan::ArgParseOption(
"I", "input-file", "Path to the input file",
seqan::ArgParseArgument::INPUT_FILE, "IN"));
seqan::addOption(parser, seqan::ArgParseOption(
"O", "output-file", "Path to the output file",
seqan::ArgParseArgument::OUTPUT_FILE, "OUT"));
//![addFileOption]
//![addFileExtension]
seqan::setValidValues(parser, "input-file", "txt");
seqan::setValidValues(parser, "output-file", "txt");
//![addFileExtension]
//![readFile]
seqan::CharString inputFileName, outputFileName;
seqan::getOptionValue(inputFileName, parser, "input-file");
seqan::getOptionValue(outputFileName, parser, "output-file");
//![readFile]
//![tupleOption]
seqan::addOption(parser, seqan::ArgParseOption(
"r", "range", "The range to modify.",
seqan::ArgParseArgument::INTEGER, "BEGIN END",
false, 2));
//![tupleOption]
//![getTupleValue]
unsigned rangeBegin = 0, rangeEnd = 0;
seqan::getOptionValue(rangeBegin, parser, "range", 0);
seqan::getOptionValue(rangeEnd, parser, "range", 1);
//![getTupleValue]
//![setVersion]
seqan::setShortDescription(parser, "String Modifier");
seqan::setVersion(parser, "1.0");
seqan::setDate(parser, "July 2012");
//![setVersion]
//![addUsageLine]
seqan::addUsageLine(parser,
"[\\fIOPTIONS\\fP] \"\\fITEXT\\fP\"");
seqan::addDescription(parser,
"This program allows simple character modifications to "
"each i-th character.");
//![addUsageLine]
//![addSection]
seqan::addSection(parser, "Modification Options");
//![addSection]
//![addListItem]
seqan::addTextSection(parser, "Examples");
seqan::addListItem(parser,
"\\fBmodify_string\\fP \\fB-U\\fP \\fIveryverylongword\\fP",
"Print upper case version of \"veryverylongword\"");
seqan::addListItem(parser,
"\\fBmodify_string\\fP \\fB-L\\fP \\fB-i\\fP \\fI3\\fP \\fIveryverylongword\\fP",
"Print \"veryverylongword\" with every third character "
"converted to upper case.");
//![addListItem]
return 0;
}
|