本文整理汇总了C++中wxCmdLineParser::AddOption方法的典型用法代码示例。如果您正苦于以下问题:C++ wxCmdLineParser::AddOption方法的具体用法?C++ wxCmdLineParser::AddOption怎么用?C++ wxCmdLineParser::AddOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxCmdLineParser
的用法示例。
在下文中一共展示了wxCmdLineParser::AddOption方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: 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);
};
示例3: 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);
}
示例4: OnInitCmdLine
void CGMSKRepeaterApp::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.AddOption(AUDIODIR_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);
}
示例5: 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);
}
示例6: 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);
}
示例7: OnInitCmdLine
void CDStarRepeaterConfigApp::OnInitCmdLine(wxCmdLineParser& parser)
{
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);
}
示例8: 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);
}
示例9: OnInitCmdLine
void CamulecmdApp::OnInitCmdLine(wxCmdLineParser& parser)
{
CaMuleExternalConnector::OnInitCmdLine(parser, "amulecmd");
parser.AddOption(wxT("c"), wxT("command"),
_("Execute <str> and exit."),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
}
示例10: fixlist
void Pcsx2App::OnInitCmdLine( wxCmdLineParser& parser )
{
parser.SetLogo( AddAppName(" >> %s -- A PlayStation 2 Emulator for the PC <<") + L"\n\n" +
_("All options are for the current session only and will not be saved.\n")
);
wxString fixlist( L" " );
for (GamefixId i=GamefixId_FIRST; i < pxEnumEnd; ++i)
{
if( i != GamefixId_FIRST ) fixlist += L",";
fixlist += EnumToString(i);
}
parser.AddParam( _("IsoFile"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL );
parser.AddSwitch( L"h", L"help", _("displays this list of command line options"), wxCMD_LINE_OPTION_HELP );
parser.AddSwitch( wxEmptyString,L"console", _("forces the program log/console to be visible"), wxCMD_LINE_VAL_STRING );
parser.AddSwitch( wxEmptyString,L"fullscreen", _("use fullscreen GS mode") );
parser.AddSwitch( wxEmptyString,L"windowed", _("use windowed GS mode") );
parser.AddSwitch( wxEmptyString,L"nogui", _("disables display of the gui while running games") );
parser.AddSwitch( wxEmptyString,L"noguiprompt", _("when nogui - prompt before exiting on suspend") );
parser.AddOption( wxEmptyString,L"elf", _("executes an ELF image"), wxCMD_LINE_VAL_STRING );
parser.AddOption( wxEmptyString,L"irx", _("executes an IRX image"), wxCMD_LINE_VAL_STRING );
parser.AddSwitch( wxEmptyString,L"nodisc", _("boots an empty DVD tray; use to enter the PS2 system menu") );
parser.AddSwitch( wxEmptyString,L"usecd", _("boots from the CDVD plugin (overrides IsoFile parameter)") );
parser.AddSwitch( wxEmptyString,L"nohacks", _("disables all speedhacks") );
parser.AddOption( wxEmptyString,L"gamefixes", _("use the specified comma or pipe-delimited list of gamefixes.") + fixlist, wxCMD_LINE_VAL_STRING );
parser.AddSwitch( wxEmptyString,L"fullboot", _("disables fast booting") );
parser.AddOption( wxEmptyString,L"cfgpath", _("changes the configuration file path"), wxCMD_LINE_VAL_STRING );
parser.AddOption( wxEmptyString,L"cfg", _("specifies the PCSX2 configuration file to use"), wxCMD_LINE_VAL_STRING );
parser.AddSwitch( wxEmptyString,L"forcewiz", AddAppName(_("forces %s to start the First-time Wizard")) );
parser.AddSwitch( wxEmptyString,L"portable", _("enables portable mode operation (requires admin/root access)") );
parser.AddSwitch( wxEmptyString,L"profiling", _("update options to ease profiling (debug)") );
const PluginInfo* pi = tbl_PluginInfo; do {
parser.AddOption( wxEmptyString, pi->GetShortname().Lower(),
pxsFmt( _("specify the file to use as the %s plugin"), WX_STR(pi->GetShortname()) )
);
} while( ++pi, pi->shortname != NULL );
parser.SetSwitchChars( L"-" );
}
示例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 DrawApp::OnInitCmdLine(wxCmdLineParser &parser) {
wxGLApp::OnInitCmdLine(parser);
parser.SetLogo(_("Szarp Draw version 3.00."));
parser.AddOption(_T("geometry"), wxEmptyString,
_("X windows geometry specification"), wxCMD_LINE_VAL_STRING);
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("f"), wxEmptyString,
_("open window in full screen mode"));
parser.AddSwitch(_T("v"), _T("verbose"), _("verbose logging"));
parser.AddSwitch(_T("4"), _T("sz4"), _("use sz4 base format"));
parser.AddSwitch(_T("i"), _T("iks"), _("use iks server"));
parser.AddSwitch(_T("V"), _T("version"),
_("print version number and exit"));
parser.AddOption(wxEmptyString, _T("iks-server"),
_("IKS server address"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddOption(wxEmptyString, _T("iks-server-port"),
_("IKS server port"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
#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);
}
示例13: 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);
}
示例14: OnInitCmdLine
void pulseTest::OnInitCmdLine(wxCmdLineParser& parser)
{
// Init standard options (--help, --verbose);
wxApp::OnInitCmdLine(parser);
// tags will be appended to the last switch/option
wxString tags;
allTraceTags.Sort();
size_t i;
for (i = 0; i < allTraceTags.GetCount(); i++) {
if (!tags.IsEmpty())
tags += wxT(" ");
tags += allTraceTags.Item(i);
}
tags.Prepend(_("\n\nSupported trace tags: "));
parser.AddOption(wxEmptyString, wxT("trace"),
_("Specify wxWidgets trace mask.") + tags);
}
示例15: OnInitCmdLine
void CaMuleExternalConnector::OnInitCmdLine(wxCmdLineParser& parser, const char* appname)
{
m_appname = appname;
parser.AddSwitch(wxEmptyString, wxT("help"),
_("Show this help text."),
wxCMD_LINE_PARAM_OPTIONAL);
parser.AddOption(wxT("h"), wxT("host"),
_("Host where aMule is running. (default: localhost)"),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddOption(wxT("p"), wxT("port"),
_("aMule's port for External Connection. (default: 4712)"),
wxCMD_LINE_VAL_NUMBER, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddOption(wxT("P"), wxT("password"),
_("External Connection password."),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddOption(wxT("f"), wxT("config-file"),
_("Read configuration from file."),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddSwitch(wxT("q"), wxT("quiet"),
_("Do not print any output to stdout."),
wxCMD_LINE_PARAM_OPTIONAL);
parser.AddSwitch(wxT("v"), wxT("verbose"),
_("Be verbose - show also debug messages."),
wxCMD_LINE_PARAM_OPTIONAL);
parser.AddOption(wxT("l"), wxT("locale"),
_("Sets program locale (language)."),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddSwitch(wxT("w"), wxT("write-config"),
_("Write command line options to config file."),
wxCMD_LINE_PARAM_OPTIONAL);
parser.AddOption(wxEmptyString, wxT("create-config-from"),
_("Creates config file based on aMule's config file."),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddSwitch(wxEmptyString, wxT("version"),
_("Print program version."),
wxCMD_LINE_PARAM_OPTIONAL);
}