comparison mercurial/commands.py @ 7197:f60730693efc

help: show extension commands in short list, separate extension list in help In 'hg', we now show a short list of commands, including extension commands. In 'hg help', we show core commands, a list of enabled extensions, and topics.
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Tue, 21 Oct 2008 11:29:27 +0200
parents 3f6a4f1de43f
children 833d1250ce00
comparison
equal deleted inserted replaced
7196:3f6a4f1de43f 7197:f60730693efc
1308 cmds = {} 1308 cmds = {}
1309 for c, e in table.items(): 1309 for c, e in table.items():
1310 f = c.split("|", 1)[0] 1310 f = c.split("|", 1)[0]
1311 if select and not select(f): 1311 if select and not select(f):
1312 continue 1312 continue
1313 if select is None and e[0].__module__ != __name__: 1313 if (not select and name != 'shortlist' and
1314 e[0].__module__ != __name__):
1314 continue 1315 continue
1315 if name == "shortlist" and not f.startswith("^"): 1316 if name == "shortlist" and not f.startswith("^"):
1316 continue 1317 continue
1317 f = f.lstrip("^") 1318 f = f.lstrip("^")
1318 if not ui.debugflag and f.startswith("debug"): 1319 if not ui.debugflag and f.startswith("debug"):
1336 ui.write(" %s:\n %s\n"%(commands, h[f])) 1337 ui.write(" %s:\n %s\n"%(commands, h[f]))
1337 else: 1338 else:
1338 ui.write(' %-*s %s\n' % (m, f, h[f])) 1339 ui.write(' %-*s %s\n' % (m, f, h[f]))
1339 1340
1340 exts = list(extensions.extensions()) 1341 exts = list(extensions.extensions())
1341 if exts: 1342 if exts and name != 'shortlist':
1342 ui.write(_('\nenabled extensions:\n\n')) 1343 ui.write(_('\nenabled extensions:\n\n'))
1343 maxlength = 0 1344 maxlength = 0
1344 exthelps = [] 1345 exthelps = []
1345 for ename, ext in exts: 1346 for ename, ext in exts:
1346 doc = (ext.__doc__ or _('(no help text available)')) 1347 doc = (ext.__doc__ or _('(no help text available)'))