src/main.cpp

changeset 142
1f5518dd8146
parent 141
68d60e2cfa76
equal deleted inserted replaced
141:68d60e2cfa76 142:1f5518dd8146
48 try 48 try
49 { 49 {
50 Verbosity verboselevel (Verbosity::None); 50 Verbosity verboselevel (Verbosity::None);
51 bool listcommands (false); 51 bool listcommands (false);
52 bool sendhelp (false); 52 bool sendhelp (false);
53 bool test (true);
54 53
55 CommandLine cmdline; 54 CommandLine cmdline;
56 cmdline.addOption (listcommands, 'l', "listfunctions", "List available functions"); 55 cmdline.addOption (listcommands, 'l', "listfunctions", "List available functions");
57 cmdline.addOption (sendhelp, 'h', "help", "Print help text"); 56 cmdline.addOption (sendhelp, 'h', "help", "Print help text");
58 cmdline.addOption (test, 'x', "test", "testy test");
59 cmdline.addEnumeratedOption (verboselevel, 'V', "verbose", "Output more information"); 57 cmdline.addEnumeratedOption (verboselevel, 'V', "verbose", "Output more information");
60 StringList args = cmdline.process (argc, argv); 58 StringList args = cmdline.process (argc, argv);
61 59
62 if (sendhelp) 60 if (sendhelp)
63 { 61 {
66 #ifdef DEBUG 64 #ifdef DEBUG
67 header += " (debug build)"; 65 header += " (debug build)";
68 #endif 66 #endif
69 printTo (stderr, "%1\n", header); 67 printTo (stderr, "%1\n", header);
70 printTo (stderr, "usage: %1 [OPTIONS] SOURCE [OUTPUT]\n\n", argv[0]); 68 printTo (stderr, "usage: %1 [OPTIONS] SOURCE [OUTPUT]\n\n", argv[0]);
71 printTo (stderr, "Options:\n" + cmdline.describeOptions()); 69 printTo (stderr, "Options:\n" + cmdline.describeOptions() + "\n");
72 return EXIT_SUCCESS; 70 return EXIT_SUCCESS;
73 } 71 }
74 72
75 if (listcommands) 73 if (listcommands)
76 { 74 {

mercurial