~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/doc_generate/autodoc_man.py

  • Committer: Robert Collins
  • Date: 2007-07-04 08:08:13 UTC
  • mfrom: (2572 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2587.
  • Revision ID: robertc@robertcollins.net-20070704080813-wzebx0r88fvwj5rq
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
        cmd_help = cmd_object.help()
81
81
        if cmd_help:
82
82
            firstline = cmd_help.split('\n', 1)[0]
83
 
            usage = bzrlib.help.command_usage(cmd_object)
 
83
            usage = cmd_object._usage()
84
84
            tmp = '.TP\n.B "%s"\n%s\n' % (usage, firstline)
85
85
            output = output + tmp
86
86
        else:
101
101
 
102
102
def format_command (params, cmd):
103
103
    """Provides long help for each public command"""
104
 
    subsection_header = '.SS "%s"\n' % (bzrlib.help.command_usage(cmd))
 
104
    subsection_header = '.SS "%s"\n' % (cmd._usage())
105
105
    doc = "%s\n" % (cmd.__doc__)
106
106
    doc = cmd.help()
107
107
 
117
117
                if short_name:
118
118
                    assert len(short_name) == 1
119
119
                    l += ', -' + short_name
120
 
                l += (30 - len(l)) * ' ' + help
121
 
                # TODO: Split help over multiple lines with
122
 
                # correct indenting and wrapping.
 
120
                l += (30 - len(l)) * ' ' + (help or '')
123
121
                wrapped = textwrap.fill(l, initial_indent='',
124
122
                                        subsequent_indent=30*' ')
125
123
                option_str = option_str + wrapped + '\n'       
133
131
        aliases_str += ', '.join(cmd.aliases)
134
132
        aliases_str += '\n'
135
133
 
136
 
    return subsection_header + option_str + aliases_str + "\n" + doc + "\n"
 
134
    see_also_str = ""
 
135
    see_also = cmd.get_see_also()
 
136
    if see_also:
 
137
        see_also_str += '\nSee also: '
 
138
        see_also_str += ', '.join(see_also)
 
139
        see_also_str += '\n'
 
140
 
 
141
    return subsection_header + option_str + aliases_str + see_also_str + "\n" + doc + "\n"
137
142
 
138
143
 
139
144
man_preamble = """\
178
183
.I "BZRPATH"
179
184
Path where
180
185
.B "%(bzrcmd)s"
181
 
is to look for external command.
 
186
is to look for shell plugin external commands.
182
187
.TP
183
188
.I "BZR_EMAIL"
184
189
E-Mail address of the user. Overrides default user config.
185
190
.TP
186
191
.I "EMAIL"
187
 
E-Mail address of the user. Overriddes default user config.
 
192
E-Mail address of the user. Overrides default user config.
188
193
.TP
189
194
.I "BZR_EDITOR"
190
195
Editor for editing commit messages
200
205
.SH "FILES"
201
206
.TP
202
207
.I "~/.bazaar/bazaar.conf"
203
 
Contains the users default configuration. The section
 
208
Contains the user's default configuration. The section
204
209
.B [DEFAULT]
205
210
is used to define general configuration that will be applied everywhere.
206
211
The section