def helptopic(name): for names, header, doc in helptable: if name in names: break else: raise error.UnknownCommand(name) rst = [minirst.section(header)] # description if not doc: rst.append(" %s\n" % _("(no help text available)")) if callable(doc): rst += [" %s\n" % l for l in doc().splitlines()] if not ui.verbose: omitted = _('(some details hidden, use --verbose' ' to show complete help)') indicateomitted(rst, omitted) try: cmdutil.findcmd(name, commands.table) rst.append(_('\nuse "hg help -c %s" to see help for ' 'the %s command\n') % (name, name)) except error.UnknownCommand: pass return rst
def helptopic(name): for names, header, doc in helptable: if name in names: break else: raise error.UnknownCommand(name) rst = [minirst.section(header)] # description if not doc: rst.append(" %s\n" % _("(no help text available)")) if util.safehasattr(doc, '__call__'): rst += [" %s\n" % l for l in doc().splitlines()] if not ui.verbose: omitted = (_('use "hg help -v %s" to show more complete help') % name) indicateomitted(rst, omitted) try: cmdutil.findcmd(name, commands.table) rst.append(_('\nuse "hg help -c %s" to see help for ' 'the %s command\n') % (name, name)) except error.UnknownCommand: pass return rst
def helptopic(name): for names, header, doc in helptable: if name in names: break else: raise error.UnknownCommand(name) rst = [minirst.section(header)] # description if not doc: rst.append(" %s\n" % _("(no help text available)")) if util.safehasattr(doc, '__call__'): rst += [" %s\n" % l for l in doc().splitlines()] if not ui.verbose: omitted = (_('use "hg help -v %s" to show more complete help') % name) indicateomitted(rst, omitted) try: cmdutil.findcmd(name, commands.table) rst.append( _('\nuse "hg help -c %s" to see help for ' 'the %s command\n') % (name, name)) except error.UnknownCommand: pass return rst