+ wxCmdLineParser parser(cmdLineDesc, argc, argv);
+ switch ( parser.Parse() )
+ {
+ case -1:
+ // help was given, terminating
+ break;
+
+ case 0:
+ // everything is ok; proceed
+ if (parser.Found("d"))
+ {
+ wxPrintf("Dummy switch was given...\n");
+
+ while (1)
+ {
+ wxChar input[128];
+ wxPrintf("Try to guess the magic number (type 'quit' to escape): ");
+ if ( !wxFgets(input, WXSIZEOF(input), stdin) )
+ break;
+
+ // kill the last '\n'
+ input[wxStrlen(input) - 1] = 0;
+
+ if (wxStrcmp(input, "quit") == 0)
+ break;
+
+ long val;
+ if (!wxString(input).ToLong(&val))
+ {
+ wxPrintf("Invalid number...\n");
+ continue;
+ }