From 66262d8dc2d961bd6a614f4683db58d12cabeba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Murta?= Date: Wed, 7 Jul 2021 16:46:50 +0100 Subject: [PATCH] Moves period parser outside of Graph section `period` ArgumentParser was inside of the Graph section of the `argparser` function, resulting in confusing logical sequence. Moved around to the beginning of the function to clarify code. --- pfbudget/runnable.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pfbudget/runnable.py b/pfbudget/runnable.py index 902f2e2..3130dff 100644 --- a/pfbudget/runnable.py +++ b/pfbudget/runnable.py @@ -30,6 +30,14 @@ def argparser() -> argparse.ArgumentParser: ) help.add_argument("-q", "--quiet", help="quiet") + period = argparse.ArgumentParser(add_help=False).add_mutually_exclusive_group() + period.add_argument( + "--interval", type=str, nargs=2, help="graph interval", metavar=("START", "END") + ) + period.add_argument("--start", type=str, nargs=1, help="graph start date") + period.add_argument("--end", type=str, nargs=1, help="graph end date") + period.add_argument("--year", type=str, nargs=1, help="graph year") + parser = argparse.ArgumentParser( description="does cool finance stuff", parents=[help] ) @@ -67,14 +75,6 @@ def argparser() -> argparse.ArgumentParser: func=lambda args: categorize_data(DBManager(args.database)) ) - period = argparse.ArgumentParser(add_help=False).add_mutually_exclusive_group() - period.add_argument( - "--interval", type=str, nargs=2, help="graph interval", metavar=("START", "END") - ) - period.add_argument("--start", type=str, nargs=1, help="graph start date") - period.add_argument("--end", type=str, nargs=1, help="graph end date") - period.add_argument("--year", type=str, nargs=1, help="graph year") - """ Graph """