}
        }
        $new_shards[$shard_name] = $shard;
    }
    $shards = $new_shards;
    $shards['config'] = array_merge($config_default, $shards['config']);
    return $shards;
}
$params = get_commandline();
if (has_short_opt(array('h', 'help'), $params)) {
    shard_query_common_help();
    directory_setup_help();
    exit;
}
$batch_mode = false;
if (has_short_opt('batch', $params)) {
    $batch_mode = true;
}
echo "";
echo "* Reading config\n";
$shards = get_shards($params);
if (empty($shards['config'])) {
    die("SETUP FAILED: You must have a [config] entry in the .ini file.\n");
}
$config = $shards['config'];
unset($shards['config']);
if (empty($config['schema_name'])) {
    echo "NOTICE: a schema_name was not specified in the [config] section of your .ini file.  Using shard_query as the default\n";
    $config['schema_name'] = 'shard_query';
}
if (empty($config['mapper'])) {
        }
        if (!empty($default)) {
            foreach ($default as $key => $v) {
                if (empty($shard[$key])) {
                    $shard[$key] = $v;
                }
            }
        }
        $new_shards[$shard_name] = $shard;
    }
    $shards = $new_shards;
    $shards['config'] = array_merge($config_default, $shards['config']);
    return $shards;
}
$params = get_commandline();
if (has_short_opt(array('h', 'help'), $params)) {
    shard_query_common_help();
    directory_setup_help();
    exit;
}
echo "";
echo "* Reading config\n";
$shards = get_shards($params);
if (empty($shards['config'])) {
    die("SETUP FAILED: You must have a [config] entry in the .ini file.\n");
}
$config = $shards['config'];
unset($shards['config']);
if (empty($config['schema_name'])) {
    echo "NOTICE: a schema_name was not specified in the [config] section of your .ini file.  Using shard_query as the default\n";
    $config['schema_name'] = 'shard_query';