'Dispatch a cli command to the appropriate function.
* :meth:`.execute_command`
* :meth:`.daemon_command`
* CLI plugin callback function
The manager should have a lock and be initialized before calling this method.
:param options: argparse options for command. Defaults to options that manager was instantiated with.'

def handle_cli(self, options=None):

    if (not options):
        options = self.options
    command = options.cli_command
    command_options = getattr(options, command)
    if (command in [u'execute', u'daemon']):
        if (command == u'execute'):
            self.execute_command(command_options)
        elif (command == u'daemon'):
            self.daemon_command(command_options)
    else:
        options.cli_command_callback(self, command_options)
