#include #include #include #include #include #include #include #define DOCTEST_CONFIG_IMPLEMENT #include namespace aocpp { auto Startup(int argc, char ** argv) -> std::unique_ptr { if (std::getenv("DOCTEST")) { exit(doctest::Context{argc, argv}.run()); } switch (argc) { case 2: return {new std::ifstream{argv[1]}, [](std::istream* p) { delete p; }}; case 1: return {&std::cin, [](std::istream*){}}; default: std::cerr << "bad arguments\n"; exit(EXIT_FAILURE); } } }