simplify bash completion
This commit is contained in:
parent
7ce617f0e4
commit
9fe6bc976f
3 changed files with 37 additions and 29 deletions
|
|
@ -114,12 +114,9 @@ class ConsoleApplication(BaseApplication):
|
|||
|
||||
self._parser.add_option('-o', '--output-format', choices=formatters.keys(),
|
||||
help='output format %s (default: table)' % formatters.keys())
|
||||
self._other_options.add_option('--commands', action='callback', callback=self.print_commands,
|
||||
help='print available commands')
|
||||
|
||||
def print_commands(self, option, opt, value, parser):
|
||||
print ' '.join(name for name, arguments, doc_string in self._commands)
|
||||
sys.exit(0)
|
||||
def _get_completions(self):
|
||||
return set(name for name, arguments, doc_string in self._commands)
|
||||
|
||||
def ask(self, question, default=None, masked=False, regexp=None):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue