diff --git a/src/main.cpp b/src/main.cpp index b165e61..4a61807 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,10 +3,12 @@ #include #include #include +#include #include "commit.inc" +#include "pixels.hpp" void print_help() { - std::cout << "usage: termage [-h|--version]\n"; + std::cout << "usage: termage [-h|--version] \n"; std::cout << " -h, --help show this help text and exit\n"; std::cout << " --version show version number and exit\n"; } @@ -21,6 +23,7 @@ void print_version() { int main(int argc, char* argv[]) { try { + pm_init("termage", 0); int opt_char, opt_val; struct option long_options[] = { {"help", no_argument, nullptr, 'h'}, @@ -52,11 +55,11 @@ int main(int argc, char* argv[]) { for (int i = optind; i < argc; ++i) { try { // process file argv[i] + write_image(std::cout, argv[i]); } catch (const std::runtime_error& ex) { std::cerr << "termage: " << ex.what() << '\n'; } } - std::cout << "hello, termage\n"; } catch (const std::exception& ex) { std::cerr << "termage: " << ex.what() << '\n'; return EXIT_FAILURE;