Skip to content

Commit a70c4c7

Browse files
zrlflebrice
andauthored
Pass custom help formatter to subparsers (#336) (#339)
* Pass custom help formatter to subparsers (#336) * Fix formatting in field_wrapper.py Signed-off-by: Fabrice Normandin <[email protected]> --------- Signed-off-by: Fabrice Normandin <[email protected]> Co-authored-by: Fabrice Normandin <[email protected]>
1 parent a1c5167 commit a70c4c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

simple_parsing/wrappers/field_wrapper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ def add_subparsers(self, parser: ArgumentParser):
10211021
# subparsers.required = default_value is dataclasses.MISSING
10221022
for subcommand, dataclass_type in self.subparsers_dict.items():
10231023
logger.debug(f"adding subparser '{subcommand}' for type {dataclass_type}")
1024-
subparser = subparsers.add_parser(subcommand)
1024+
subparser = subparsers.add_parser(subcommand, formatter_class=parser.formatter_class)
10251025
# Just for typing correctness, as we didn't explicitly change
10261026
# the return type of subparsers.add_parser method.)
10271027
subparser = cast("ArgumentParser", subparser)

0 commit comments

Comments
 (0)