@@ -46,7 +46,7 @@ def generate_level(self, prefix, parser, Archiver, extra_choices=None):
4646 is_subcommand = False
4747 choices = {}
4848 for action in parser ._actions :
49- if action .choices is not None and "SubParsersAction " in str (action .__class__ ):
49+ if action .choices is not None and "_ActionSubCommands " in str (action .__class__ ):
5050 is_subcommand = True
5151 for cmd , parser in action .choices .items ():
5252 choices [prefix + cmd ] = parser
@@ -323,7 +323,7 @@ def generate_level(self, prefix, parser, Archiver, extra_choices=None):
323323 is_subcommand = False
324324 choices = {}
325325 for action in parser ._actions :
326- if action .choices is not None and "SubParsersAction " in str (action .__class__ ):
326+ if action .choices is not None and "_ActionSubCommands " in str (action .__class__ ):
327327 is_subcommand = True
328328 for cmd , parser in action .choices .items ():
329329 choices [prefix + cmd ] = parser
@@ -349,7 +349,7 @@ def generate_level(self, prefix, parser, Archiver, extra_choices=None):
349349
350350 self .write_heading (write , "SYNOPSIS" )
351351 if is_intermediary :
352- subparsers = [action for action in parser ._actions if "SubParsersAction " in str (action .__class__ )][0 ]
352+ subparsers = [action for action in parser ._actions if "_ActionSubCommands " in str (action .__class__ )][0 ]
353353 for subcommand in subparsers .choices :
354354 write ("| borg" , "[common options]" , command , subcommand , "..." )
355355 self .see_also .setdefault (command , []).append (f"{ command } -{ subcommand } " )
0 commit comments