~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/doc_generate/autodoc_man.py

  • Committer: James Westby
  • Date: 2009-03-10 06:56:54 UTC
  • mfrom: (4056.4.2 bzr.dev)
  • mto: This revision was merged to the branch mainline in revision 4107.
  • Revision ID: james.westby@canonical.com-20090310065654-ujpwv21yv1t5wf0v
Explicitly list aliases as commands that can be run in the man page.

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
def getcommand_help(params):
93
93
    """Shows individual options for a bzr command"""
94
94
    output='.SH "COMMAND REFERENCE"\n'
 
95
    formatted = {}
95
96
    for cmd_name in command_name_list():
96
97
        cmd_object = bzrlib.commands.get_cmd_object(cmd_name)
97
98
        if cmd_object.hidden:
98
99
            continue
99
 
        output = output + format_command(params, cmd_object)
 
100
        formatted[cmd_name] = format_command(params, cmd_object)
 
101
        for alias in cmd_object.aliases:
 
102
            formatted[alias] = format_alias(params, alias, cmd_name)
 
103
    for cmd_name in sorted(formatted):
 
104
        output += formatted[cmd_name]
100
105
    return output
101
106
 
102
107
 
144
149
    return subsection_header + option_str + aliases_str + see_also_str + "\n" + doc + "\n"
145
150
 
146
151
 
 
152
def format_alias(params, alias, cmd_name):
 
153
    help = '.SS "bzr %s"\n' % alias
 
154
    help += 'Alias for "%s", see "bzr %s".\n' % (cmd_name, cmd_name)
 
155
    return help
 
156
 
 
157
 
147
158
man_preamble = """\
148
159
.\\\"Man page for Bazaar (%(bzrcmd)s)
149
160
.\\\"