diff --git a/main.c b/main.c index 5129602..f5b66f9 100644 --- a/main.c +++ b/main.c @@ -18,7 +18,7 @@ #include #include -#include +#include #include "util.h" #include "book.h" @@ -29,12 +29,21 @@ */ int main(int argc, char *argv[]) { + const struct option options[] = { + { "font-table", required_argument, NULL, 'f' }, + { "pretty-print", no_argument, NULL, 'p' }, + { "markup", no_argument, NULL, 'm' }, + { "positions", no_argument, NULL, 's' }, + { "font-tags", no_argument, NULL, 't' }, + { NULL, 0, NULL, 0 }, + }; + char* dict_path = NULL; char* font_path = NULL; int flags = 0; - char c = 0; - while ((c = getopt(argc, argv, "f:d:pmst")) != -1) { + int c = 0; + while ((c = getopt_long(argc, argv, "f:d:pmst", options, NULL)) != -1) { switch (c) { case 'f': font_path = optarg;