本文整理汇总了C++中wxCmdLineParser::AddSwitch方法的典型用法代码示例。如果您正苦于以下问题:C++ wxCmdLineParser::AddSwitch方法的具体用法?C++ wxCmdLineParser::AddSwitch怎么用?C++ wxCmdLineParser::AddSwitch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxCmdLineParser
的用法示例。
在下文中一共展示了wxCmdLineParser::AddSwitch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInitCmdLine
void CFileView::OnInitCmdLine(wxCmdLineParser& parser)
{
parser.AddSwitch(wxT("h"), wxT("help"), wxT("Show help"), wxCMD_LINE_OPTION_HELP);
parser.AddSwitch(wxT("v"), wxT("version"), wxT("Show program version"), wxCMD_LINE_PARAM_OPTIONAL);
parser.AddOption(wxT("s"), wxT("strings"), wxT("String decoding mode: display (default), safe, utf8, none"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddParam(wxT("input file"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE);
}
示例2: OnInitCmdLine
/// Parse command line
void alcc::OnInitCmdLine(wxCmdLineParser& cmdline)
{
cmdline.AddSwitch(wxT("h"), wxT("help"), wxT("show this help message"), wxCMD_LINE_OPTION_HELP);
cmdline.AddSwitch(wxT("v"), wxT("verbose"), wxT("be verbose"));
cmdline.AddSwitch(wxT("p"), wxT("parthashes"), wxT("add part-hashes to ed2k link"));
cmdline.AddParam(wxT("input files"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE);
}
示例3: OnInitCmdLine
void TestApp::OnInitCmdLine(wxCmdLineParser &parser) {
parser.SetLogo(_("Test app version 1.00."));
parser.AddSwitch(_T("a") , _T("activity"));
parser.AddOption(_T("base"), wxEmptyString,
_("base name"), wxCMD_LINE_VAL_STRING);
parser.AddParam(_T("url"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddSwitch(_T("e"), wxEmptyString,
_("open url in existing window"));
parser.AddSwitch(_T("v"), _T("verbose"), _("verbose logging"));
parser.AddSwitch(_T("V"), _T("version"),
_("print version number and exit"));
#if 0
parser.AddSwitch(_T("D<name>=<str>"), wxEmptyString,
_("libparnt value initialization"));
#endif
parser.AddOption(_T("d"), _T("debug"), _("debug level"), wxCMD_LINE_VAL_NUMBER);
}
示例4: OnInitCmdLine
void MyApp::OnInitCmdLine(wxCmdLineParser& parser)
{
parser.AddSwitch("", "sb", "Do not use double buffering");
parser.AddSwitch("", "db", "Use double buffering");
parser.AddSwitch("", "va", "Use vertex arrays");
wxApp::OnInitCmdLine(parser);
}
示例5: OnInitCmdLine
void MacUninstallApp::OnInitCmdLine(wxCmdLineParser& parser)
{
// Init standard options (--help, --verbose);
wxApp::OnInitCmdLine(parser);
parser.AddSwitch(wxEmptyString, wxT("test"),
_("Test mode. Just create log file reporting what would happen."));
parser.AddSwitch(wxEmptyString, wxT("batch"),
_("Uninstall without asking the user (needs admin rights)."));
}
示例6: OnInitCmdLine
void wxGISServerApp::OnInitCmdLine(wxCmdLineParser& pParser)
{
wxAppConsole::OnInitCmdLine(pParser);
pParser.AddSwitch(wxT( "v" ), wxT( "version" ), _( "The version of this program" ));
pParser.AddSwitch(wxT( "i" ), wxT( "install" ), _( "Install wxGIS Server as service" ));
pParser.AddSwitch(wxT( "r" ), wxT( "run" ), _( "Run the wxGIS Server in standalone mode. Press 'q' to quit." ));
pParser.AddSwitch(wxT( "u" ), wxT( "uninstall" ), _( "Uninstall wxGIS Server service" ));
pParser.AddSwitch(wxT( "s" ), wxT( "start" ), _( "Start wxGIS Server service" ));
pParser.SetLogo(wxString::Format(_("The wxGIS Server (%s)\nAuthor: Bishop (aka Barishnikov Dmitriy), [email protected]\nCopyright (c) 2010-%d"), wxString(wxGIS_VERSION_NUM_DOT_STRING_T).c_str(), __YEAR__));
}
示例7: OnInitCmdLine
void MyApp::OnInitCmdLine(wxCmdLineParser& parser)
{
wxApp::OnInitCmdLine(parser);
parser.AddSwitch("", CmdLineOption::MDI,
"run in MDI mode: multiple documents, single window");
parser.AddSwitch("", CmdLineOption::SDI,
"run in SDI mode: multiple documents, multiple windows");
parser.AddSwitch("", CmdLineOption::SINGLE,
"run in single document mode");
}
示例8: worker
void
Client::OnInitCmdLine(wxCmdLineParser& pParser)
{
wxApp::OnInitCmdLine(pParser);
pParser.AddSwitch(wxT("e"),wxT("event"),_("Use event based worker (default)"),wxCMD_LINE_PARAM_OPTIONAL);
pParser.AddSwitch(wxT("t"),wxT("thread"),_("Use thread based worker"),wxCMD_LINE_PARAM_OPTIONAL);
pParser.AddSwitch(wxT("r"),wxT("random"),_("Send radnom data (default)"),wxCMD_LINE_PARAM_OPTIONAL);
pParser.AddOption(wxT("m"),wxT("message"),_("Send message from <str>"),wxCMD_LINE_VAL_STRING,wxCMD_LINE_PARAM_OPTIONAL);
pParser.AddOption(wxT("f"),wxT("file"),_("Send contents of <file>"),wxCMD_LINE_VAL_STRING,wxCMD_LINE_PARAM_OPTIONAL);
pParser.AddOption(wxT("H"),wxT("hostname"),_("IP or name of host to connect to"),wxCMD_LINE_VAL_STRING,wxCMD_LINE_PARAM_OPTIONAL);
pParser.AddOption(wxT("s"),wxT("stress"),_("stress test with <num> concurrent connections"),wxCMD_LINE_VAL_NUMBER,wxCMD_LINE_PARAM_OPTIONAL);
}
示例9: OnInitCmdLine
void BenchApp::OnInitCmdLine(wxCmdLineParser& parser)
{
BenchAppBase::OnInitCmdLine(parser);
parser.AddSwitch(OPTION_LIST,
"list",
"list all the existing benchmarks");
parser.AddSwitch(OPTION_SINGLE,
"single",
"run the benchmark once only");
parser.AddOption(OPTION_AVG_COUNT,
"avg-count",
wxString::Format
(
"number of times to run benchmarking loop (default: %ld)",
m_avgCount
),
wxCMD_LINE_VAL_NUMBER);
parser.AddOption(OPTION_NUM_RUNS,
"num-runs",
wxString::Format
(
"number of times to run each benchmark in a loop "
"(default: %ld)",
m_numRuns
),
wxCMD_LINE_VAL_NUMBER);
parser.AddOption(OPTION_NUMERIC_PARAM,
"num-param",
wxString::Format
(
"numeric parameter used by some benchmark functions "
"(default: %ld)",
m_numParam
),
wxCMD_LINE_VAL_NUMBER);
parser.AddOption(OPTION_STRING_PARAM,
"str-param",
"string parameter used by some benchmark functions "
"(default: empty)",
wxCMD_LINE_VAL_STRING);
parser.AddParam("benchmark name",
wxCMD_LINE_VAL_STRING,
wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE);
}
示例10: OnInitCmdLine
void iCPApp::OnInitCmdLine(wxCmdLineParser &parser)
{
parser.AddSwitch(wxT("h"),wxT("help"),wxT("shows this help message"));
parser.AddOption(wxT("s"),wxT("setting"),wxT("used setting"),wxCMD_LINE_VAL_NUMBER);
parser.AddOption(wxT("m"),wxT("matches"),wxT("number of matches"),wxCMD_LINE_VAL_NUMBER);
parser.AddOption(wxT("o"),wxT("output"),wxT("output project"),wxCMD_LINE_VAL_STRING,wxCMD_LINE_OPTION_MANDATORY);
parser.AddParam(wxT("input.pto"),wxCMD_LINE_VAL_STRING,wxCMD_LINE_OPTION_MANDATORY);
};
示例11: OnInitCmdLine
void CTimerControlApp::OnInitCmdLine(wxCmdLineParser& parser)
{
parser.AddSwitch(NOLOGGING_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddOption(LOGDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddParam(NAME_PARAM, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
wxApp::OnInitCmdLine(parser);
}
示例12: OnInitCmdLine
void PoeditApp::OnInitCmdLine(wxCmdLineParser& parser)
{
wxApp::OnInitCmdLine(parser);
parser.AddSwitch("", CL_KEEP_TEMP_FILES,
_("don't delete temporary files (for debugging)"));
parser.AddParam("catalog.po", wxCMD_LINE_VAL_STRING,
wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE);
}
示例13: OnInitCmdLine
void CSplitRepeaterApp::OnInitCmdLine(wxCmdLineParser& parser)
{
parser.AddSwitch(NOLOGGING_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddSwitch(GUI_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddOption(LOGDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddOption(CONFDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddParam(NAME_PARAM, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
wxApp::OnInitCmdLine(parser);
}
示例14: OnInitCmdLine
virtual void OnInitCmdLine(wxCmdLineParser& parser)
{
parser.AddSwitch(_T("h"), _T("help"),
_T("Display help for the command line parameters."),
wxCMD_LINE_OPTION_HELP);
parser.AddOption(_T("L"), _T("lang"),
_T("Set language for messages. Example: de or de_DE."),
wxCMD_LINE_VAL_STRING, 0);
}
示例15: OnInitCmdLine
void EkstrApp::OnInitCmdLine(wxCmdLineParser &parser) {
szApp<>::OnInitCmdLine(parser);
parser.SetLogo(_("Szarp Extractor version 3.00"));
parser.AddOption(_T("geometry"), wxEmptyString,
_("X windows geometry specification"),
wxCMD_LINE_VAL_STRING);
parser.AddOption(_T("base"), wxEmptyString, _("base name"),
wxCMD_LINE_VAL_STRING);
parser.AddSwitch(_T("4"), _T("sz4") , _("use sz4 database engine"));
}