Delete bash_completion in subcommand

There are two "completion" in the subcommand table: bash-completion
and bash_completion. but "bash_completion" is not in help information
and it is repeated with "bash-completion", so delete it.

Change-Id: I18da874681ea00c18d72e164dc55aeea9d40731d
Closes-Bug: #1670123
This commit is contained in:
lihaijing 2017-08-23 14:55:29 +08:00
parent 7a7f708282
commit 1bfd6d0ee4
1 changed files with 0 additions and 12 deletions

View File

@ -165,19 +165,8 @@ class KarborShell(object):
self._find_actions(subparsers, submodule)
self._find_actions(subparsers, self)
self._add_bash_completion_subparser(subparsers)
return parser
def _add_bash_completion_subparser(self, subparsers):
subparser = subparsers.add_parser(
'bash_completion',
add_help=False,
formatter_class=HelpFormatter
)
self.subcommands['bash_completion'] = subparser
subparser.set_defaults(func=self.do_bash_completion)
def _find_actions(self, subparsers, actions_module):
for attr in (a for a in dir(actions_module) if a.startswith('do_')):
# I prefer to be hypen-separated instead of underscores.
@ -425,7 +414,6 @@ class KarborShell(object):
options.add(option)
commands.remove('bash-completion')
commands.remove('bash_completion')
print(' '.join(commands | options))
@utils.arg('command', metavar='<subcommand>', nargs='?',