diff --git a/uppsrc/ide/CommandLineHandler.cpp b/uppsrc/ide/CommandLineHandler.cpp index 215b1d605..3930c5f27 100644 --- a/uppsrc/ide/CommandLineHandler.cpp +++ b/uppsrc/ide/CommandLineHandler.cpp @@ -1,5 +1,7 @@ #include "CommandLineHandler.h" +#include "About.h" + #include #include #include @@ -15,6 +17,8 @@ bool CommandLineHandler::Handle() if(HandleManipulators()) return true; + if(HandleVersion()) + return true; if(HandleHelp()) return true; @@ -39,7 +43,7 @@ bool CommandLineHandler::HandleScale() int scale = StrInt(args[1]); if(IsNull(scale)) { - Cout() << "Scale should be numeric value."; + Cout() << "Scale should be numeric value.\n"; return true; } @@ -50,6 +54,16 @@ bool CommandLineHandler::HandleScale() return false; } +bool CommandLineHandler::HandleVersion() const +{ + if(args.IsEmpty() || findarg(args[0], "-v", "--version") < 0) + return false; + + Cout() << SplashCtrl::GenerateVersionInfo(' ') << "\n"; + + return true; +} + bool CommandLineHandler::HandleHelp() const { if(args.IsEmpty() || findarg(args[0], "?", "--help", "-h", "-?", "/?") < 0) @@ -59,7 +73,8 @@ bool CommandLineHandler::HandleHelp() const " theide [file..] // autodetection mode\n\n"; Cout() << "Common options:\n" - " -h or --help - displays this site.\n\n"; + " -v or --version - displays information about version.\n" + " -h or --help - displays this site.\n\n"; Cout() << "Advanced options:\n" " " << COMMAND_LINE_SCALE_OPTION << " $percent - scale interface by \"percent\" represented by parameter x.\n\n"; @@ -77,7 +92,7 @@ bool CommandLineHandler::HandleDebugBreakProcess() const int pid = StrInt(args[1]); if(IsNull(pid)) { - Cout() << "PID should be numeric value."; + Cout() << "PID should be numeric value.\n"; return true; } diff --git a/uppsrc/ide/CommandLineHandler.h b/uppsrc/ide/CommandLineHandler.h index 18319325c..fdd593756 100644 --- a/uppsrc/ide/CommandLineHandler.h +++ b/uppsrc/ide/CommandLineHandler.h @@ -19,6 +19,7 @@ private: bool HandleManipulators(); bool HandleScale(); + bool HandleVersion() const; bool HandleHelp() const; bool HandleDebugBreakProcess() const;