~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to __init__.py

Import modules, not classes or functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
from meta import *
25
25
from meta import __version__
26
26
 
27
 
from bzrlib.commands import Command, register_command
28
 
from bzrlib.option import Option, ListOption
29
 
 
30
 
class cmd_bash_completion(Command):
 
27
from bzrlib import commands, option
 
28
 
 
29
 
 
30
class cmd_bash_completion(commands.Command):
31
31
    """Generate a shell function for bash command line completion.
32
32
 
33
33
    This command generates a shell function which can be used by bash to
39
39
    """
40
40
 
41
41
    takes_options = [
42
 
        Option("function-name", short_name="f", type=str, argname="name",
 
42
        option.Option("function-name", short_name="f", type=str, argname="name",
43
43
               help="Name of the generated function (default: _bzr)"),
44
 
        Option("function-only", short_name="o", type=None,
 
44
        option.Option("function-only", short_name="o", type=None,
45
45
               help="Generate only the shell function, don't enable it"),
46
 
        Option("debug", type=None, hidden=True,
 
46
        option.Option("debug", type=None, hidden=True,
47
47
               help="Enable shell code useful for debugging"),
48
 
        ListOption("plugin", type=str, argname="name",
49
 
                   # param_name="selected_plugins", # doesn't work, bug #387117
50
 
                   help="Enable completions for the selected plugin"
51
 
                   + " (default: all plugins)"),
 
48
        option.ListOption("plugin", type=str, argname="name",
 
49
                # param_name="selected_plugins", # doesn't work, bug #387117
 
50
                help="Enable completions for the selected plugin"
 
51
                + " (default: all plugins)"),
52
52
        ]
53
53
 
54
54
    def run(self, **kwargs):
60
60
            del kwargs['plugin']
61
61
        bash_completion_function(sys.stdout, **kwargs)
62
62
 
63
 
register_command(cmd_bash_completion)
 
63
 
 
64
commands.register_command(cmd_bash_completion)
 
65
 
64
66
 
65
67
def load_tests(basic_tests, module, loader):
66
68
    testmod_names = [