~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

- refactor handling of short option names

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
    outfile.write('\noptions:\n')
126
126
    for option_name, option in sorted(options.items()):
127
127
        l = '    --' + option_name
128
 
        for shortname, longopt in Option.SHORT_OPTIONS.items():
129
 
            if longopt.name == option_name:
130
 
                l += ', -' + shortname
131
 
                break
 
128
        short_name = option.short_name()
 
129
        if short_name:
 
130
            assert len(short_name) == 1
 
131
            l += ', -' + shortname
132
132
        l += (30 - len(l)) * ' ' + option.help
 
133
        # TODO: split help over multiple lines with correct indenting and 
 
134
        # wrapping
133
135
        outfile.write(l + '\n')
134
136
 
135
137