Show More
@@ -59,36 +59,36 b' def show_doc(ui):' | |||||
59 | underlined(_("COMMANDS")) |
|
59 | underlined(_("COMMANDS")) | |
60 | h = {} |
|
60 | h = {} | |
61 | for c, attr in table.items(): |
|
61 | for c, attr in table.items(): | |
62 |
|
|
62 | f = c.split("|")[0] | |
63 |
|
|
63 | f = f.lstrip("^") | |
64 |
|
|
64 | h[f] = c | |
65 | cmds = h.keys() |
|
65 | cmds = h.keys() | |
66 | cmds.sort() |
|
66 | cmds.sort() | |
67 |
|
67 | |||
68 | for f in cmds: |
|
68 | for f in cmds: | |
69 |
|
|
69 | if f.startswith("debug"): continue | |
70 |
|
|
70 | d = get_cmd(h[f]) | |
71 |
|
|
71 | # synopsis | |
72 |
|
|
72 | ui.write("%s::\n" % d['synopsis'].replace("hg ","", 1)) | |
73 |
|
|
73 | # description | |
74 |
|
|
74 | ui.write("%s\n\n" % d['desc'][1]) | |
75 |
|
|
75 | # options | |
76 |
|
|
76 | opt_output = list(d['opts']) | |
77 |
|
|
77 | if opt_output: | |
78 |
|
|
78 | opts_len = max([len(line[0]) for line in opt_output]) | |
79 |
|
|
79 | ui.write(_(" options:\n")) | |
80 |
|
|
80 | for optstr, desc in opt_output: | |
81 |
|
|
81 | if desc: | |
82 |
|
|
82 | s = "%-*s %s" % (opts_len, optstr, desc) | |
83 |
|
|
83 | else: | |
84 |
|
|
84 | s = optstr | |
85 |
|
|
85 | s = textwrap.fill(s, initial_indent=4 * " ", | |
86 |
|
|
86 | subsequent_indent=(6 + opts_len) * " ") | |
87 |
|
|
87 | ui.write("%s\n" % s) | |
88 |
|
|
88 | ui.write("\n") | |
89 |
|
|
89 | # aliases | |
90 |
|
|
90 | if d['aliases']: | |
91 |
|
|
91 | ui.write(_(" aliases: %s\n\n") % " ".join(d['aliases'])) | |
92 |
|
92 | |||
93 | # print topics |
|
93 | # print topics | |
94 | for t in helptable: |
|
94 | for t in helptable: |
General Comments 0
You need to be logged in to leave comments.
Login now