} catch (Zend_Console_Getopt_Exception $e) {
    echo $e->getMessage() . "\n";
    echo $e->getUsageMessage();
    exit;
}
if (count($opts->toArray()) === 0 || $opts->h || empty($opts->method)) {
    echo $opts->getUsageMessage();
    exit;
}
if ($opts->config) {
    // add path to config.inc.php to include path
    $path = strstr($opts->config, 'config.inc.php') !== false ? dirname($opts->config) : $opts->config;
    set_include_path($path . PATH_SEPARATOR . get_include_path());
}
// get username / password if not already set
if (!in_array($opts->method, Tinebase_Server_Cli::getAnonymousMethods($opts->method))) {
    if (empty($opts->username)) {
        $opts->username = Tinebase_Server_Cli::promptInput('username');
    }
    if (empty($opts->username)) {
        echo "error: username must be given! exiting \n";
        exit(1);
    }
    if (empty($opts->password)) {
        if (empty($opts->passwordfile)) {
            $opts->password = Tinebase_Server_Cli::promptInput('password', TRUE);
        } else {
            $opts->password = Tinebase_Server_Cli::getPasswordFromFile($opts->passwordfile);
        }
    }
}