14 std::cerr <<
"createOptionParser : create the option parser :" << std::endl;
16 parser.
setExampleLongOption(
"phoenix_tex2html --input=fileInput.tex --output=\"output/Directory\"");
21 std::string defaultOutputDir(
".");
22 parser.
addOption(
"output",
"o", defaultOutputDir,
"output directory where the files will be generated");
24 std::string bibliographyFile(
"");
25 parser.
addOption(
"bibliography",
"b", bibliographyFile,
"input bibliography file");
26 std::string includeDir(
".");
27 parser.
addOption(
"includedirs",
"I", includeDir,
"list of include directories");
33 int main(
int argc,
char** argv){
35 std::cerr <<
"createOptionParser : parse the argument" << std::endl;
39 std::string inputFile;
40 defaultMode.
getValue(inputFile,
"input");
41 std::cout <<
"inputFile = '" << inputFile <<
"'" << std::endl;
43 std::string outputDir(
".");
44 defaultMode.
getValue(outputDir,
"output");
49 std::cout <<
"outputDir = '" << outputDir <<
"'" << std::endl;
51 std::string inputBibliography(
"");
52 defaultMode.
getValue(inputBibliography,
"bibliography");
53 std::cout <<
"inputBibliography = '" << inputBibliography <<
"'" << std::endl;
55 std::vector<std::string> listInclude;
56 defaultMode.
getValue(listInclude,
"includedirs");
57 std::cout <<
"listInclude :" << std::endl;
58 for(std::vector<std::string>::iterator it(listInclude.begin()); it != listInclude.end(); ++it){
59 std::cout <<
"\t" << (*it) << std::endl;
63 std::cout <<
"useMathJax = " << useMathJax << std::endl;
Describe a mode in the program arguments.
bool isOptionExist(const PString &optionName) const
Say if the given option has been passed to the program.
bool getValue(T &value, const PString &optionName) const
Get the value of the option.
Parse the options passed to a program.
void parseArgument(int argc, char **argv)
Parse the arguments passed to the program.
void addOption(const PString &longOption, const PString &shortOption, OptionType::OptionType optionType, bool isRequired, const PString &docString)
Add an option in the OptionParser.
void setExampleShortOption(const PString &example)
Set the example usage of the program.
void setExampleLongOption(const PString &example)
Set the example usage of the program.
const OptionMode & getDefaultMode() const
Get default mode.
int main(int argc, char **argv)
OptionParser createOptionParser()
Create the OptionParser of this program.