Esempio n. 1
1
bool FlashApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
    if ( parser.GetParamCount() )
        m_swf = parser.GetParam(0);

    return wxApp::OnCmdLineParsed(parser);
}
Esempio n. 2
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;

}
Esempio n. 3
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
    }
}
Esempio n. 4
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;
}
Esempio n. 5
0
// 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);
}
Esempio n. 6
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 );
}
Esempio n. 7
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();
	}
}
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;
}
Esempio n. 9
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;
		}
	}
}
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;
}
Esempio n. 11
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);
   }
}
Esempio n. 12
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);
}
Esempio n. 13
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 );
}
Esempio n. 14
0
bool DecisionLogicApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
	if (parser.GetParamCount() > 0)
	{
		fileToOpen = parser.GetParam(0);
	}
	return true;
}
Esempio n. 15
0
bool ErrorApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
    errorMsg = wxT("{NO ERROR MESSAGE RECEIVED}");

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

    return true;
}
Esempio n. 16
0
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;
}
Esempio n. 17
0
bool CRemoteControlApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
	if (!wxApp::OnCmdLineParsed(parser))
		return false;

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

	return true;
}
Esempio n. 18
0
    virtual bool OnCmdLineParsed(wxCmdLineParser& parser)
    {
        if ( !wxApp::OnCmdLineParsed(parser) )
            return false;

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

        return true;
    }
Esempio n. 19
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;
}
Esempio n. 20
0
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;
}
Esempio n. 21
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;
}
Esempio n. 22
0
bool iCPApp::OnCmdLineParsed(wxCmdLineParser &parser)
{
    // we don't call the parents method of OnCmdLineParse, this will pull in other options we don't want
    if(!parser.Found(wxT("s"),&m_setting))
    {
        m_setting=-1;
    };
    if(!parser.Found(wxT("m"),&m_matches))
    {
        m_matches=-1;
    };
    parser.Found(wxT("o"),&m_output);
    m_input=parser.GetParam();
    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;
}
Esempio n. 24
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;
	}
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;
}
Esempio n. 26
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;
}
Esempio n. 28
0
File: alcc.cpp Progetto: geekt/amule
/// Command line preocessing
bool alcc::OnCmdLineParsed(wxCmdLineParser& cmdline)
{

  wxFileName filename;
  size_t i;

  m_flagVerbose = cmdline.Found(wxT("v"));
  m_flagPartHashes = cmdline.Found(wxT("p"));

  m_filesToHash.Clear();
  for (i = 0; i < cmdline.GetParamCount(); ++i)
    {
      filename.Assign(cmdline.GetParam(i));
      m_filesToHash.Add(filename.GetFullPath());
    }
  m_filesToHash.Shrink();

  return true;
}
Esempio n. 29
0
/** @brief OnCmdLineParsed
  *
  * @todo: document this function
  */
bool ComplxApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
    parser.Found(_("u"), &decimal);
    parser.Found(_("d"), &disassemble);
    parser.Found(_("s"), &stack_size);
    parser.Found(_("a"), &address_str);
    parser.Found(_("t"), &true_traps);
    parser.Found(_("ie"), &interrupts);
    parser.Found(_("i"), &highlight);
    parser.Found(_("state"), &state_file);

    // get unnamed parameters
    for (unsigned int i = 0; i < parser.GetParamCount(); i++)
    {
        files.Add(parser.GetParam(i));
    }

    return true;
}
Esempio n. 30
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);
}