comparison tests/test-dispatch.t @ 13950:14d0553bd48b

help: do not show full help text for command on option errors Example $ hg clone --jump foo bar hg clone: option --jump not recognized hg clone [OPTION]... SOURCE [DEST] make a copy of an existing repository options: -U --noupdate the clone will include an empty working copy (only a repository) -u --updaterev REV revision, tag or branch to check out -r --rev REV [+] include the specified changeset -b --branch BRANCH [+] clone only the specified branch --pull use pull protocol to copy metadata --uncompressed use uncompressed transfer (fast over LAN) -e --ssh CMD specify ssh command to use --remotecmd CMD specify hg command to run on the remote side --insecure do not verify server certificate (ignoring web.cacerts config) [+] marked option can be specified multiple times use "hg help clone" to show the full help text Motivation for this change If the user already has specified the command, he probably already knows the command to some extent. Apparently, he has a problem with the options, so we show him just the synopsis with the short help and the details about the options, with a hint on the last line how to get the full help text. Why is Mercurial better with this change? Experts who just forgot about the details of an option don't get that much text thrown at them, while the newbies still get a hint on the last line how to get the full help text.
author Adrian Buehlmann <adrian@cadifra.com>
date Sun, 17 Apr 2011 11:37:11 +0200
parents 92e30e135581
children f85c9b0fdb32
comparison
equal deleted inserted replaced
13949:ba43aa1e173c 13950:14d0553bd48b
16 hg cat: invalid arguments 16 hg cat: invalid arguments
17 hg cat [OPTION]... FILE... 17 hg cat [OPTION]... FILE...
18 18
19 output the current or given revision of files 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 options: 21 options:
36 22
37 -o --output FORMAT print output to file with formatted name 23 -o --output FORMAT print output to file with formatted name
38 -r --rev REV print the given revision 24 -r --rev REV print the given revision
39 --decode apply any matching decode filter 25 --decode apply any matching decode filter
40 -I --include PATTERN [+] include names matching the given patterns 26 -I --include PATTERN [+] include names matching the given patterns
41 -X --exclude PATTERN [+] exclude names matching the given patterns 27 -X --exclude PATTERN [+] exclude names matching the given patterns
42 28
43 [+] marked option can be specified multiple times 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 [255] 32 [255]
47 33
48 [defaults] 34 [defaults]
49 35
50 $ hg cat a 36 $ hg cat a