Add command line option to SampleHive version.

This commit is contained in:
apoorv569
2021-07-25 00:32:46 +05:30
parent aeaa50ff82
commit c49aca13a4
2 changed files with 25 additions and 0 deletions
+22
View File
@@ -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;
}