示例#1
1
bool FlashApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
    if ( parser.GetParamCount() )
        m_swf = parser.GetParam(0);

    return wxApp::OnCmdLineParsed(parser);
}
示例#2
0
文件: test.cpp 项目: gdos/wxWidgets
// Handle command line options
//
bool TestApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
    if (parser.GetParamCount())
    {
        for (size_t i = 0; i < parser.GetParamCount(); i++)
            m_registries.push_back(parser.GetParam(i));
    }

    m_longlist = parser.Found("longlist");
    m_list = m_longlist || parser.Found("list");
    m_timing = parser.Found("timing");
    m_detail = !m_timing && parser.Found("detail");

    wxString loc;
    if ( parser.Found("locale", &loc) )
    {
        const wxLanguageInfo * const info = wxLocale::FindLanguageInfo(loc);
        if ( !info )
        {
            cerr << "Locale \"" << string(loc.mb_str()) << "\" is unknown.\n";
            return false;
        }

        m_locale = new wxLocale(info->Language);
        if ( !m_locale->IsOk() )
        {
            cerr << "Using locale \"" << string(loc.mb_str()) << "\" failed.\n";
            return false;
        }
    }

    return TestAppBase::OnCmdLineParsed(parser);
}
示例#3
0
void Rpcs3App::OnArguments(const wxCmdLineParser& parser)
{
	// Usage:
	//   rpcs3-*.exe               Initializes RPCS3
	//   rpcs3-*.exe [(S)ELF]      Initializes RPCS3, then loads and runs the specified (S)ELF file.

	if (parser.FoundSwitch("t"))
	{
		if (parser.GetParamCount() != 1)
		{
			wxLogDebug("A (S)ELF file needs to be given in test mode, exiting.");
			this->Exit();
		}

		// TODO: clean implementation
		g_cfg_autostart = true;
		g_cfg_autoexit = true;
	}
	
	if (parser.GetParamCount() > 0)
	{
		Emu.SetPath(fmt::ToUTF8(parser.GetParam(0)));
		Emu.Load();
		Emu.Run();
	}
}
示例#4
0
bool CModelViewerApp::OnCmdLineParsed( wxCmdLineParser& parser )
{
	//Last parameter is the model to load.
	if( parser.GetParamCount() > 0 )
		m_szModel = parser.GetParam( parser.GetParamCount() - 1 );

	return wxApp::OnCmdLineParsed( parser );
}
bool MainApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
    mStartHidden = false;

    mBatchMode = parser.Found(wxT("b"));

    mEnableAppProfiles = parser.Found(wxT("a"));

    if (mBatchMode || mEnableAppProfiles)
    {
	mStartHidden = true;
    }

    if (!parser.Found(wxT("c"), &mColorTemp))
    {
	mColorTemp = 0;	
    }
    else
    {
	mStartHidden = true;
    }

    if (!parser.Found(wxT("i"), &mGPUIndex))
    {
	mGPUIndex = 0;
    }

    if (parser.GetParamCount() > 0)
    {
        mProfileName = parser.GetParam(0);
	mStartHidden = true;
    }

    return true;
}
示例#6
0
bool MainApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
 
    for (unsigned int i = 0; i < parser.GetParamCount(); ++i)
    {

        wxFileName fileName = parser.GetParam(i);

        // File names sometimes come in in the short form from Windows, so convert
        // to the long form.

        if (fileName.GetExt().Lower() == "deproj")
        {
            // This is a project file, so save the name separately.
            wxFileName fileName = parser.GetParam(i);
            m_loadProjectName = fileName.GetLongPath();
        }
        else
        {
            wxFileName fileName = parser.GetParam(i);
            m_loadFileNames.Add(fileName.GetLongPath());
        }

    }
    
#ifndef DEDICATED_PRODUCT_VERSION
    parser.Found("debugexe", &m_debugExe);
#endif
 
    return true;

}
bool CGMSKRepeaterApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
	if (!wxApp::OnCmdLineParsed(parser))
		return false;

	m_nolog = parser.Found(NOLOGGING_SWITCH);
	m_gui   = parser.Found(GUI_SWITCH);

	wxString logDir;
	bool found = parser.Found(LOGDIR_OPTION, &logDir);
	if (found)
		m_logDir = logDir;

	wxString confDir;
	found = parser.Found(CONFDIR_OPTION, &confDir);
	if (found)
		m_confDir = confDir;

	wxString audioDir;
	found = parser.Found(AUDIODIR_OPTION, &audioDir);
	if (found)
		m_audioDir = audioDir;
	else
		m_audioDir = ::wxGetHomeDir();

	if (parser.GetParamCount() > 0U)
		m_name = parser.GetParam(0U);

	return true;
}
示例#8
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;
		}
	}
}
示例#9
0
bool Pcsx2App::OnCmdLineParsed( wxCmdLineParser& parser )
{
	if( parser.Found(L"console") )
	{
		Startup.ForceConsole = true;
		OpenProgramLog();
	}

	// Suppress wxWidgets automatic options parsing since none of them pertain to PCSX2 needs.
	//wxApp::OnCmdLineParsed( parser );

	m_UseGUI	= !parser.Found(L"nogui");

	if( !ParseOverrides(parser) ) return false;

	// --- Parse Startup/Autoboot options ---

	Startup.NoFastBoot		= parser.Found(L"fullboot");
	Startup.ForceWizard		= parser.Found(L"forcewiz");
	Startup.PortableMode	= parser.Found(L"portable");

	if( parser.GetParamCount() >= 1 )
	{
		Startup.IsoFile		= parser.GetParam( 0 );
		Startup.SysAutoRun	= true;
	}
	
	if( parser.Found(L"usecd") )
	{
		Startup.CdvdSource	= CDVDsrc_Plugin;
		Startup.SysAutoRun	= true;
	}

	return true;
}
示例#10
0
static void ShowCmdLine( const wxCmdLineParser& parser )
{
	wxString s = wxT("Input files: ");

	size_t count = parser.GetParamCount();
	for ( size_t param = 0; param < count; param++ )
	{
		s << parser.GetParam( param ) << ' ';
	}

	s << '\n'
		<< wxT("Verbose:\t") << ( parser.Found(wxT("v")) ? wxT("yes") : wxT("no") ) << '\n'
		<< wxT("Quiet:\t") << ( parser.Found(wxT("q")) ? wxT("yes") : wxT("no") ) << '\n';

	wxString strVal;
	long lVal;
	wxDateTime dt;
	if ( parser.Found( wxT("o"), &strVal ) )
		s << wxT("Output file:\t") << strVal << '\n';
	if ( parser.Found( wxT("i"), &strVal ) )
		s << wxT("Input dir:\t") << strVal << '\n';
	if ( parser.Found( wxT("s"), &lVal ) )
		s << wxT("Size:\t") << lVal << '\n';
	if ( parser.Found( wxT("d"), &dt ) )
		s << wxT("Date:\t") << dt.FormatISODate() << '\n';
	if ( parser.Found( wxT("project_name"), &strVal ) )
		s << wxT("Project:\t") << strVal << '\n';

	wxLogMessage( s );
}
示例#11
0
bool App::OnCmdLineParsed(wxCmdLineParser& parser)
{
   for (size_t i = 0; i < parser.GetParamCount(); i++)
   {
      m_cmdLine.m_fileNames.Add(wxFileName(parser.GetParam(i)));
   }
   return wxApp::OnCmdLineParsed(parser);
}
示例#12
0
void RaceAnalyzerApp::OnInitCmdLine(wxCmdLineParser& parser){
   parser.AddParam("",wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
   parser.Parse(false);
   if (parser.GetParamCount() > 0){
   		wxString mjljConfigFile = parser.GetParam(0);
   		_mainFrame->OpenRaceEvent(mjljConfigFile);
   }
}
示例#13
0
bool DecisionLogicApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
	if (parser.GetParamCount() > 0)
	{
		fileToOpen = parser.GetParam(0);
	}
	return true;
}
示例#14
0
bool ErrorApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
    errorMsg = wxT("{NO ERROR MESSAGE RECEIVED}");

    if (parser.GetParamCount() > 0)
        errorMsg = parser.GetParam(0);

    return true;
}
示例#15
0
文件: drawapp.cpp 项目: Strongc/szarp
bool DrawApp::OnCmdLineParsed(wxCmdLineParser &parser) {

	wxString geometry;

        /* Reads program geometry (X style) */

	x = y = width = height = -1;

        /* Read 'geometry' option. */
	if (parser.Found(_T("geometry"), &geometry)) 
		get_geometry(geometry, &x, &y, &width, &height);

	if (parser.Found(_T("v")))
    		wxLog::SetVerbose();

	m_full_screen = parser.Found(_T("f"));
	
	m_just_print_version = parser.Found(_("V"));

	parser.Found(_T("base"), &m_base);

	parser.Found(_T("url"), &m_url);

	m_show_logparams = parser.Found(_T("activity"));

	m_url_open_in_existing = parser.Found(_T("e"));

	if (m_base.IsEmpty())
		for (size_t i = 0; i < parser.GetParamCount(); ++i) {
			wxString arg = parser.GetParam(i);
			if (arg.StartsWith(_T("draw://"))) {
				m_url = arg;	
				break;
			}
		}

	long debug;
	if (parser.Found(_T("debug"), &debug))
		sz_loginit((int) debug, "draw3", SZ_LIBLOG_FACILITY_APP);
	else
		sz_loginit(2, "draw3", SZ_LIBLOG_FACILITY_APP);

	if (parser.Found(_T("4")))
		m_base_type = SZ4_BASE;

	if (parser.Found(_T("i"))) {
		m_base_type = IKS_BASE;

		if (!parser.Found(_T("iks-server"), &m_iks_server))
			m_iks_server = m_base;

		parser.Found(_T("iks-server-port"), &m_iks_port);
	}

	return true;
}
示例#16
0
    virtual bool OnCmdLineParsed(wxCmdLineParser& parser)
    {
        if ( !wxApp::OnCmdLineParsed(parser) )
            return false;

        if ( parser.GetParamCount() )
            m_url = parser.GetParam(0);

        return true;
    }
