Example #1
0
bool CFileView::OnCmdLineParsed(wxCmdLineParser& parser)
{
	if (parser.Found(wxT("version"))) {
		cout << wxString::Format(wxT("MuleFileView version %u.%u.%u\nCopyright (c) 2008 aMule Team\n"), VERSION_MAJOR, VERSION_MINOR, VERSION_MICRO);
		return false;
	} else {
		wxString strDecode;
		if (parser.Found(wxT("strings"), &strDecode)) {
			if (strDecode == wxT("display")) {
				SetStringsMode(SD_DISPLAY);
			} else if (strDecode == wxT("safe")) {
				SetStringsMode(SD_SAFE);
			} else if (strDecode == wxT("utf8")) {
				SetStringsMode(SD_UTF8);
			} else if (strDecode == wxT("none")) {
				SetStringsMode(SD_NONE);
			} else {
				parser.SetLogo(wxT("Error: Invalid argument to --strings option: \"") + strDecode + wxT("\""));
				parser.Usage();
				return false;
			}
		} else {
			SetStringsMode(SD_DISPLAY);
		}
		for (size_t n = 0; n < parser.GetParamCount(); n++) {
			m_files.push_back(parser.GetParam(n));
		}
		if (m_files.size() == 0) {
			parser.Usage();
			return false;
		} else {
			return true;
		}
	}
}
Example #2
0
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);
	

}
Example #3
0
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);
}
Example #4
0
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), polimax@mail.ru\nCopyright (c) 2010-%d"), wxString(wxGIS_VERSION_NUM_DOT_STRING_T).c_str(), __YEAR__));
}
Example #5
0
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"-" );
}
Example #6
0
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);
	

}
Example #7
0
void Nin10EditApp::OnInitCmdLine(wxCmdLineParser& parser)
{
    parser.SetLogo(wxString::Format(_("Nin10Edit GUI")));
    parser.SetDesc(cmd_descriptions);
    parser.SetSwitchChars (_("-"));
}
Example #8
0
void wxvbamApp::OnInitCmdLine(wxCmdLineParser &cl)
{
	wxApp::OnInitCmdLine(cl);
	cl.SetLogo(wxT("VisualBoyAdvance-M\n"));
	// 2.9 decided to change all of these from wxChar to char for some
	// reason
#if wxCHECK_VERSION(2,9,0)
	// N_(x) returns x
#define t(x) x
#else
	// N_(x) returns wxT(x)
#define t(x) wxT(x)
#endif
	// while I would rather the long options be translated, there is merit
	// to the idea that command-line syntax should not change based on
	// locale
	static wxCmdLineEntryDesc opttab[] =
	{
		{
			wxCMD_LINE_OPTION, NULL,    t("save-xrc"),
			N_("Save built-in XRC file and exit")
		},
		{
			wxCMD_LINE_OPTION, NULL,    t("save-over"),
			N_("Save built-in vba-over.ini and exit")
		},
		{
			wxCMD_LINE_SWITCH, NULL,    t("print-cfg-path"),
			N_("Print configuration path and exit")
		},
		{
			wxCMD_LINE_SWITCH, t("f"),  t("fullscreen"),
			N_("Start in full-screen mode")
		},
#if !defined(NO_LINK) && !defined(__WXMSW__)
		{
			wxCMD_LINE_SWITCH, t("s"),  t("delete-shared-state"),
			N_("Delete shared link state first, if it exists")
		},
#endif
		// stupid wx cmd line parser doesn't support duplicate options
//	{ wxCMD_LINE_OPTION, t("o"),  t("option"),
//		_("Set configuration option; <opt>=<value> or help for list"),
		{
			wxCMD_LINE_SWITCH, t("o"),  t("list-options"),
			N_("List all settable options and exit")
		},
		{
			wxCMD_LINE_PARAM,  NULL,    NULL,
			N_("ROM file"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
		},
		{
			wxCMD_LINE_PARAM,  NULL,    NULL,
			N_("<config>=<value>"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_PARAM_OPTIONAL
		},
		{ wxCMD_LINE_NONE }
	};
	// 2.9 automatically translates desc, but 2.8 doesn't
#if !wxCHECK_VERSION(2,9,0)

	for (int i = 0; opttab[i].kind != wxCMD_LINE_NONE; i++)
		opttab[i].description = wxGetTranslation(opttab[i].description);

#endif
	// note that "SetDesc" actually Adds rather than replaces
	// so system standard (port-dependent) options are still included:
	//   -h/--help  --verbose --theme --mode
	cl.SetDesc(opttab);
}
Example #9
0
/** @brief OnInitCmdLine
  *
  * @todo: document this function
  */
void ComplxApp::OnInitCmdLine(wxCmdLineParser& parser)
{
    parser.SetLogo(wxString::Format(_("Complx Version %ld.%ld"), AutoVersion::MAJOR, AutoVersion::MINOR));
    parser.SetDesc(cmd_descriptions);
    parser.SetSwitchChars (_("-"));
}