Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 7196:3f6a4f1de43f
help: show help topics by default in 'hg help', with longest available id
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Tue, 21 Oct 2008 11:05:45 +0200 |
parents | 67ba74938b15 |
children | f60730693efc |
comparison
equal
deleted
inserted
replaced
7195:9fabcb1fe68d | 7196:3f6a4f1de43f |
---|---|
1430 "%s%s" % (desc, | 1430 "%s%s" % (desc, |
1431 default | 1431 default |
1432 and _(" (default: %s)") % default | 1432 and _(" (default: %s)") % default |
1433 or ""))) | 1433 or ""))) |
1434 | 1434 |
1435 if ui.verbose: | 1435 if not name: |
1436 ui.write(_("\nspecial help topics:\n")) | 1436 ui.write(_("\nspecial help topics:\n\n")) |
1437 topics = [] | 1437 topics = [] |
1438 for names, header, doc in help.helptable: | 1438 for names, header, doc in help.helptable: |
1439 topics.append((", ".join(names), header)) | 1439 names = [(-len(name), name) for name in names] |
1440 names.sort() | |
1441 topics.append((names[0][1], header)) | |
1440 topics_len = max([len(s[0]) for s in topics]) | 1442 topics_len = max([len(s[0]) for s in topics]) |
1441 for t, desc in topics: | 1443 for t, desc in topics: |
1442 ui.write(" %-*s %s\n" % (topics_len, t, desc)) | 1444 ui.write(" %-*s %s\n" % (topics_len, t, desc)) |
1443 | 1445 |
1444 if opt_output: | 1446 if opt_output: |