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 },
71 static const char short_opts[] = "bd";
75 printf("Usage: paperjam [<options>] <commands> <in> <out>\n\
78 -b, --bbox Recalculate bounding boxes\n\
79 -d, --debug Show debugging messages\n\
86 int main(int argc, char **argv)
89 while ((c = getopt_long(argc, argv, short_opts, long_opts, NULL)) >= 0)
99 printf("This is paperjam with no version yet.\n"); // FIXME
108 if (optind + 3 != argc)
109 die("Exactly three positional parameters should be given");
112 parse(argv[optind], cmds);
113 in_name = argv[optind+1];
114 out_name = argv[optind+2];