Commit c714ff82 authored by Edênis Freindorfer Azevedo's avatar Edênis Freindorfer Azevedo Committed by Rafael Kitover
Browse files

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.
parent a1f0c34a
......@@ -206,6 +206,9 @@ bool wxvbamApp::OnInit()
if (!wxApp::OnInit())
return false;
if (console_mode)
return true;
// prepare for loading xrc files
wxXmlResource* xr = wxXmlResource::Get();
// note: if linking statically, next 2 pull in lot of unused code
......@@ -426,7 +429,7 @@ int wxvbamApp::OnRun()
if (console_mode)
{
// we could check for our own error codes here...
return EXIT_SUCCESS;
return console_status;
}
else
{
......@@ -441,6 +444,14 @@ bool wxvbamApp::OnCmdLineHelp(wxCmdLineParser& parser)
return true;
}
bool wxvbamApp::OnCmdLineError(wxCmdLineParser& parser)
{
wxApp::OnCmdLineError(parser);
console_mode = true;
console_status = 1;
return true;
}
void wxvbamApp::OnInitCmdLine(wxCmdLineParser& cl)
{
wxApp::OnInitCmdLine(cl);
......
......@@ -85,6 +85,7 @@ public:
virtual bool OnInit();
virtual int OnRun();
virtual bool OnCmdLineHelp(wxCmdLineParser&);
virtual bool OnCmdLineError(wxCmdLineParser&);
virtual bool UsingWayland() { return using_wayland; }
virtual void OnInitCmdLine(wxCmdLineParser&);
virtual bool OnCmdLineParsed(wxCmdLineParser&);
......@@ -145,6 +146,7 @@ public:
protected:
bool using_wayland;
bool console_mode = false;
int console_status = 0;
private:
wxPathList config_path;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment