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: Ia00061376daabeacd524b1afb01e2e9a585ac56f
Closes-Bug: #1670123
This commit is contained in:
ForestLee 2017-03-12 09:29:52 +08:00 committed by Felipe Monteiro
parent cca9855489
commit 0b63a8d6a7
1 changed files with 0 additions and 12 deletions

View File

@ -200,19 +200,8 @@ class MuranoShell(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.
@ -503,7 +492,6 @@ class MuranoShell(object):
options.add(option)
commands.remove('bash-completion')
commands.remove('bash_completion')
print(' '.join(commands | options))
@utils.arg('command', metavar='<subcommand>', nargs='?',