~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to shell.py

  • Committer: Aaron Bentley
  • Date: 2009-09-26 17:23:33 UTC
  • Revision ID: aaron@aaronbentley.com-20090926172333-kg1usfku13e6nzea
Fix deprecation warnings completing command names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib import osutils
28
28
from bzrlib.branch import Branch
29
29
from bzrlib.config import config_dir, ensure_config_dir_exists
30
 
from bzrlib.commands import get_cmd_object, get_all_cmds, get_alias
 
30
from bzrlib.commands import get_cmd_object, all_command_names, get_alias
31
31
from bzrlib.errors import BzrError
32
32
from bzrlib.workingtree import WorkingTree
33
33
 
290
290
 
291
291
 
292
292
def iter_command_names(hidden=False):
293
 
    for real_cmd_name, cmd_class in get_all_cmds():
294
 
        if not hidden and cmd_class.hidden:
 
293
    for real_cmd_name in all_command_names():
 
294
        cmd_obj = get_cmd_object(real_cmd_name)
 
295
        if not hidden and cmd_obj.hidden:
295
296
            continue
296
 
        for name in [real_cmd_name] + cmd_class.aliases:
 
297
        for name in [real_cmd_name] + cmd_obj.aliases:
297
298
            # Don't complete on aliases that are prefixes of the canonical name
298
299
            if name == real_cmd_name or not real_cmd_name.startswith(name):
299
300
                yield name