summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-11-23 23:26:31 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-11-23 23:27:09 -0800
commitcd8b8001b6b9e11ba27a300cd03d70cab0271bf0 (patch)
tree11b430a942112e1a03296abb15cd40eb6489560e
parent5eb28e5bbb97a1c1faa0d77c85c8d566e3e4fcdf (diff)
Add -version option to print program version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--man/smproxy.man5
-rw-r--r--smproxy.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/man/smproxy.man b/man/smproxy.man
index 892dbf2..a38d789 100644
--- a/man/smproxy.man
+++ b/man/smproxy.man
@@ -27,7 +27,7 @@
smproxy \- Session Manager Proxy
.SH SYNOPSIS
.B smproxy
-[-clientId id] [-restore saveFile]
+[-clientId id] [-restore saveFile] [-version]
.SH OPTIONS
.TP 8
.B \-clientId \fIid\fP
@@ -35,6 +35,9 @@ Specifies the session ID used by \fIsmproxy\fP in the previous session.
.TP 8
.B \-restore \fIsaveFile\fP
Specifies the file used by \fIsmproxy\fP to save state in the previous session.
+.TP 8
+.B \-version
+Prints the program version and exits.
.SH DESCRIPTION
.PP
\fIsmproxy\fP allows X applications that do not support X11R6 session
diff --git a/smproxy.c b/smproxy.c
index 3ceb880..6e32371 100644
--- a/smproxy.c
+++ b/smproxy.c
@@ -1184,6 +1184,10 @@ main (int argc, char *argv[])
}
restore_filename = argv[i];
continue;
+
+ case 'v':
+ puts (PACKAGE_STRING);
+ exit (0);
}
}
@@ -1192,7 +1196,8 @@ main (int argc, char *argv[])
usage:
fprintf (stderr,
- "usage: %s [-clientId id] [-restore file] [-debug]\n", argv[0]);
+ "usage: %s [-clientId id] [-restore file] [-debug] [-version]\n",
+ argv[0]);
exit (1);
}