You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cmkr/src/main.cpp

22 lines
575 B

#include "args.hpp"
4 years ago
#include <cstdio>
#include <cstdlib>
#include <cstring>
4 years ago
#include <stdexcept>
4 years ago
int main(int argc, char **argv) try {
auto output = cmkr::args::handle_args(argc, argv);
auto format = "[cmkr] %s\n";
if (strchr(output, '\n') != nullptr)
format = "%s\n";
(void)fprintf(stderr, format, output);
return EXIT_SUCCESS;
4 years ago
} catch (const std::exception &e) {
auto format = "[cmkr] error: %s\n";
if (strchr(e.what(), '\n') != nullptr)
format = "%s\n";
(void)fprintf(stderr, format, e.what());
4 years ago
return EXIT_FAILURE;
}