def cmdHELP(self, params):
if params:<EOL><INDENT>cmd = params[<NUM_LIT:0>].upper()<EOL>if self.COMMANDS.has_key(cmd):<EOL><INDENT>method = self.COMMANDS[cmd]<EOL>doc = method.__doc__.split("<STR_LIT:\n>")<EOL>docp = doc[<NUM_LIT:0>].strip()<EOL>docl = '<STR_LIT:\n>'.join( [l.strip() for l in doc[<NUM_LIT:2>:]] )<EOL>if not docl.strip():  <EOL><INDENT>docl = doc[<NUM_LIT:1>].strip()<EOL><DEDENT>self.writeline(<EOL>"<STR_LIT>" % (<EOL>cmd,<EOL>docp,<EOL>docl,<EOL>)<EOL>)<EOL>return<EOL><DEDENT>else:<EOL><INDENT>self.writeline("<STR_LIT>" % cmd)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.writeline("<STR_LIT>")<EOL><DEDENT>keys = self.COMMANDS.keys()<EOL>keys.sort()<EOL>for cmd in keys:<EOL><INDENT>method = self.COMMANDS[cmd]<EOL>if getattr(method, '<STR_LIT>', False):<EOL><INDENT>continue<EOL><DEDENT>if method.__doc__ == None:<EOL><INDENT>self.writeline("<STR_LIT>" % method)<EOL>return<EOL><DEDENT>doc = method.__doc__.split("<STR_LIT:\n>")<EOL>docp = doc[<NUM_LIT:0>].strip()<EOL>docs = doc[<NUM_LIT:1>].strip()<EOL>if len(docp) > <NUM_LIT:0>:<EOL><INDENT>docps = "<STR_LIT>" % (docp, docs, )<EOL><DEDENT>else:<EOL><INDENT>docps = "<STR_LIT>" % (docs, )<EOL><DEDENT>self.writeline(<EOL>"<STR_LIT>" % (<EOL>cmd,<EOL>docps,<EOL>)<EOL>)<EOL><DEDENT>
[<command>]
        Display help
        Display either brief help on all commands, or detailed
        help on a single command passed as a parameter.