Add actual image processing
This commit is contained in:
parent
60dd2f5b70
commit
52ad6f619d
@ -3,10 +3,12 @@
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <getopt.h>
|
||||
#include <netpbm/pam.h>
|
||||
#include "commit.inc"
|
||||
#include "pixels.hpp"
|
||||
|
||||
void print_help() {
|
||||
std::cout << "usage: termage [-h|--version]\n";
|
||||
std::cout << "usage: termage [-h|--version] <imagefile>\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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user