[gnome-tweak-tool] add '--version' option to gnome-tweaks CLI



commit 3c6aa1b5737a4e7a2dcee03d3af1c19d744d9697
Author: Alexander Rüedlinger <a rueedlinger gmail com>
Date:   Fri Jul 28 22:35:02 2017 +0200

    add '--version' option to gnome-tweaks CLI
    
    Add a '--version' option to the GNOME tweaks CLI so that it follows
    the GNU Coding Standards [1]. Thanks to the optparse library [2],
    this can be easily fixed by passing a version argument to OptionParser.
    
    [1] https://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html
    [2] https://docs.python.org/3/library/optparse.html#printing-a-version-string
    
    https://bugzilla.gnome.org/show_bug.cgi?id=785545

 gnome-tweaks |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gnome-tweaks b/gnome-tweaks
index 8e01939..9ba2afc 100755
--- a/gnome-tweaks
+++ b/gnome-tweaks
@@ -25,9 +25,10 @@ import gi
 gi.require_version("Gtk", "3.0")
 
 import gtweak
+from gtweak.defs import VERSION
 
 if __name__ == '__main__':
-    parser = optparse.OptionParser()
+    parser = optparse.OptionParser(version=VERSION)
     parser.add_option("-t", "--test", action="store_true",
                       help="Enable test and debug code")
     parser.add_option("-l", "--load", action="store_true",


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