~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

Late bind to PatienceSequenceMatcher to allow plugin to override.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005 by Canonical Ltd
 
1
# Copyright (C) 2004, 2005, 2006 by Canonical Ltd
2
2
 
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
24
24
 
25
25
global_help = \
26
26
"""Bazaar-NG -- a free distributed version-control tool
27
 
http://bazaar-ng.org/
28
 
 
29
 
WARNING: This is an unstable development version.
30
 
         Please keep backups.
 
27
http://bazaar-vcs.org/
31
28
 
32
29
Basic commands:
33
30
 
113
110
    outfile.write(doc)
114
111
    if doc[-1] != '\n':
115
112
        outfile.write('\n')
116
 
    help_on_command_options(cmd_object, outfile=None)
 
113
    help_on_command_options(cmd_object, outfile)
117
114
 
118
115
 
119
116
def help_on_command_options(cmd, outfile=None):
131
128
        short_name = option.short_name()
132
129
        if short_name:
133
130
            assert len(short_name) == 1
134
 
            l += ', -' + shortname
 
131
            l += ', -' + short_name
135
132
        l += (30 - len(l)) * ' ' + option.help
136
133
        # TODO: split help over multiple lines with correct indenting and 
137
134
        # wrapping
162
159
        cmd_help = cmd_object.help()
163
160
        if cmd_help:
164
161
            firstline = cmd_help.split('\n', 1)[0]
165
 
            print >>outfile, '    ' + firstline
 
162
            print >>outfile, '        ' + firstline
166
163