File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -937,13 +937,15 @@ def __init__(self,
937937 _option_strings .append (option_string )
938938
939939 if len (option_string ) > 2 and option_string [0 ] == option_string [1 ]:
940+ # two-dash long option: '--foo' -> '--no-foo'
940941 if option_string .startswith ('no-' , 2 ):
941942 raise ValueError (f'invalid option name { option_string !r} '
942943 f'for BooleanOptionalAction' )
943944 option_string = option_string [:2 ] + 'no-' + option_string [2 :]
944945 _option_strings .append (option_string )
945946 neg_option_strings .append (option_string )
946947 elif len (option_string ) > 2 and option_string [0 ] != option_string [1 ]:
948+ # single-dash long option: '-foo' -> '-nofoo'
947949 if option_string .startswith ('no' , 1 ):
948950 raise ValueError (f'invalid option name { option_string !r} '
949951 f'for BooleanOptionalAction' )
You can’t perform that action at this time.
0 commit comments