##// END OF EJS Templates
gendoc: fix indentation
Christian Ebert -
r6488:119dff2c default
parent child Browse files
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 f = c.split("|")[0]
62 f = c.split("|")[0]
63 f = f.lstrip("^")
63 f = f.lstrip("^")
64 h[f] = c
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 if f.startswith("debug"): continue
69 if f.startswith("debug"): continue
70 d = get_cmd(h[f])
70 d = get_cmd(h[f])
71 # synopsis
71 # synopsis
72 ui.write("%s::\n" % d['synopsis'].replace("hg ","", 1))
72 ui.write("%s::\n" % d['synopsis'].replace("hg ","", 1))
73 # description
73 # description
74 ui.write("%s\n\n" % d['desc'][1])
74 ui.write("%s\n\n" % d['desc'][1])
75 # options
75 # options
76 opt_output = list(d['opts'])
76 opt_output = list(d['opts'])
77 if opt_output:
77 if opt_output:
78 opts_len = max([len(line[0]) for line in opt_output])
78 opts_len = max([len(line[0]) for line in opt_output])
79 ui.write(_(" options:\n"))
79 ui.write(_(" options:\n"))
80 for optstr, desc in opt_output:
80 for optstr, desc in opt_output:
81 if desc:
81 if desc:
82 s = "%-*s %s" % (opts_len, optstr, desc)
82 s = "%-*s %s" % (opts_len, optstr, desc)
83 else:
83 else:
84 s = optstr
84 s = optstr
85 s = textwrap.fill(s, initial_indent=4 * " ",
85 s = textwrap.fill(s, initial_indent=4 * " ",
86 subsequent_indent=(6 + opts_len) * " ")
86 subsequent_indent=(6 + opts_len) * " ")
87 ui.write("%s\n" % s)
87 ui.write("%s\n" % s)
88 ui.write("\n")
88 ui.write("\n")
89 # aliases
89 # aliases
90 if d['aliases']:
90 if d['aliases']:
91 ui.write(_(" aliases: %s\n\n") % " ".join(d['aliases']))
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