mirror of
https://gitlab.com/samplehive/sample-hive.git
synced 2026-10-16 01:44:12 +02:00
Add command line option to SampleHive version.
This commit is contained in:
+22
@@ -63,3 +63,25 @@ bool App::OnInit()
|
|||||||
m_Frame->Show(true);
|
m_Frame->Show(true);
|
||||||
return 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
|
#pragma once
|
||||||
|
|
||||||
#include <wx/app.h>
|
#include <wx/app.h>
|
||||||
|
#include <wx/cmdline.h>
|
||||||
|
|
||||||
#include "MainFrame.hpp"
|
#include "MainFrame.hpp"
|
||||||
|
|
||||||
@@ -35,4 +36,6 @@ class App : public wxApp
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
virtual bool OnInit();
|
virtual bool OnInit();
|
||||||
|
virtual void OnInitCmdLine(wxCmdLineParser& parser);
|
||||||
|
virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user