~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

  • Committer: Robert Collins
  • Date: 2005-10-17 11:56:54 UTC
  • mfrom: (1185.16.59)
  • Revision ID: robertc@robertcollins.net-20051017115654-662239e1587524a8
mergeĀ fromĀ martin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
# executable files with reasonable names.
21
21
 
22
22
# TODO: `help commands --all` should show hidden commands
23
 
import textwrap
24
23
 
25
24
global_help = \
26
25
"""Bazaar-NG -- a free distributed version-control tool
113
112
    outfile.write(doc)
114
113
    if doc[-1] != '\n':
115
114
        outfile.write('\n')
116
 
    help_on_command_options(cmd_object, outfile)
 
115
    help_on_command_options(cmd_object, outfile=None)
117
116
 
118
117
 
119
118
def help_on_command_options(cmd, outfile=None):
131
130
        short_name = option.short_name()
132
131
        if short_name:
133
132
            assert len(short_name) == 1
134
 
            l += ', -' + short_name
 
133
            l += ', -' + shortname
135
134
        l += (30 - len(l)) * ' ' + option.help
136
135
        # TODO: split help over multiple lines with correct indenting and 
137
136
        # wrapping
138
 
        wrapped = textwrap.fill(l, initial_indent='', subsequent_indent=30*' ')
139
 
        outfile.write(wrapped + '\n')
 
137
        outfile.write(l + '\n')
140
138
 
141
139
 
142
140
def help_commands(outfile=None):