fix problems of command line parameters
* Fix return code for wrong command line parameters. * Update return code for incorrect command line option on WX port.
This commit is contained in:
parent
a1f0c34ace
commit
c714ff825a
|
@ -206,6 +206,9 @@ bool wxvbamApp::OnInit()
|
||||||
if (!wxApp::OnInit())
|
if (!wxApp::OnInit())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (console_mode)
|
||||||
|
return true;
|
||||||
|
|
||||||
// prepare for loading xrc files
|
// prepare for loading xrc files
|
||||||
wxXmlResource* xr = wxXmlResource::Get();
|
wxXmlResource* xr = wxXmlResource::Get();
|
||||||
// note: if linking statically, next 2 pull in lot of unused code
|
// note: if linking statically, next 2 pull in lot of unused code
|
||||||
|
@ -426,7 +429,7 @@ int wxvbamApp::OnRun()
|
||||||
if (console_mode)
|
if (console_mode)
|
||||||
{
|
{
|
||||||
// we could check for our own error codes here...
|
// we could check for our own error codes here...
|
||||||
return EXIT_SUCCESS;
|
return console_status;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -441,6 +444,14 @@ bool wxvbamApp::OnCmdLineHelp(wxCmdLineParser& parser)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxvbamApp::OnCmdLineError(wxCmdLineParser& parser)
|
||||||
|
{
|
||||||
|
wxApp::OnCmdLineError(parser);
|
||||||
|
console_mode = true;
|
||||||
|
console_status = 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void wxvbamApp::OnInitCmdLine(wxCmdLineParser& cl)
|
void wxvbamApp::OnInitCmdLine(wxCmdLineParser& cl)
|
||||||
{
|
{
|
||||||
wxApp::OnInitCmdLine(cl);
|
wxApp::OnInitCmdLine(cl);
|
||||||
|
|
|
@ -85,6 +85,7 @@ public:
|
||||||
virtual bool OnInit();
|
virtual bool OnInit();
|
||||||
virtual int OnRun();
|
virtual int OnRun();
|
||||||
virtual bool OnCmdLineHelp(wxCmdLineParser&);
|
virtual bool OnCmdLineHelp(wxCmdLineParser&);
|
||||||
|
virtual bool OnCmdLineError(wxCmdLineParser&);
|
||||||
virtual bool UsingWayland() { return using_wayland; }
|
virtual bool UsingWayland() { return using_wayland; }
|
||||||
virtual void OnInitCmdLine(wxCmdLineParser&);
|
virtual void OnInitCmdLine(wxCmdLineParser&);
|
||||||
virtual bool OnCmdLineParsed(wxCmdLineParser&);
|
virtual bool OnCmdLineParsed(wxCmdLineParser&);
|
||||||
|
@ -145,6 +146,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
bool using_wayland;
|
bool using_wayland;
|
||||||
bool console_mode = false;
|
bool console_mode = false;
|
||||||
|
int console_status = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxPathList config_path;
|
wxPathList config_path;
|
||||||
|
|
Loading…
Reference in New Issue