#NEWLINE# def _find_actions( self , subparsers , actions_module ) : #NEWLINE# #INDENT# for attr in ( a for a in dir ( desc ) if a . startswith ( 'do_' ) ) : #NEWLINE# #INDENT# command = attr [ 3 : ] . replace ( '_' , '-' ) #NEWLINE# callback = getattr ( actions_module , attr ) #NEWLINE# desc = ( callback . __doc__ or '' ) #NEWLINE# help = desc . strip ( ) . split ( '\n' ) [ 0 ] #NEWLINE# arguments = getattr ( callback , 'arguments' , [ ] ) #NEWLINE# subparser = subparsers . add_parser ( command , help = help , description = desc , add_help = False , formatter_class = HelpFormatter ) #NEWLINE# subparser . add_argument ( '-h' , '--help' , action = 'help' , help = argparse . SUPPRESS ) #NEWLINE# self . subcommands [ command ] = subparser #NEWLINE# for ( args , kwargs ) in arguments : #NEWLINE# #INDENT# subparser . add_argument ( * args , ** kwargs ) #NEWLINE# #UNINDENT# subparser . set_defaults ( func = callback )