changeset 465:7fc3da3c100d

More and better information in --version.
author Magnus Schieder <mschieder@intevation.de>
date Wed, 02 May 2018 13:00:37 +0200
parents 2ab6fdde1010
children 9dab95965ac6
files getan/main.py
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/getan/main.py	Mon Apr 30 14:13:05 2018 +0200
+++ b/getan/main.py	Wed May 02 13:00:37 2018 +0200
@@ -14,6 +14,7 @@
 import os
 import os.path
 import argparse
+import textwrap
 
 import getan
 import getan.config as config
@@ -28,10 +29,19 @@
 
     usage = "%(prog)s [options] [databasefile (default: " + \
         DEFAULT_DATABASE + ")]"
-    version = "getan version %s, LICENSE GNU GPL v>=3" % getan.__version__
+    version = '''
+    getan version %s,
+    (c) 2017 by Intevation
+        Author: Bernhard.Reiter@intevation.de
 
-    parser = argparse.ArgumentParser(prog='getan', usage=usage)
-    parser.add_argument('--version', action='version', version=version)
+    This is Free Software licensed under the terms of GPLv3 or later.
+    For details see LICENSE coming with the source of \'getan\'.
+    ''' % getan.__version__
+
+    parser = argparse.ArgumentParser(prog='getan', usage=usage,
+             formatter_class=argparse.RawTextHelpFormatter)
+    parser.add_argument('--version', action='version',
+                        version=textwrap.dedent(version))
     parser.add_argument(dest='filename', nargs='?',
                         help='[databasefile (default: %(default)s)]',
                         default=DEFAULT_DATABASE)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)