PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
main.cpp
Go to the documentation of this file.
1 
2 /***************************************
3  Auteur : Pierre Aubert
4  Mail : pierre.aubert@lapp.in2p3.fr
5  Licence : CeCILL-C
6 ****************************************/
7 
8 #include "OptionParser.h"
9 
11 
14  OptionParser parser(true, "1.0.0");
15  parser.setExampleLongOption("dps --version");
16  parser.setExampleShortOption("dps -v");
17 
18  parser.addOption("plugin", "p", OptionType::FILENAME, true, PString("Required option"));
19  parser.addOption("otherplugin", "q", OptionType::FILENAME, true, false, "other Required option");
20 
21  PString defaultConfigHost("");
22  parser.addOption("config", "c", defaultConfigHost, "Optional value");
23 
24  parser.addOption("loadonly", "l", OptionType::NONE, false, "Optional Trigger option");
25  return parser;
26 }
27 
28 int main(int argc, char** argv){
30  parser.parseArgument(argc, argv);
31  return 0;
32 }
33 
34 
int main(int argc, char **argv)
Definition: main.cpp:228
OptionParser createOptionParser()
Create the OptionParser of this program.
Definition: main.cpp:17
Parse the options passed to a program.
Definition: OptionParser.h:15
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.
Extends the std::string.
Definition: PString.h:16