# HG changeset patch # User Bernhard Reiter # Date 1578471743 -3600 # Node ID d5acadeef0f859649892cb1c355839638fbd1204 # Parent 5d4006e3210c6e1fd91d9544337a1d7a9b8a1437 improve usage message & simply code * Shorten help output for `--database` as the good option name is enough to explain. * Fix typo in help output for `--empty' * Simplyied code by removing `dest` and `metavar` for add_argument where it was not necessary because it was already the default if those parameters are not given. * Add Intevation and Magnus as rights holder and author for 2019 and 2020. diff -r 5d4006e3210c -r d5acadeef0f8 scripts/getan-report --- a/scripts/getan-report Wed Jan 08 09:00:58 2020 +0100 +++ b/scripts/getan-report Wed Jan 08 09:22:23 2020 +0100 @@ -2,6 +2,10 @@ # -*- coding: utf-8 -*- # # (c) 2013, 2014 by Björn Ricks +# 2019, 2020 Intevation GmbH +# Author(s): +# * Björn Ricks +# * Magnus Schieder # # This is Free Software licensed under the terms of GPLv3 or later. # For details see LICENSE coming with the source of 'getan'. @@ -22,29 +26,24 @@ parser = argparse.ArgumentParser(prog='getan', usage=usage, description="You can find more information at https://pypi.org/project/getan/") - parser.add_argument('-d', '--database', dest='database',metavar="DATABASE_FILE", - help='databasefile (default: ~/.getan/%(default)s)]', + parser.add_argument('-d', '--database', metavar="DATABASE_FILE", + help='(default: ~/.getan/%(default)s)]', default=DEFAULT_DATABASE) - parser.add_argument('-t', '--template', dest='template', - metavar='TEMPLATE', + parser.add_argument('-t', '--template', help="""name of getan template (wochenbericht, zeiterfassung, zeiterfassung2), external templates must be stored in ~/.getan/templates/ to be able to call them.""") - parser.add_argument('-u', '--user', dest='user', help='name of user') - parser.add_argument('-p', '--project', dest='project', - help='key of output project') - parser.add_argument('-w', '--week', type=int, dest='week', - help='week of year') - parser.add_argument('-y', '--year', type=int, dest='year', help='year') - parser.add_argument('-c', '--lastweek', dest='lastweek', - help='entries of last working week', + parser.add_argument('-u', '--user', help='name of user') + parser.add_argument('-p', '--project', help='key of output project') + parser.add_argument('-w', '--week', type=int, help='week of year') + parser.add_argument('-y', '--year', type=int, help='year') + parser.add_argument('-c', '--lastweek', help='entries of last working week', action='store_true') - parser.add_argument('-m', '--empty', dest='empty', - help='show projects without an entries', + parser.add_argument('-m', '--empty', + help='show projects without an entry', action="store_true") - parser.add_argument('--encoding', dest='encoding', - help='encoding of output', metavar='ENCODING') + parser.add_argument('--encoding', help='encoding of output') args = parser.parse_args()