/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/shellcomplete.py

  • Committer: Jelmer Vernooij
  • Date: 2018-05-06 11:48:54 UTC
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180506114854-h4qd9ojaqy8wxjsd
Move .mailmap to root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import sys
20
20
 
21
21
 
22
 
def shellcomplete(context=None, outfile=None):
 
22
def shellcomplete(context=None, outfile = None):
23
23
    if outfile is None:
24
24
        outfile = sys.stdout
25
25
    if context is None:
26
 
        shellcomplete_commands(outfile=outfile)
 
26
        shellcomplete_commands(outfile = outfile)
27
27
    else:
28
 
        shellcomplete_on_command(context, outfile=outfile)
 
28
        shellcomplete_on_command(context, outfile = outfile)
29
29
 
30
30
 
31
31
def shellcomplete_on_command(cmdname, outfile=None):
40
40
 
41
41
    doc = getdoc(cmdobj)
42
42
    if doc is None:
43
 
        raise NotImplementedError(
44
 
            "sorry, no detailed shellcomplete yet for %r" % cmdname)
 
43
        raise NotImplementedError("sorry, no detailed shellcomplete yet for %r" % cmdname)
45
44
 
46
45
    shellcomplete_on_options(cmdobj.options().values(), outfile=outfile)
47
46
    for aname in cmdobj.takes_args:
53
52
        short_name = opt.short_name()
54
53
        if short_name:
55
54
            outfile.write('"(--%s -%s)"{--%s,-%s}\n'
56
 
                          % (opt.name, short_name, opt.name, short_name))
 
55
                    % (opt.name, short_name, opt.name, short_name))
57
56
        else:
58
57
            outfile.write('--%s\n' % opt.name)
59
58