~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/shellcomplete.py

  • Committer: Robert Collins
  • Date: 2005-10-08 00:32:39 UTC
  • mfrom: (1185.13.4)
  • mto: This revision was merged to the branch mainline in revision 1422.
  • Revision ID: robertc@robertcollins.net-20051008003239-b4e2f1ad62bbe3f6
merge in reweave support

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
        outfile.write(aname + '\n')
29
29
 
30
30
 
31
 
def shellcomplete_on_option(options, outfile=None):
32
 
    from bzrlib.option import Option
 
31
def shellcomplete_on_option(options, outfile = None):
 
32
    import commands
 
33
    
33
34
    if not options:
34
35
        return
 
36
    
35
37
    if outfile == None:
36
38
        outfile = sys.stdout
 
39
 
37
40
    for on in options:
38
 
        for shortname, longname in Option.SHORT_OPTIONS.items():
 
41
        for shortname, longname in commands.SHORT_OPTIONS.items():
39
42
            if longname == on:
40
43
                l = '"(--' + on + ' -' + shortname + ')"{--' + on + ',-' + shortname + '}'
41
44
                break