示例#17
0
bool CRemoteControlApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
	if (!wxApp::OnCmdLineParsed(parser))
		return false;

	if (parser.GetParamCount() > 0U)
		m_name = parser.GetParam(0U);

	return true;
}
示例#18
0
// Handle command line options
//
bool TestApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
    if (parser.GetParamCount())
    {
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
#   pragma ivdep
#   pragma swp
#   pragma unroll
#   pragma prefetch
#   if 0
#       pragma simd noassert
#   endif
#endif /* VDM auto patch */
        for (size_t i = 0; i < parser.GetParamCount(); i++)
            m_registries.push_back(parser.GetParam(i));
    }

    m_longlist = parser.Found("longlist");
    m_list = m_longlist || parser.Found("list");
    m_timing = parser.Found("timing");
    m_detail = !m_timing && parser.Found("detail");

    wxString loc;
    if ( parser.Found("locale", &loc) )
    {
        const wxLanguageInfo * const info = wxLocale::FindLanguageInfo(loc);
        if ( !info )
        {
            cerr << "Locale \"" << string(loc.mb_str()) << "\" is unknown.\n";
            return false;
        }

        m_locale = new wxLocale(info->Language);
        if ( !m_locale->IsOk() )
        {
            cerr << "Using locale \"" << string(loc.mb_str()) << "\" failed.\n";
            return false;
        }
    }

    return TestAppBase::OnCmdLineParsed(parser);
}
示例#19
0
bool mazeDlgApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
    if(parser.GetParamCount()<2) {
     cout << "Call Format: ./maze <maze file> <brain file>" << endl;
     exit(0);
    }

    // to get at your unnamed parameters use
    for (int i = 0; i < parser.GetParamCount(); i++)
    {
            files.Add(parser.GetParam(i));
	    cout << files[i].mb_str() << endl;
    }
 
    // and other command line parameters
 
    // then do what you need with them.
 
    return true;
}
示例#20
0
bool wxUnivDiffApp::OnCmdLineParsed	(	wxCmdLineParser & 	parser	)
{
  options_t& options = getOptions(); 
  options.verbose = parser.FoundSwitch("v")==wxCMD_SWITCH_ON;

  options.list = parser.FoundSwitch("l")==wxCMD_SWITCH_ON;
  options.add  = parser.FoundSwitch("a")==wxCMD_SWITCH_ON;
  options.del  = parser.FoundSwitch("del")==wxCMD_SWITCH_ON;
  options.interactive = parser.FoundSwitch("i")==wxCMD_SWITCH_ON || parser.GetParamCount()<2;
  options.diff = !(options.list||options.add||options.del||options.interactive);

  //Parse commandline parameters which are not switches
  wxString param;
  for (size_t i=0; i <parser.GetParamCount(); ++i) {
    param = parser.GetParam(i);
    if (!isCmdLineSwitch(param)) {
      parameters.push_back(param);
    }
  }
  return true;
}
示例#21
0
bool HTMLButcherApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
    //silent_mode = parser.Found(wxT("s"));
	if (!parser.Found(wxT("l"), &licfile_))
		licfile_.clear();

    // open file name
    if (parser.GetParamCount()>0)
        openfile_=parser.GetParam(0);

    return true;
}
示例#22
0
void XmlResApp::ParseParams(const wxCmdLineParser& cmdline)
{
    flagGettext = cmdline.Found("g");
    flagVerbose = cmdline.Found("v");
    flagCPP = cmdline.Found("c");
    flagPython = cmdline.Found("p");
    flagH = flagCPP && cmdline.Found("e");
    flagValidateOnly = cmdline.Found("validate-only");
    flagValidate = flagValidateOnly || cmdline.Found("validate");

    cmdline.Found("xrc-schema", &parSchemaFile);

    if (!cmdline.Found("o", &parOutput))
    {
        if (flagGettext)
            parOutput = wxEmptyString;
        else
        {
            if (flagCPP)
                parOutput = wxT("resource.cpp");
            else if (flagPython)
                parOutput = wxT("resource.py");
            else
                parOutput = wxT("resource.xrs");
        }
    }
    if (!parOutput.empty())
    {
        wxFileName fn(parOutput);
        fn.Normalize();
        parOutput = fn.GetFullPath();
        parOutputPath = wxPathOnly(parOutput);
    }
    if (!parOutputPath) parOutputPath = wxT(".");

    if (!cmdline.Found("n", &parFuncname))
        parFuncname = wxT("InitXmlResource");

    for (size_t i = 0; i < cmdline.GetParamCount(); i++)
    {
#ifdef __WINDOWS__
        wxString fn=wxFindFirstFile(cmdline.GetParam(i), wxFILE);
        while (!fn.empty())
        {
            parFiles.Add(fn);
            fn=wxFindNextFile();
        }
#else
        parFiles.Add(cmdline.GetParam(i));
#endif
    }
}
示例#23
0
文件: edapp.cpp 项目: mfloryan/poedit
bool PoeditApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
    if (!wxApp::OnCmdLineParsed(parser))
        return false;

    if ( parser.Found(CL_KEEP_TEMP_FILES) )
        TempDirectory::KeepFiles();

    for (size_t i = 0; i < parser.GetParamCount(); i++)
        gs_filesToOpen.Add(parser.GetParam(i));

    return true;
}
示例#24
0
bool wxOsgApp::OnCmdLineParsed( wxCmdLineParser& parser )
{
    // known args
    flat_mode_ = parser.Found( wxT("F") );
    
    // all others
    for ( unsigned int unnamedidx = 0; unnamedidx < parser.GetParamCount(); unnamedidx++ )
    {
        std::string file( parser.GetParam( unnamedidx ).mb_str() );
        files_.push_back( file );
    }
    return true;
}
bool CDStarRepeaterConfigApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
	if (!wxApp::OnCmdLineParsed(parser))
		return false;

	wxString confDir;
	bool found = parser.Found(CONFDIR_OPTION, &confDir);
	if (found)
		m_confDir = confDir;

	if (parser.GetParamCount() > 0U)
		m_name = parser.GetParam(0U);

	return true;
}
示例#26
0
	bool OnCmdLineParsed(wxCmdLineParser& parser) override
	{
		bug_fun();
		wxArrayString files;
		for(uns i = 0; i < parser.GetParamCount(); i++)
		{
			create_audio_frame();
			frames.back()->load_audio_file(parser.GetParam(i).ToStdString());
		}

		if(frames.empty())
			create_audio_frame();

		return true;
	}
