34
bzr init makes this directory a versioned branch
35
bzr branch make a copy of another branch
37
bzr add make files or directories versioned
38
bzr ignore ignore a file or pattern
39
bzr mv move or rename a versioned file
41
bzr status summarize changes in working copy
42
bzr diff show detailed diffs
44
bzr merge pull in changes from another branch
45
bzr commit save some or all changes
47
bzr log show history of changes
48
bzr check validate storage
50
bzr help init more help on e.g. init command
51
bzr help commands list all commands
33
bzr init makes this branch versioned
34
bzr branch make a copy of another branch
36
bzr add make files or directories versioned
37
bzr ignore ignore a file or pattern
38
bzr mv move or rename a versioned file
40
bzr status summarize changes in working copy
41
bzr diff show detailed diffs
43
bzr merge pull in changes from another branch
44
bzr commit save some or all changes
46
bzr log show history of changes
47
bzr check validate storage
49
Use e.g. 'bzr help init' for more details, or
50
'bzr help commands' for all commands.
113
112
outfile.write(doc)
114
113
if doc[-1] != '\n':
115
114
outfile.write('\n')
116
help_on_command_options(cmd_object, outfile)
119
def help_on_command_options(cmd, outfile=None):
120
from bzrlib.option import Option
121
options = cmd.options()
116
help_on_options(cmd_object.takes_options, outfile=None)
119
def help_on_options(options, outfile=None):
120
from bzrlib.commands import SHORT_OPTIONS
124
125
if outfile == None:
125
126
outfile = sys.stdout
126
128
outfile.write('\noptions:\n')
127
for option_name, option in sorted(options.items()):
128
l = ' --' + option_name
129
if option.type is not None:
130
l += ' ' + option.argname.upper()
131
short_name = option.short_name()
133
assert len(short_name) == 1
134
l += ', -' + short_name
135
l += (30 - len(l)) * ' ' + option.help
136
# TODO: split help over multiple lines with correct indenting and
138
wrapped = textwrap.fill(l, initial_indent='', subsequent_indent=30*' ')
139
outfile.write(wrapped + '\n')
131
for shortname, longname in SHORT_OPTIONS.items():
133
l += ', -' + shortname
135
outfile.write(l + '\n')
142
138
def help_commands(outfile=None):