~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

[patch] define cli options as objects, not strings
  patch from Magnus Thering

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
 
118
118
 
119
119
def help_on_options(options, outfile=None):
120
 
    from bzrlib.commands import SHORT_OPTIONS
 
120
    from bzrlib.option import Option
121
121
    
122
122
    if not options:
123
123
        return
128
128
    outfile.write('\noptions:\n')
129
129
    for on in options:
130
130
        l = '    --' + on
131
 
        for shortname, longname in SHORT_OPTIONS.items():
132
 
            if longname == on:
 
131
        for shortname, longopt in Option.SHORT_OPTIONS.items():
 
132
            if longopt.name == on:
133
133
                l += ', -' + shortname
134
134
                break
 
135
        l += (30 - len(l)) * ' ' + Option.OPTIONS[on].help
135
136
        outfile.write(l + '\n')
136
137
 
137
138