summaryrefslogtreecommitdiffstats
path: root/bin/review-update-needed
diff options
context:
space:
mode:
authorAntoine Beaupré <anarcat@debian.org>2018-11-09 13:12:18 -0500
committerAntoine Beaupré <anarcat@debian.org>2018-11-09 13:12:18 -0500
commitf4b55b098b12a94db115a081db01de5e7b707fa4 (patch)
tree597e1eb45faf1c2407dba07dba8bcddb09acd74e /bin/review-update-needed
parent677a21c0e302d122da105f2da8f28d6dfbadb92d (diff)
more pythonic args checking
Diffstat (limited to 'bin/review-update-needed')
-rwxr-xr-xbin/review-update-needed11
1 files changed, 3 insertions, 8 deletions
diff --git a/bin/review-update-needed b/bin/review-update-needed
index ad54dbfdbc..b50bd513cb 100755
--- a/bin/review-update-needed
+++ b/bin/review-update-needed
@@ -26,6 +26,7 @@ parser.add_argument('--lts', action='store_true',
parser.add_argument('-v', '--verbose', action='store_true',
help='Show more information, e.g. notes, commit author and per user stats')
parser.add_argument('--sort-by', default='last-update',
+ choices=('last-update', 'claimed-date'),
help='Sort by last-update (default) or by claimed-date')
parser.add_argument('--skip-unclaimed', action='store_true',
help='Skip unclaimed packages in the review')
@@ -36,17 +37,11 @@ if args.lts:
else:
dsa_dla_needed = 'data/dsa-needed.txt'
-if args.sort_by not in ('last-update', 'claimed-date'):
- sys.stderr.write('ERROR: usage: --sort-by={last-update,claimed-date}\n')
- sys.exit(1)
-
if not os.path.exists(dsa_dla_needed):
- sys.stderr.write("ERROR: {} not found\n".format(dsa_dla_needed))
- sys.exit(1)
+ args.error("ERROR: {} not found\n".format(dsa_dla_needed))
if not os.path.exists(".git"):
- sys.stderr.write("ERROR: works only in a git checkout\n")
- sys.exit(1)
+ args.error("ERROR: works only in a git checkout\n")
process = subprocess.Popen(["git", "blame", "--line-porcelain", "--",
dsa_dla_needed], stdout=subprocess.PIPE)

© 2014-2024 Faster IT GmbH | imprint | privacy policy