~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/doc_generate/autodoc_man.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-06 06:48:25 UTC
  • mfrom: (4070.8.6 debug-config)
  • Revision ID: pqm@pqm.ubuntu.com-20090306064825-kbpwggw21dygeix6
(mbp) debug_flags configuration option

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""man.py - create man page from built-in bzr help and static text
18
18
 
92
92
def getcommand_help(params):
93
93
    """Shows individual options for a bzr command"""
94
94
    output='.SH "COMMAND REFERENCE"\n'
95
 
    formatted = {}
96
95
    for cmd_name in command_name_list():
97
96
        cmd_object = bzrlib.commands.get_cmd_object(cmd_name)
98
97
        if cmd_object.hidden:
99
98
            continue
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]
 
99
        output = output + format_command(params, cmd_object)
105
100
    return output
106
101
 
107
102
 
149
144
    return subsection_header + option_str + aliases_str + see_also_str + "\n" + doc + "\n"
150
145
 
151
146
 
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
 
 
158
147
man_preamble = """\
159
148
.\\\"Man page for Bazaar (%(bzrcmd)s)
160
149
.\\\"