diff --git a/src/App.cpp b/src/App.cpp index 014421a..fc58dda 100644 --- a/src/App.cpp +++ b/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; +} diff --git a/src/App.hpp b/src/App.hpp index 374f601..045d61c 100644 --- a/src/App.hpp +++ b/src/App.hpp @@ -21,6 +21,7 @@ #pragma once #include +#include #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); };