示例#27
0
文件: rpcs3.cpp 项目: Majkel86/rpcs3
void Rpcs3App::OnArguments(const wxCmdLineParser& parser)
{
	// Usage:
	//   rpcs3-*.exe               Initializes RPCS3
	//   rpcs3-*.exe [(S)ELF]      Initializes RPCS3, then loads and runs the specified (S)ELF file.

	if (parser.FoundSwitch("t"))
	{
		HLEExitOnStop = rpcs3::config.misc.exit_on_stop.value();
		rpcs3::config.misc.exit_on_stop = true;
		if (parser.GetParamCount() != 1)
		{
			wxLogDebug(wxT("A (S)ELF file needs to be given in test mode, exiting."));
			this->Exit();
		}
	}
	
	if (parser.GetParamCount() > 0)
	{
		Emu.SetPath(fmt::ToUTF8(parser.GetParam(0)));
		Emu.Load();
		Emu.Run();
	}
}
bool MyApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
    //silent_mode = parser.Found(wxT("s"));    
    // to get at your unnamed parameters use
    wxArrayString files;
        for (int i = 0; i < parser.GetParamCount(); i++)
    {
            files.Add(parser.GetParam(i));
    }
 
    // and other command line parameters   
 
    // then do what you need with them.
 
    return true;
}
示例#29
0
bool Pcsx2App::OnCmdLineParsed( wxCmdLineParser& parser )
{
	if( parser.Found(L"console") )
	{
		Startup.ForceConsole = true;
		OpenProgramLog();
	}

	// Suppress wxWidgets automatic options parsing since none of them pertain to PCSX2 needs.
	//wxApp::OnCmdLineParsed( parser );

	m_UseGUI	= !parser.Found(L"nogui");
	m_NoGuiExitPrompt = parser.Found(L"noguiprompt"); // by default no prompt for exit with nogui.

	if( !ParseOverrides(parser) ) return false;

	// --- Parse Startup/Autoboot options ---

	Startup.NoFastBoot		= parser.Found(L"fullboot");
	Startup.ForceWizard		= parser.Found(L"forcewiz");
	Startup.PortableMode	= parser.Found(L"portable");

	if( parser.GetParamCount() >= 1 )
	{
		Startup.IsoFile		= parser.GetParam( 0 );
		Startup.SysAutoRun	= true;
	}
	else
	{
		wxString elf_file;
		if (parser.Found(L"elf", &elf_file) && !elf_file.IsEmpty()) {
			Startup.SysAutoRunElf = true;
			Startup.ElfFile = elf_file;
		} else if (parser.Found(L"irx", &elf_file) && !elf_file.IsEmpty()) {
			Startup.SysAutoRunIrx = true;
			Startup.ElfFile = elf_file;
		}
	}

	if( parser.Found(L"usecd") )
	{
		Startup.CdvdSource	= CDVD_SourceType::Plugin;
		Startup.SysAutoRun	= true;
	}

	return true;
}
bool CTimerControlApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
	if (!wxApp::OnCmdLineParsed(parser))
		return false;

	m_nolog = parser.Found(NOLOGGING_SWITCH);

	wxString logDir;
	bool found = parser.Found(LOGDIR_OPTION, &logDir);
	if (found)
		m_logDir = logDir;

	if (parser.GetParamCount() > 0U)
		m_name = parser.GetParam(0U);

	return true;
}