#include "argparse.hpp"
#include <stdexcept>

Args parse_args(int argc, char* argv[]) {
    Args args;
    int idx = 1;
    if (argc > 1 && std::string(argv[1]) == "-s") {
        args.silent = true;
        idx++;
    }
    if (argc - idx != 2) {
        throw std::runtime_error("Usage: dehydrate [-s] SOURCE DESTFOLDER");
    }
    args.source = argv[idx];
    args.dest = argv[idx + 1];
    return args;
} 