doc/gendoc.py
changeset 7376 fc06bd17c985
parent 7014 46456a51e247
child 8546 a33d19dcf906
equal deleted inserted replaced
7375:9f1370130a45 7376:fc06bd17c985
    34 def get_cmd(cmd):
    34 def get_cmd(cmd):
    35     d = {}
    35     d = {}
    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 
       
    46 
    53 
    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))
    50     def underlined(s, text=""):
    57     def underlined(s, text=""):