[gnome-shell] Add a --version command line option



commit 744bc996db2d4edda878a0cff5d92edc90f23aaf
Author: Florian Müllner <fmuellner src gnome org>
Date:   Wed Mar 17 18:02:24 2010 +0100

    Add a --version command line option
    
    https://bugzilla.gnome.org/show_bug.cgi?id=613164

 src/Makefile.am    |    1 +
 src/gnome-shell.in |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 3d421a8..4fa20a9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,6 +18,7 @@ gnome-shell: gnome-shell.in
 	    -e "s|@libdir[ ]|$(libdir)|" \
 	    -e "s|@pkgdatadir[ ]|$(pkgdatadir)|" \
 	    -e "s|@PYTHON[ ]|$(PYTHON)|" \
+	    -e "s|@VERSION[ ]|$(VERSION)|" \
 	    -e "s|@sysconfdir[ ]|$(sysconfdir)|" \
 	    $< > $@ && chmod a+x $@
 CLEANFILES += gnome-shell
diff --git a/src/gnome-shell.in b/src/gnome-shell.in
index 36548c5..60a970a 100644
--- a/src/gnome-shell.in
+++ b/src/gnome-shell.in
@@ -14,6 +14,10 @@ import termios
 import time
 import errno
 
+def show_version(option, opt_str, value, parser):
+    print "GNOME Shell @VERSION@"
+    sys.exit()
+
 def get_running_session_environs():
     wanted_environment = ['DBUS_SESSION_BUS_ADDRESS', 'DISPLAY', 'XDG_DATA_DIRS',
                           'XAUTHORITY', 'XDG_SESSION_COOKIE', 'ORBIT_SOCKETDIR',
@@ -258,6 +262,8 @@ parser.add_option("", "--eval-file", metavar="EVAL_FILE",
                   help="Evaluate the contents of the given JavaScript file")
 parser.add_option("", "--create-extension", action="store_true",
                   help="Create a new GNOME Shell extension")
+parser.add_option("", "--version", action="callback", callback=show_version,
+                  help="Display version and exit")
 
 options, args = parser.parse_args()
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]