##// END OF EJS Templates
help: do not show full help text for command on option errors...
Adrian Buehlmann -
r13950:14d0553b default
parent child Browse files
Show More
@@ -2047,7 +2047,7 b' def heads(ui, repo, *branchrevs, **opts)'
2047 2047 displayer.show(ctx)
2048 2048 displayer.close()
2049 2049
2050 def help_(ui, name=None, with_version=False, unknowncmd=False):
2050 def help_(ui, name=None, with_version=False, unknowncmd=False, full=True):
2051 2051 """show help for a given topic or a help overview
2052 2052
2053 2053 With no arguments, print a list of commands with short help messages.
@@ -2070,6 +2070,8 b' def help_(ui, name=None, with_version=Fa'
2070 2070 if name == 'shortlist':
2071 2071 msg = _('use "hg help" for the full list of commands '
2072 2072 'or "hg -v" for details')
2073 elif name and not full:
2074 msg = _('use "hg help %s" to show the full help text' % name)
2073 2075 elif aliases:
2074 2076 msg = _('use "hg -v help%s" to show builtin aliases and '
2075 2077 'global options') % (name and " " + name or "")
@@ -2108,7 +2110,7 b' def help_(ui, name=None, with_version=Fa'
2108 2110 ui.write('hg %s\n' % aliases[0])
2109 2111
2110 2112 # aliases
2111 if not ui.quiet and len(aliases) > 1:
2113 if full and not ui.quiet and len(aliases) > 1:
2112 2114 ui.write(_("\naliases: %s\n") % ', '.join(aliases[1:]))
2113 2115
2114 2116 # description
@@ -2120,7 +2122,7 b' def help_(ui, name=None, with_version=Fa'
2120 2122 doc = _('shell alias for::\n\n %s') % entry[0].definition[1:]
2121 2123 else:
2122 2124 doc = _('alias for: hg %s\n\n%s') % (entry[0].definition, doc)
2123 if ui.quiet:
2125 if ui.quiet or not full:
2124 2126 doc = doc.splitlines()[0]
2125 2127 keep = ui.verbose and ['verbose'] or []
2126 2128 formatted, pruned = minirst.format(doc, textwidth, keep=keep)
@@ -90,7 +90,7 b' def _runcatch(ui, args):'
90 90 except error.CommandError, inst:
91 91 if inst.args[0]:
92 92 ui.warn(_("hg %s: %s\n") % (inst.args[0], inst.args[1]))
93 commands.help_(ui, inst.args[0])
93 commands.help_(ui, inst.args[0], full=False)
94 94 else:
95 95 ui.warn(_("hg: %s\n") % inst.args[1])
96 96 commands.help_(ui, 'shortlist')
@@ -304,13 +304,7 b' invalid arguments'
304 304
305 305 alias for: hg root
306 306
307 print the root (top) of the current working directory
308
309 Print the root directory of the current repository.
310
311 Returns 0 on success.
312
313 use "hg -v help rt" to show global options
307 use "hg help rt" to show the full help text
314 308 [255]
315 309
316 310 invalid global arguments for normal commands, aliases, and shell aliases
@@ -18,20 +18,6 b' Missing arg:'
18 18
19 19 output the current or given revision of files
20 20
21 Print the specified files as they were at the given revision. If no
22 revision is given, the parent of the working directory is used, or tip if
23 no revision is checked out.
24
25 Output may be to a file, in which case the name of the file is given using
26 a format string. The formatting rules are the same as for the export
27 command, with the following additions:
28
29 "%s" basename of file being printed
30 "%d" dirname of file being printed, or '.' if in repository root
31 "%p" root-relative path name of file being printed
32
33 Returns 0 on success.
34
35 21 options:
36 22
37 23 -o --output FORMAT print output to file with formatted name
@@ -42,7 +28,7 b' Missing arg:'
42 28
43 29 [+] marked option can be specified multiple times
44 30
45 use "hg -v help cat" to show global options
31 use "hg help cat" to show the full help text
46 32 [255]
47 33
48 34 [defaults]
@@ -387,17 +387,6 b' Test help option with version option'
387 387
388 388 add the specified files on the next commit
389 389
390 Schedule files to be version controlled and added to the repository.
391
392 The files will be added to the repository at the next commit. To undo an
393 add before that, see "hg forget".
394
395 If no names are given, add all files to the repository.
396
397 Returns 0 if all files are successfully added.
398
399 use "hg -v help add" to show verbose help
400
401 390 options:
402 391
403 392 -I --include PATTERN [+] include names matching the given patterns
@@ -407,7 +396,7 b' Test help option with version option'
407 396
408 397 [+] marked option can be specified multiple times
409 398
410 use "hg -v help add" to show global options
399 use "hg help add" to show the full help text
411 400 [255]
412 401
413 402 Test ambiguous command help
@@ -90,9 +90,7 b' qrecord (mq not present)'
90 90
91 91 interactively record a new patch
92 92
93 See "hg help qnew" & "hg help record" for more information and usage.
94
95 use "hg -v help qrecord" to show global options
93 use "hg help qrecord" to show the full help text
96 94 [255]
97 95
98 96 qrecord patch (mq not present)
General Comments 0
You need to be logged in to leave comments. Login now