summaryrefslogtreecommitdiffstats
path: root/client/application.cpp
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2011-04-14 18:12:26 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2011-04-18 12:38:47 +0200
commitf73ab66cb89be1455b17475d8a0980ddf29f447a (patch)
treee64d7e914d08927e1bedf708f1d8114c435d2d0f /client/application.cpp
parentd590b48a466ca22dca91ee05c9d10a8feff1b31e (diff)
downloadspice-f73ab66cb89be1455b17475d8a0980ddf29f447a.tar.gz
spice-f73ab66cb89be1455b17475d8a0980ddf29f447a.tar.xz
spice-f73ab66cb89be1455b17475d8a0980ddf29f447a.zip
client: add --version cmdline option to spicec
This fixes freedesktop bug #33907
Diffstat (limited to 'client/application.cpp')
-rw-r--r--client/application.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/client/application.cpp b/client/application.cpp
index e74a871f..ef080875 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -2183,7 +2183,8 @@ bool Application::process_cmd_line(int argc, char** argv, bool &full_screen)
DisplaySetting display_setting;
enum {
- SPICE_OPT_HOST = CmdLineParser::OPTION_FIRST_AVAILABLE,
+ SPICE_OPT_VERSION = CmdLineParser::OPTION_FIRST_AVAILABLE,
+ SPICE_OPT_HOST,
SPICE_OPT_PORT,
SPICE_OPT_SPORT,
SPICE_OPT_PASSWORD,
@@ -2224,6 +2225,7 @@ bool Application::process_cmd_line(int argc, char** argv, bool &full_screen)
CmdLineParser parser("Spice client", false);
+ parser.add(SPICE_OPT_VERSION, "version", "spice client version", false);
parser.add(SPICE_OPT_HOST, "host", "spice server address", "host", true, 'h');
parser.add(SPICE_OPT_PORT, "port", "spice server port", "port", true, 'p');
parser.add(SPICE_OPT_SPORT, "secure-port", "spice server secure port", "port", true, 's');
@@ -2286,6 +2288,12 @@ bool Application::process_cmd_line(int argc, char** argv, bool &full_screen)
int op;
while ((op = parser.get_option(&val)) != CmdLineParser::OPTION_DONE) {
switch (op) {
+ case SPICE_OPT_VERSION: {
+ std::ostringstream os;
+ os << argv[0] << " "<< PACKAGE_VERSION << std::endl;
+ Platform::term_printf(os.str().c_str());
+ return false;
+ }
case SPICE_OPT_HOST:
host = val;
break;