~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/doc_generate/autodoc_man.py

(jelmer) Document launchpad commands in bzr(1) manpage. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
from __future__ import absolute_import
25
25
 
 
26
PLUGINS_TO_DOCUMENT = ["launchpad"]
 
27
 
26
28
import textwrap
27
29
import time
28
30
 
31
33
import bzrlib.help_topics
32
34
import bzrlib.commands
33
35
 
 
36
from bzrlib.plugin import load_plugins
 
37
load_plugins()
 
38
 
34
39
 
35
40
def get_filename(options):
36
41
    """Provides name of manpage"""
66
71
def command_name_list():
67
72
    """Builds a list of command names from bzrlib"""
68
73
    command_names = bzrlib.commands.builtin_command_names()
 
74
    for cmdname in bzrlib.commands.plugin_command_names():
 
75
        cmd_object = bzrlib.commands.get_cmd_object(cmdname)
 
76
        if (PLUGINS_TO_DOCUMENT is None or
 
77
            cmd_object.plugin_name() in PLUGINS_TO_DOCUMENT):
 
78
            command_names.append(cmdname)
69
79
    command_names.sort()
70
80
    return command_names
71
81
 
105
115
    return output
106
116
 
107
117
 
108
 
def format_command (params, cmd):
 
118
def format_command(params, cmd):
109
119
    """Provides long help for each public command"""
110
120
    subsection_header = '.SS "%s"\n' % (cmd._usage())
111
121
    doc = "%s\n" % (cmd.__doc__)
134
144
                    subsequent_indent=30*' ',
135
145
                    break_long_words=False,
136
146
                    )
137
 
                option_str = option_str + wrapped + '\n'       
 
147
                option_str += wrapped + '\n'
138
148
 
139
149
    aliases_str = ""
140
150
    if cmd.aliases: