def _bash_completion(self):
        commands = set()
        options = set()
        for option, _action in self.parser._option_string_actions.items():
            options.add(option)
        for _name, _command in self.command_manager:
            commands.add(_name)
            cmd_factory = _command.load()
            cmd = cmd_factory(self, None)
            cmd_parser = cmd.get_parser('')
            for option, _action in cmd_parser._option_string_actions.items():
                options.add(option)
        print(' '.join(commands | options))
Prints all of the commands and options for bash-completion.
dataset/ETHPy150Open openstack/python-neutronclient/neutronclient/shell.py/NeutronShell._bash_completion