##// END OF EJS Templates
Add a pointer to "hg -v help" to the bottom of hg help {,cmd} output...
Alexis S. L. Carvalho -
r4315:bc6f5a1d default
parent child Browse files
Show More
@@ -1268,6 +1268,23 b' def help_(ui, name=None, with_version=Fa'
1268 1268 commands it provides."""
1269 1269 option_lists = []
1270 1270
1271 def addglobalopts(aliases):
1272 if ui.verbose:
1273 option_lists.append((_("global options:"), globalopts))
1274 if name == 'shortlist':
1275 option_lists.append((_('use "hg help" for the full list '
1276 'of commands'), ()))
1277 else:
1278 if name == 'shortlist':
1279 msg = _('use "hg help" for the full list of commands '
1280 'or "hg -v" for details')
1281 elif aliases:
1282 msg = _('use "hg -v help%s" to show aliases and '
1283 'global options') % (name and " " + name or "")
1284 else:
1285 msg = _('use "hg -v help %s" to show global options') % name
1286 option_lists.append((msg, ()))
1287
1271 1288 def helpcmd(name):
1272 1289 if with_version:
1273 1290 version_(ui)
@@ -1291,7 +1308,9 b' def help_(ui, name=None, with_version=Fa'
1291 1308
1292 1309 # options
1293 1310 if i[1]:
1294 option_lists.append(("options", i[1]))
1311 option_lists.append((_("options:\n"), i[1]))
1312
1313 addglobalopts(False)
1295 1314
1296 1315 def helplist(select=None):
1297 1316 h = {}
@@ -1321,6 +1340,9 b' def help_(ui, name=None, with_version=Fa'
1321 1340 else:
1322 1341 ui.write(' %-*s %s\n' % (m, f, h[f]))
1323 1342
1343 if not ui.quiet:
1344 addglobalopts(True)
1345
1324 1346 def helptopic(name):
1325 1347 v = None
1326 1348 for i in help.helptable:
@@ -1360,12 +1382,7 b' def help_(ui, name=None, with_version=Fa'
1360 1382 ui.status(_('no commands defined\n'))
1361 1383 return
1362 1384
1363 if ui.verbose:
1364 ui.status(_('list of commands:\n\n'))
1365 else:
1366 ui.status(_('list of commands (use "hg help -v %s" '
1367 'to show aliases and global options):\n\n') % name)
1368
1385 ui.status(_('list of commands:\n\n'))
1369 1386 modcmds = dict.fromkeys([c.split('|', 1)[0] for c in ct])
1370 1387 helplist(modcmds.has_key)
1371 1388
@@ -1391,24 +1408,16 b' def help_(ui, name=None, with_version=Fa'
1391 1408
1392 1409 # list of commands
1393 1410 if name == "shortlist":
1394 ui.status(_('basic commands (use "hg help" '
1395 'for the full list or option "-v" for details):\n\n'))
1396 elif ui.verbose:
1411 ui.status(_('basic commands:\n\n'))
1412 else:
1397 1413 ui.status(_('list of commands:\n\n'))
1398 else:
1399 ui.status(_('list of commands (use "hg help -v" '
1400 'to show aliases and global options):\n\n'))
1401 1414
1402 1415 helplist()
1403 1416
1404 # global options
1405 if ui.verbose:
1406 option_lists.append(("global options", globalopts))
1407
1408 1417 # list all option lists
1409 1418 opt_output = []
1410 1419 for title, options in option_lists:
1411 opt_output.append(("\n%s:\n" % title, None))
1420 opt_output.append(("\n%s" % title, None))
1412 1421 for shortopt, longopt, default, desc in options:
1413 1422 if "DEPRECATED" in desc and not ui.verbose: continue
1414 1423 opt_output.append(("%2s%s" % (shortopt and "-%s" % shortopt,
@@ -1419,7 +1428,7 b' def help_(ui, name=None, with_version=Fa'
1419 1428 or "")))
1420 1429
1421 1430 if opt_output:
1422 opts_len = max([len(line[0]) for line in opt_output if line[1]])
1431 opts_len = max([len(line[0]) for line in opt_output if line[1]] or [0])
1423 1432 for first, second in opt_output:
1424 1433 if second:
1425 1434 ui.write(" %-*s %s\n" % (opts_len, first, second))
@@ -24,6 +24,8 b' options:'
24 24 -r --rev revision
25 25 -I --include include names matching the given patterns
26 26 -X --exclude exclude names matching the given patterns
27
28 use "hg -v help falabala" to show global options
27 29 making snapshot of 1 files from rev e27a2475d60a
28 30 making snapshot of 1 files from rev 5e49ec8d3f05
29 31 diffing a.e27a2475d60a a.5e49ec8d3f05
@@ -117,7 +117,7 b' Mercurial Distributed SCM (version xxx)'
117 117 %% -h/--help
118 118 Mercurial Distributed SCM
119 119
120 list of commands (use "hg help -v" to show aliases and global options):
120 list of commands:
121 121
122 122 add add the specified files on the next commit
123 123 addremove add all new files, delete all missing files
@@ -165,9 +165,11 b' list of commands (use "hg help -v" to sh'
165 165 update update working directory
166 166 verify verify the integrity of the repository
167 167 version output version and copyright information
168
169 use "hg -v help" to show aliases and global options
168 170 Mercurial Distributed SCM
169 171
170 list of commands (use "hg help -v" to show aliases and global options):
172 list of commands:
171 173
172 174 add add the specified files on the next commit
173 175 addremove add all new files, delete all missing files
@@ -215,4 +217,6 b' list of commands (use "hg help -v" to sh'
215 217 update update working directory
216 218 verify verify the integrity of the repository
217 219 version output version and copyright information
220
221 use "hg -v help" to show aliases and global options
218 222 %% not tested: --debugger
@@ -1,6 +1,6 b''
1 1 Mercurial Distributed SCM
2 2
3 basic commands (use "hg help" for the full list or option "-v" for details):
3 basic commands:
4 4
5 5 add add the specified files on the next commit
6 6 annotate show changeset information per file line
@@ -19,6 +19,8 b' basic commands (use "hg help" for the fu'
19 19 serve export the repository via HTTP
20 20 status show changed files in the working directory
21 21 update update working directory
22
23 use "hg help" for the full list of commands or "hg -v" for details
22 24 add add the specified files on the next commit
23 25 annotate show changeset information per file line
24 26 clone make a copy of an existing repository
@@ -38,7 +40,7 b' basic commands (use "hg help" for the fu'
38 40 update update working directory
39 41 Mercurial Distributed SCM
40 42
41 list of commands (use "hg help -v" to show aliases and global options):
43 list of commands:
42 44
43 45 add add the specified files on the next commit
44 46 addremove add all new files, delete all missing files
@@ -86,6 +88,8 b' list of commands (use "hg help -v" to sh'
86 88 update update working directory
87 89 verify verify the integrity of the repository
88 90 version output version and copyright information
91
92 use "hg -v help" to show aliases and global options
89 93 add add the specified files on the next commit
90 94 addremove add all new files, delete all missing files
91 95 annotate show changeset information per file line
@@ -148,6 +152,8 b' options:'
148 152 -I --include include names matching the given patterns
149 153 -X --exclude exclude names matching the given patterns
150 154 -n --dry-run do not perform actions, just print output
155
156 use "hg -v help add" to show global options
151 157 hg add: option --skjdfks not recognized
152 158 hg add [OPTION]... [FILE]...
153 159
@@ -165,6 +171,8 b' options:'
165 171 -I --include include names matching the given patterns
166 172 -X --exclude exclude names matching the given patterns
167 173 -n --dry-run do not perform actions, just print output
174
175 use "hg -v help add" to show global options
168 176 hg diff [OPTION]... [-r REV1 [-r REV2]] [FILE]...
169 177
170 178 diff repository (or selected files)
@@ -199,6 +207,8 b' options:'
199 207 -B --ignore-blank-lines ignore changes whose lines are all blank
200 208 -I --include include names matching the given patterns
201 209 -X --exclude exclude names matching the given patterns
210
211 use "hg -v help diff" to show global options
202 212 hg status [OPTION]... [FILE]...
203 213
204 214 show changed files in the working directory
@@ -243,13 +253,15 b' options:'
243 253 --rev show difference from revision
244 254 -I --include include names matching the given patterns
245 255 -X --exclude exclude names matching the given patterns
256
257 use "hg -v help status" to show global options
246 258 hg status [OPTION]... [FILE]...
247 259
248 260 show changed files in the working directory
249 261 hg: unknown command 'foo'
250 262 Mercurial Distributed SCM
251 263
252 basic commands (use "hg help" for the full list or option "-v" for details):
264 basic commands:
253 265
254 266 add add the specified files on the next commit
255 267 annotate show changeset information per file line
@@ -268,10 +280,12 b' basic commands (use "hg help" for the fu'
268 280 serve export the repository via HTTP
269 281 status show changed files in the working directory
270 282 update update working directory
283
284 use "hg help" for the full list of commands or "hg -v" for details
271 285 hg: unknown command 'skjdfks'
272 286 Mercurial Distributed SCM
273 287
274 basic commands (use "hg help" for the full list or option "-v" for details):
288 basic commands:
275 289
276 290 add add the specified files on the next commit
277 291 annotate show changeset information per file line
@@ -290,3 +304,5 b' basic commands (use "hg help" for the fu'
290 304 serve export the repository via HTTP
291 305 status show changed files in the working directory
292 306 update update working directory
307
308 use "hg help" for the full list of commands or "hg -v" for details
@@ -22,7 +22,7 b' add known patch to applied stack '
22 22 remove patch from applied stack qpop
23 23 refresh contents of top applied patch qrefresh
24 24
25 list of commands (use "hg help -v mq" to show aliases and global options):
25 list of commands:
26 26
27 27 qapplied print the patches already applied
28 28 qclone clone main and patch repository at same time
@@ -48,6 +48,8 b' list of commands (use "hg help -v mq" to'
48 48 qtop print the name of the current patch
49 49 qunapplied print the patches not yet applied
50 50 strip strip a revision and all later revs on the same branch
51
52 use "hg -v help mq" to show aliases and global options
51 53 adding a
52 54 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 55 adding b/z
@@ -3,7 +3,7 b' 0: a'
3 3 hg: unknown command 'an'
4 4 Mercurial Distributed SCM
5 5
6 basic commands (use "hg help" for the full list or option "-v" for details):
6 basic commands:
7 7
8 8 add add the specified files on the next commit
9 9 annotate show changeset information per file line
@@ -22,6 +22,8 b' basic commands (use "hg help" for the fu'
22 22 serve export the repository via HTTP
23 23 status show changed files in the working directory
24 24 update update working directory
25
26 use "hg help" for the full list of commands or "hg -v" for details
25 27 0: a
26 28 % should succeed - up is an alias, not an abbreviation
27 29 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
General Comments 0
You need to be logged in to leave comments. Login now