summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2011-04-14 18:12:26 +0200
committerHans de Goede <hdegoede@redhat.com>2011-04-20 10:45:14 +0200
commit1d61c0211e1c72c5d80c631f0543f2ad88ef4f3d (patch)
tree4fa10f7267b6d18647d15caf5f1f637b48cdb0cc /client
parent4bcb62f9a1c1a855cbd709317fe222feb6730fb8 (diff)
downloadspice-1d61c0211e1c72c5d80c631f0543f2ad88ef4f3d.tar.gz
spice-1d61c0211e1c72c5d80c631f0543f2ad88ef4f3d.tar.xz
spice-1d61c0211e1c72c5d80c631f0543f2ad88ef4f3d.zip
client: add --version cmdline option to spicec
This fixes freedesktop bug #33907
Diffstat (limited to 'client')
-rw-r--r--client/application.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/client/application.cpp b/client/application.cpp
index a7c4e503..e7e24929 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;