From 750286a7aba7dc091b4407c9f31157129aade588 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Wed, 20 Oct 2021 12:06:44 -0400 Subject: ty: fix bugs introduced when switching -s to -t Test out and fix the bugs introduced by switching flags. Reported-by: Jens Axboe Signed-off-by: Konstantin Ryabitsev --- b4/command.py | 2 +- b4/ty.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/b4/command.py b/b4/command.py index 9199359..ef5af58 100644 --- a/b4/command.py +++ b/b4/command.py @@ -201,7 +201,7 @@ def cmd(): help='Write thanks files into this dir (default=.)') sp_ty.add_argument('-l', '--list', action='store_true', default=False, help='List pull requests and patch series you have retrieved') - sp_ty.add_argument('-t', '--thank-for', default=None, + sp_ty.add_argument('-t', '--thank-for', dest='thankfor', default=None, help='Generate thankyous for specific entries from -l (e.g.: 1,3-5,7-; or "all")') sp_ty.add_argument('-d', '--discard', default=None, help='Discard specific messages from -l (e.g.: 1,3-5,7-; or "all")') diff --git a/b4/ty.py b/b4/ty.py index b790007..874fa5e 100644 --- a/b4/ty.py +++ b/b4/ty.py @@ -509,11 +509,11 @@ def thank_selected(cmdargs): logger.info('Nothing to do') sys.exit(0) - if cmdargs.send == 'all': + if cmdargs.thankfor == 'all': listing = tracked else: listing = list() - for num in b4.parse_int_range(cmdargs.send, upper=len(tracked)): + for num in b4.parse_int_range(cmdargs.thankfor, upper=len(tracked)): try: index = int(num) - 1 listing.append(tracked[index]) @@ -659,7 +659,7 @@ def main(cmdargs): if cmdargs.auto: check_stale_thanks(cmdargs.outdir) auto_thankanator(cmdargs) - elif cmdargs.thank: + elif cmdargs.thankfor: check_stale_thanks(cmdargs.outdir) thank_selected(cmdargs) elif cmdargs.discard: -- cgit v1.2.3