equal
deleted
inserted
replaced
60 ui.write("%s\n%s\n%s\n" % (s, "-"*len(s), text)) |
60 ui.write("%s\n%s\n%s\n" % (s, "-"*len(s), text)) |
61 |
61 |
62 # print options |
62 # print options |
63 underlined(_("OPTIONS")) |
63 underlined(_("OPTIONS")) |
64 for optstr, desc in get_opts(globalopts): |
64 for optstr, desc in get_opts(globalopts): |
65 ui.write("%s::\n %s\n\n" % (optstr, desc)) |
65 ui.write("%s\n %s\n\n" % (optstr, desc)) |
66 |
66 |
67 # print cmds |
67 # print cmds |
68 underlined(_("COMMANDS")) |
68 underlined(_("COMMANDS")) |
69 h = {} |
69 h = {} |
70 for c, attr in table.items(): |
70 for c, attr in table.items(): |
76 |
76 |
77 for f in cmds: |
77 for f in cmds: |
78 if f.startswith("debug"): continue |
78 if f.startswith("debug"): continue |
79 d = get_cmd(h[f]) |
79 d = get_cmd(h[f]) |
80 # synopsis |
80 # synopsis |
81 ui.write("[[%s]]\n" % d['cmd']) |
81 ui.write(".. _%s:\n\n" % d['cmd']) |
82 ui.write("%s::\n" % d['synopsis'].replace("hg ","", 1)) |
82 ui.write("``%s``\n" % d['synopsis'].replace("hg ","", 1)) |
83 # description |
83 # description |
84 ui.write("%s\n\n" % d['desc'][1]) |
84 ui.write("%s\n\n" % d['desc'][1]) |
85 # options |
85 # options |
86 opt_output = list(d['opts']) |
86 opt_output = list(d['opts']) |
87 if opt_output: |
87 if opt_output: |
88 opts_len = max([len(line[0]) for line in opt_output]) |
88 opts_len = max([len(line[0]) for line in opt_output]) |
89 ui.write(_(" options:\n")) |
89 ui.write(_(" options:\n\n")) |
90 for optstr, desc in opt_output: |
90 for optstr, desc in opt_output: |
91 if desc: |
91 if desc: |
92 s = "%-*s %s" % (opts_len, optstr, desc) |
92 s = "%-*s %s" % (opts_len, optstr, desc) |
93 else: |
93 else: |
94 s = optstr |
94 s = optstr |