##// END OF EJS Templates
help: inline helper function used once only
Olav Reinert -
r16783:bb446969 default
parent child Browse files
Show More
@@ -3089,26 +3089,6 b' def help_(ui, name=None, unknowncmd=Fals'
3089
3089
3090 textwidth = min(ui.termwidth(), 80) - 2
3090 textwidth = min(ui.termwidth(), 80) - 2
3091
3091
3092 def addglobalopts(optlist):
3093 if ui.quiet:
3094 return []
3095
3096 if ui.verbose:
3097 optlist.append((_("global options:"), globalopts))
3098 if name == 'shortlist':
3099 optlist.append((_('use "hg help" for the full list '
3100 'of commands'), ()))
3101 else:
3102 if name == 'shortlist':
3103 msg = _('use "hg help" for the full list of commands '
3104 'or "hg -v" for details')
3105 elif name and not full:
3106 msg = _('use "hg help %s" to show the full help text') % name
3107 else:
3108 msg = _('use "hg -v help%s" to show builtin aliases and '
3109 'global options') % (name and " " + name or "")
3110 optlist.append((msg, ()))
3111
3112 def helpcmd(name):
3092 def helpcmd(name):
3113 try:
3093 try:
3114 aliases, entry = cmdutil.findcmd(name, table, strict=unknowncmd)
3094 aliases, entry = cmdutil.findcmd(name, table, strict=unknowncmd)
@@ -3251,7 +3231,24 b' def help_(ui, name=None, unknowncmd=Fals'
3251 ui.write(" %-*s %s\n" % (topics_len, t, desc))
3231 ui.write(" %-*s %s\n" % (topics_len, t, desc))
3252
3232
3253 optlist = []
3233 optlist = []
3254 addglobalopts(optlist)
3234 if not ui.quiet:
3235 if ui.verbose:
3236 optlist.append((_("global options:"), globalopts))
3237 if name == 'shortlist':
3238 optlist.append((_('use "hg help" for the full list '
3239 'of commands'), ()))
3240 else:
3241 if name == 'shortlist':
3242 msg = _('use "hg help" for the full list of commands '
3243 'or "hg -v" for details')
3244 elif name and not full:
3245 msg = _('use "hg help %s" to show the full help '
3246 'text') % name
3247 else:
3248 msg = _('use "hg -v help%s" to show builtin aliases and '
3249 'global options') % (name and " " + name or "")
3250 optlist.append((msg, ()))
3251
3255 ui.write(help.opttext(optlist, textwidth, ui.verbose))
3252 ui.write(help.opttext(optlist, textwidth, ui.verbose))
3256
3253
3257 def helptopic(name):
3254 def helptopic(name):
General Comments 0
You need to be logged in to leave comments. Login now