File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,14 +83,8 @@ def build_parser() -> argparse.ArgumentParser:
8383 # Add verbosity options
8484 shared .add_parser_verbosity_group (parser )
8585
86- # Provide -help to mirror legacy behavior (in addition to -h and --help)
87- parser .add_argument (
88- "-h" ,
89- "--help" ,
90- "-help" ,
91- action = "help" ,
92- help = "Show this help message and exit" ,
93- )
86+ # Add help text
87+ shared .add_help (parser )
9488
9589 return parser
9690
Original file line number Diff line number Diff line change @@ -53,6 +53,23 @@ def add_inputdata_root(parser: argparse.ArgumentParser):
5353 )
5454
5555
56+ def add_help (parser : argparse .ArgumentParser ):
57+ """Add help option to an argument parser.
58+
59+ Provides -help to mirror legacy rimport behavior (in addition to -h and --help).
60+
61+ Args:
62+ parser: ArgumentParser instance to add the help arg to.
63+ """
64+ parser .add_argument (
65+ "-h" ,
66+ "--help" ,
67+ "-help" ,
68+ action = "help" ,
69+ help = "Show this help message and exit" ,
70+ )
71+
72+
5673def add_parser_verbosity_group (parser : argparse .ArgumentParser ):
5774 """Add mutually exclusive verbosity options to an argument parser.
5875
You can’t perform that action at this time.
0 commit comments