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'
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'
135
135
aliases_str += ', '.join(cmd.aliases)
136
136
aliases_str += '\n'
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"
138
return subsection_header + option_str + aliases_str + "\n" + doc + "\n"
198
Path where **%(bzrcmd)s** is to look for shell plugin external commands.
191
Path where **%(bzrcmd)s** is to look for external command.
201
194
E-Mail address of the user. Overrides default user config.
204
E-Mail address of the user. Overrides default user config.
197
E-Mail address of the user. Overriddes default user config.
207
200
Editor for editing commit messages
224
217
**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
219
Contains the default user config. At least one section, ``[DEFAULT]`` is required.
220
A typical default config file may be similiar to::
223
email=John Doe <jdoe@isp.com>