def do_help(self, line):
"""help [COMMAND]
List available commands with no arguments, or detailed help when
a command is provided.
"""
# We provide a help function so that we can trim the leading spaces
# from the docstrings. The builtin help function doesn't do that.
if not line:
cmd.Cmd.do_help(self, line)
self.print("Use Control-D to exit rshell.")
return
parser = self.create_argparser(line)
if parser:
parser.print_help()
return
try:
doc = getattr(self, 'do_' + line).__doc__
if doc:
self.print("%s" % trim(doc))
return
except AttributeError:
pass
self.print(str(self.nohelp % (line,)))
评论列表
文章目录