Skip to content

Commit 3b5bc23

Browse files
making add_help optional for parse and parse_known_args functions (#360)
1 parent 2a69ceb commit 3b5bc23

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

simple_parsing/parsing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,7 @@ def parse(
10081008
dest: str = "config",
10091009
*,
10101010
prefix: str = "",
1011+
add_help: bool = True,
10111012
nested_mode: NestedMode = NestedMode.WITHOUT_ROOT,
10121013
conflict_resolution: ConflictResolution = ConflictResolution.AUTO,
10131014
add_option_string_dash_variants: DashVariant = DashVariant.AUTO,
@@ -1028,7 +1029,7 @@ def parse(
10281029

10291030
parser = ArgumentParser(
10301031
nested_mode=nested_mode,
1031-
add_help=True,
1032+
add_help=add_help,
10321033
config_path=config_path,
10331034
conflict_resolution=conflict_resolution,
10341035
add_option_string_dash_variants=add_option_string_dash_variants,
@@ -1056,6 +1057,7 @@ def parse_known_args(
10561057
dest: str = "config",
10571058
attempt_to_reorder: bool = False,
10581059
*,
1060+
add_help: bool = True,
10591061
nested_mode: NestedMode = NestedMode.WITHOUT_ROOT,
10601062
conflict_resolution: ConflictResolution = ConflictResolution.AUTO,
10611063
add_option_string_dash_variants: DashVariant = DashVariant.AUTO,
@@ -1075,7 +1077,7 @@ def parse_known_args(
10751077
args = shlex.split(args)
10761078
parser = ArgumentParser(
10771079
nested_mode=nested_mode,
1078-
add_help=True,
1080+
add_help=add_help,
10791081
# add_config_path_arg=None,
10801082
config_path=config_path,
10811083
conflict_resolution=conflict_resolution,

0 commit comments

Comments
 (0)