/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/doc_generate/autodoc_man.py

  • Committer: Jelmer Vernooij
  • Date: 2020-05-06 02:13:25 UTC
  • mfrom: (7490.7.21 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200506021325-awbmmqu1zyorz7sj
Merge 3.1 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
  * add command aliases
22
22
"""
23
23
 
24
 
from __future__ import absolute_import
25
 
 
26
24
PLUGINS_TO_DOCUMENT = ["launchpad"]
27
25
 
28
26
import textwrap
46
44
    """Assembles a man page"""
47
45
    d = get_autodoc_datetime()
48
46
    params = \
49
 
           { "brzcmd": options.brz_name,
50
 
             "datestamp": d.strftime("%Y-%m-%d"),
51
 
             "timestamp": d.strftime("%Y-%m-%d %H:%M:%S +0000"),
52
 
             "version": breezy.__version__,
53
 
             }
 
47
        {"brzcmd": options.brz_name,
 
48
         "datestamp": d.strftime("%Y-%m-%d"),
 
49
         "timestamp": d.strftime("%Y-%m-%d %H:%M:%S +0000"),
 
50
         "version": breezy.__version__,
 
51
         }
54
52
    outfile.write(man_preamble % params)
55
53
    outfile.write(man_escape(man_head % params))
56
54
    outfile.write(man_escape(getcommand_list(params)))
74
72
    for cmdname in breezy.commands.plugin_command_names():
75
73
        cmd_object = breezy.commands.get_cmd_object(cmdname)
76
74
        if (PLUGINS_TO_DOCUMENT is None or
77
 
            cmd_object.plugin_name() in PLUGINS_TO_DOCUMENT):
 
75
                cmd_object.plugin_name() in PLUGINS_TO_DOCUMENT):
78
76
            command_names.append(cmdname)
79
77
    command_names.sort()
80
78
    return command_names
81
79
 
82
80
 
83
 
def getcommand_list (params):
 
81
def getcommand_list(params):
84
82
    """Builds summary help for command names in manpage format"""
85
83
    brzcmd = params["brzcmd"]
86
84
    output = '.SH "COMMAND OVERVIEW"\n'
101
99
 
102
100
def getcommand_help(params):
103
101
    """Shows individual options for a brz command"""
104
 
    output='.SH "COMMAND REFERENCE"\n'
 
102
    output = '.SH "COMMAND REFERENCE"\n'
105
103
    formatted = {}
106
104
    for cmd_name in command_name_list():
107
105
        cmd_object = breezy.commands.get_cmd_object(cmd_name)
141
139
                    l += ', -' + short_name
142
140
                l += (30 - len(l)) * ' ' + (help or '')
143
141
                wrapped = textwrap.fill(l, initial_indent='',
144
 
                    subsequent_indent=30*' ',
145
 
                    break_long_words=False,
146
 
                    )
 
142
                                        subsequent_indent=30 * ' ',
 
143
                                        break_long_words=False,
 
144
                                        )
147
145
                option_str += wrapped + '\n'
148
146
 
149
147
    aliases_str = ""
249
247
.UR https://www.breezy-vcs.org/
250
248
.BR https://www.breezy-vcs.org/
251
249
"""
252