File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,8 @@ def __init__(self,
110
110
# Indicate that initialization is complete
111
111
self ._initialized = True
112
112
113
+ self .description = self .__doc__ or ''
114
+
113
115
def _add_argument (self , * name_or_flags , ** kwargs ) -> None :
114
116
"""Adds an argument to self (i.e. the super class ArgumentParser).
115
117
@@ -311,6 +313,9 @@ def process_args(self) -> None:
311
313
312
314
def add_subparser (self , flag : str , subparser_type : type , ** kwargs ) -> None :
313
315
"""Add a subparser to the collection of subparsers"""
316
+ help_desc = kwargs .get ('help' , subparser_type .__doc__ )
317
+ kwargs ['help' ] = help_desc
318
+
314
319
self ._subparser_buffer .append ((flag , subparser_type , kwargs ))
315
320
316
321
def _add_subparsers (self ) -> None :
You can’t perform that action at this time.
0 commit comments