changeset 184:f8a19dbc8231

Add version switch to getan Display version when getan is called with --version switch.
author Björn Ricks <bjoern.ricks@intevation.de>
date Thu, 13 Dec 2012 15:52:53 +0100
parents dce2d3b845b7
children 67863b5e1f06
files getan/main.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/getan/main.py	Thu Dec 13 15:52:18 2012 +0100
+++ b/getan/main.py	Thu Dec 13 15:52:53 2012 +0100
@@ -16,7 +16,9 @@
 
 from optparse import OptionParser
 
+import getan
 import getan.config  as config
+
 from getan.backend import DEFAULT_DATABASE, Backend
 from getan.view import ProjectList, EntryList
 from getan.controller import GetanController
@@ -27,7 +29,8 @@
 
     usage = "usage: %prog [options] [databasefile (default: " + \
              DEFAULT_DATABASE + ")]"
-    parser = OptionParser(usage=usage)
+    version = "getan version %s" % getan.__version__
+    parser = OptionParser(usage=usage, version=version)
     parser.add_option("-d", "--debug", action="store_true", dest="debug",
                       help="Set verbosity to debug")
     parser.add_option("-l", "--logfile", dest="logfile", metavar="FILE",
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)