The Lean Mean C++ Option Parser
src/testodr1.cc
Go to the documentation of this file.
00001 /* Written 2012 by Matthias S. Benkmann
00002  *
00003  * The author hereby waives all copyright and related rights to the contents
00004  * of this example file (testodr1.cc) to the extent possible under the law.
00005  */
00006 
00023 #include "optionparser.h"
00024 #include "optionparser.h" //intentionally included twice
00025 
00026 #include <cstdio>
00027 
00028 using option::Option;
00029 using option::Descriptor;
00030 
00031 extern const Descriptor usage[];
00032 
00033 extern bool bar(int argc, const char* argv[])
00034 {
00035   printUsage(std::fwrite, stdout, usage);
00036   option::Stats stats(usage, argc, argv);
00037   option::Option buffer [stats.buffer_max];
00038   option::Option options[stats.options_max];
00039   option::Parser parse(usage, argc, argv, options, buffer);
00040   return parse.error();
00041 }
00042 
00043 int main()
00044 {
00045   Descriptor d = usage[0];
00046   std::printf("%s",d.shortopt);
00047 }
00048 
00049 
00050 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator