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.
This commit is contained in:
parent
f9ecd15a7e
commit
66262d8dc2
@ -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
|
||||
"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user