##// END OF EJS Templates
doc: handle shortened command synopses
Matt Mackall -
r7376:fc06bd17 default
parent child Browse files
Show More
@@ -36,14 +36,21 b' def get_cmd(cmd):'
36 attr = table[cmd]
36 attr = table[cmd]
37 cmds = cmd.lstrip("^").split("|")
37 cmds = cmd.lstrip("^").split("|")
38
38
39 d['synopsis'] = attr[2]
40 d['cmd'] = cmds[0]
39 d['cmd'] = cmds[0]
41 d['aliases'] = cmd.split("|")[1:]
40 d['aliases'] = cmd.split("|")[1:]
42 d['desc'] = get_desc(attr[0].__doc__)
41 d['desc'] = get_desc(attr[0].__doc__)
43 d['opts'] = list(get_opts(attr[1]))
42 d['opts'] = list(get_opts(attr[1]))
43
44 s = 'hg ' + cmds[0]
45 if len(attr) > 2:
46 if not attr[2].startswith('hg'):
47 s += attr[2]
48 else:
49 s = attr[2]
50 d['synopsis'] = s
51
44 return d
52 return d
45
53
46
47 def show_doc(ui):
54 def show_doc(ui):
48 def bold(s, text=""):
55 def bold(s, text=""):
49 ui.write("%s\n%s\n%s\n" % (s, "="*len(s), text))
56 ui.write("%s\n%s\n%s\n" % (s, "="*len(s), text))
General Comments 0
You need to be logged in to leave comments. Login now