$flags[$arg] = true;
            break;
        default:
            $colls[] = $arg;
    }
}
echo "\n\nPROCESSING PARAMS\n";
echo "\nFLAGS:\n" . json_encode($flags) . "\n\n";
# exit if no collections set and no --all flag
if ($colls === [] && !($flags['--list-all'] || $flags['--list-missing'])) {
    echo "You must specify a collection to harvest, or use the flag --all. Use --help for more.\n";
    exit;
}
$ingester = new ContentDM();
if ($flags['--cron-delete-multi']) {
    $ingester->cronDeleteMulti();
    exit;
}
if ($flags['--cron-delete']) {
    if (!isset($index) || $index == null) {
        die("You must specify the index to delete");
    }
    if (!isset($path) || $path == null) {
        die("You must specify the path to search in");
    }
    $ingester->cronDelete($index, $path);
    exit;
}
//we need all collections at this point (regardless of the exit for --list-all)
$allCollections = $ingester->getCollections();
if ($flags['--list-all']) {