+
+void CTSimApp::OnInitCmdLine(wxCmdLineParser& parser)
+{
+ static const wxCmdLineEntryDesc cmdLineDesc[] = {
+ { wxCMD_LINE_SWITCH, wxT_2("l"), wxT_2("verbose"), wxT_2("verbose logging") },
+ { wxCMD_LINE_SWITCH, wxT_2("v"), wxT_2("version"), wxT_2("print version") },
+ { wxCMD_LINE_SWITCH, wxT_2("p"), wxT_2("print"), wxT_2("print images from command line"),
+ wxCMD_LINE_VAL_NONE,
+ wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_SWITCH, wxT_2("h"), wxT_2("help"), wxT_2("print this help message"),
+ wxCMD_LINE_VAL_NONE,
+ wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_OPTION_HELP },
+ { wxCMD_LINE_PARAM, NULL, NULL, wxT_2("input file"),
+ wxCMD_LINE_VAL_STRING,
+ wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
+ wxCMD_LINE_DESC_END
+ };
+
+ parser.SetDesc(cmdLineDesc);
+}
+
+bool CTSimApp::OnCmdLineParsed(wxCmdLineParser& parser)
+{
+ if (wxApp::OnCmdLineParsed(parser) == false)
+ return false;
+
+ if (parser.Found(_T("version"))) {
+#ifdef VERSION
+ std::cout << "Version: " << VERSION << std::endl;
+#elif defined(CTSIMVERSION)
+ std::cout << "Version: " << CTSIMVERSION << std::endl;
+#else
+ std::cout << "Version: " << "Unknown" << std::endl;
+#endif
+ return false;
+ }
+ if (parser.Found(_T("print"))) {
+ m_bPrintCmdLineImages = true;
+ }
+ if (parser.Found(_T("verbose"))) {
+ m_bCmdLineVerboseFlag = true;
+ }
+
+ return true;
+}
+