9
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
11
# GNU General Public License for more details.
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
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
73
73
cmd_help = cmd_object.help()
75
75
firstline = cmd_help.split('\n', 1)[0]
76
usage = cmd_object._usage()
76
usage = bzrlib.help.command_usage(cmd_object)
77
77
tmp = '**%s**\n\t%s\n\n' % (usage, firstline)
78
78
output = output + tmp
98
98
def format_command (params, cmd, name):
99
99
"""Provides long help for each public command"""
100
usage = bzrlib.help.command_usage(cmd)
101
101
subsection_header = """
105
105
""" % (usage, '-'*len(usage))
107
docsplit = cmd.help().split('\n')
108
doc = '\n'.join([' '*4+line for line in docsplit])
107
docsplit = cmd.__doc__.split('\n')
108
doc = '\n'.join([' '*4 + docsplit[0]] + docsplit[1:])
111
111
options = cmd.options()
113
113
option_str = "\n Options:\n"
114
114
for option_name, option in sorted(options.items()):
115
for name, short_name, argname, help in option.iter_switches():
117
if argname is not None:
120
assert len(short_name) == 1
121
l += ', -' + short_name
122
l += (30 - len(l)) * ' ' + (help or '')
123
# TODO: Split help over multiple lines with
124
# correct indenting and wrapping.
125
wrapped = textwrap.fill(l, initial_indent='',
126
subsequent_indent=30*' ')
127
option_str = option_str + wrapped + '\n'
131
if len(cmd.aliases) > 1:
132
aliases_str += '\n Aliases: '
134
aliases_str += '\n Alias: '
135
aliases_str += ', '.join(cmd.aliases)
139
see_also = cmd.get_see_also()
141
see_also_str += '\n See also: '
142
see_also_str += ', '.join(see_also)
145
return subsection_header + option_str + aliases_str + see_also_str + "\n" + doc + "\n"
115
l = ' --' + option_name
116
if option.type is not None:
117
l += ' ' + option.argname.upper()
118
short_name = option.short_name()
120
assert len(short_name) == 1
121
l += ', -' + short_name
122
l += (30 - len(l)) * ' ' + option.help
123
# TODO: Split help over multiple lines with
124
# correct indenting and wrapping.
125
wrapped = textwrap.fill(l, initial_indent='',
126
subsequent_indent=30*' ')
127
option_str = option_str + wrapped + '\n'
128
return subsection_header + option_str + "\n" + doc + "\n"
155
138
.. Generation time: %(timestamp)s
157
140
=============================================
158
Man page for Bazaar (%(bzrcmd)s)
141
Man page for %(bzrcmd)s (bazaar-ng)
159
142
=============================================
161
144
:Date: %(datestamp)s
186
Bazaar (or **%(bzrcmd)s**) is a project of Canonical to develop
169
bazaar-ng (or **%(bzrcmd)s**) is a project of Canonical to develop
187
170
an open source distributed version control system that is powerful,
188
171
friendly, and scalable. Version control means a system
189
172
that keeps track of previous revisions of software source code
198
Path where **%(bzrcmd)s** is to look for shell plugin external commands.
181
Path where **%(bzrcmd)s** is to look for external command.
201
184
E-Mail address of the user. Overrides default user config.
204
E-Mail address of the user. Overrides default user config.
207
Editor for editing commit messages
210
Editor for editing commit messages
213
Paths where bzr should look for plugins
216
Home directory for bzr
187
E-Mail address of the user. Overriddes default user config.
222
**On Linux**: ``~/.bazaar/bazaar.conf``
192
**On Linux**: ``~/.bazaar/bazaar.conf/``
224
194
**On Windows**: ``C:\\Documents and Settings\\username\\Application Data\\bazaar\\2.0\\bazaar.conf``
226
Contains the user's default configuration. The section ``[DEFAULT]`` is
227
used to define general configuration that will be applied everywhere.
228
The section ``[ALIASES]`` can be used to create command aliases for
229
commonly used options.
231
A typical config file might look something like::
234
email=John Doe <jdoe@isp.com>
237
commit = commit --strict
238
log10 = log --short -r -10..-1
196
Contains the default user config. Only one section, ``[DEFAULT]`` is allowed.
197
A typical default config file may be similiar to::
200
email=John Doe <jdoe@isp.com>