2 * PaperJam -- Main program
4 * (c) 2018 Martin Mares <mj@ucw.cz>
25 void debug(const char *msg, ...)
31 fprintf(stderr, "%*s", debug_indent, "");
32 vfprintf(stderr, msg, args);
37 void warn(const char *msg, ...)
41 fprintf(stderr, "Warning: ");
42 vfprintf(stderr, msg, args);
47 void die(const char *msg, ...)
51 vfprintf(stderr, msg, args);
64 static const struct option long_opts[] = {
65 { "debug", 0, 0, 'd' },
66 { "help", 0, 0, OPT_HELP },
67 { "version", 0, 0, OPT_VERSION },
68 { "bbox", 0, 0, 'b' },
72 static const char short_opts[] = "bd";
76 printf("Usage: paperjam [<options>] <commands> <in> <out>\n\
79 -b, --bbox Recalculate bounding boxes\n\
80 -d, --debug Show debugging messages\n\
87 int main(int argc, char **argv)
90 while ((c = getopt_long(argc, argv, short_opts, long_opts, NULL)) >= 0)
100 printf("This is paperjam with no version yet.\n"); // FIXME
109 if (optind + 3 != argc)
110 die("Exactly three positional parameters should be given");
113 parse(argv[optind], cmds);
114 in_name = argv[optind+1];
115 out_name = argv[optind+2];