Add command line option to SampleHive version.
This commit is contained in:
parent
aeaa50ff82
commit
c49aca13a4
22
src/App.cpp
22
src/App.cpp
|
|
@ -63,3 +63,25 @@ bool App::OnInit()
|
|||
m_Frame->Show(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
void App::OnInitCmdLine(wxCmdLineParser& parser)
|
||||
{
|
||||
wxApp::OnInitCmdLine(parser);
|
||||
|
||||
parser.AddSwitch("v", "version", "Shows the application version", 0);
|
||||
parser.Parse(true);
|
||||
}
|
||||
|
||||
bool App::OnCmdLineParsed(wxCmdLineParser& parser)
|
||||
{
|
||||
if (!wxApp::OnCmdLineParsed(parser))
|
||||
return false;
|
||||
|
||||
if (parser.Found("version"))
|
||||
{
|
||||
std::cout << "SampleHive v0.8.4_alpha.1" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <wx/app.h>
|
||||
#include <wx/cmdline.h>
|
||||
|
||||
#include "MainFrame.hpp"
|
||||
|
||||
|
|
@ -35,4 +36,6 @@ class App : public wxApp
|
|||
|
||||
private:
|
||||
virtual bool OnInit();
|
||||
virtual void OnInitCmdLine(wxCmdLineParser& parser);
|
||||
virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue