[PATCH:smproxy 7/7] Add -version option to print program version

Alan Coopersmith alan.coopersmith at oracle.com
Sun Nov 24 09:35:27 PST 2013


Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 man/smproxy.man |    5 ++++-
 smproxy.c       |    7 ++++++-
 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);
     }
 
-- 
1.7.9.2



More information about the xorg-devel mailing list