def help(self, args):
if len(args) <= <NUM_LIT:2>:<EOL><INDENT>doc = self.__doc__ or self.run.__doc__<EOL>if doc:<EOL><INDENT>self.rst_msg(doc.rstrip('<STR_LIT:\n>'))<EOL><DEDENT>else:<EOL><INDENT>self.proc.intf[-<NUM_LIT:1>].errmsg('<STR_LIT>' +<EOL>'<STR_LIT>' +<EOL>self.name)<EOL>pass<EOL><DEDENT>return<EOL><DEDENT>subcmd_name = args[<NUM_LIT:2>]<EOL>if '<STR_LIT:*>' == subcmd_name:<EOL><INDENT>self.section("<STR_LIT>" % self.name)<EOL>self.msg(self.columnize_commands(self.cmds.list()))<EOL>return<EOL><DEDENT>cmd = self.cmds.lookup(subcmd_name)<EOL>if cmd:<EOL><INDENT>doc = cmd.__doc__ or cmd.run.__doc__<EOL>if doc:<EOL><INDENT>self.proc.rst_msg(doc.rstrip('<STR_LIT:\n>'))<EOL><DEDENT>else:<EOL><INDENT>self.proc.intf[-<NUM_LIT:1>].errmsg('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(subcmd_name, self.name))<EOL>pass<EOL><DEDENT><DEDENT>else:<EOL><INDENT>cmds = [c for c in self.cmds.list()<EOL>if re.match('<STR_LIT>' + subcmd_name, c) ]<EOL>if cmds == []:<EOL><INDENT>self.errmsg("<STR_LIT>"<EOL>"<STR_LIT>" % (self.name, subcmd_name))<EOL><DEDENT>else:<EOL><INDENT>self.section("<STR_LIT>" %<EOL>(self.name, subcmd_name,))<EOL>self.msg_nocr(self.columnize_commands(cmds))<EOL>pass<EOL><DEDENT>pass<EOL><DEDENT>return<EOL>
Give help for a command which has subcommands. This can be
        called in several ways:
            help cmd
            help cmd subcmd
            help cmd commands

        Our shtick is to give help for the overall command only if
        subcommand or 'commands' is not given. If a subcommand is given and
        found, then specific help for that is given. If 'commands' is given
        we will list the all the subcommands.