diff --git a/tools/ant-txt/ant-txt.c b/tools/ant-txt/ant-txt.c index 9c03c4d..bdd95f0 100644 --- a/tools/ant-txt/ant-txt.c +++ b/tools/ant-txt/ant-txt.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -23,14 +24,30 @@ #define H 16 +static void usage(const char *name) +{ + fprintf(stderr, "usage: %s [-F font_dir ...] [text]\n", name); + exit(1); +} + + int main(int argc, char **argv) { struct edit *edits = NULL, **last = &edits; uint8_t *canvas; const char *err; int i, x, y; + int c; - for (i = 1; i != argc; i++) { + while ((c = getopt(argc, argv, "F:")) != EOF) + switch (c) { + case 'F': + add_font_dir(optarg); + break; + default: + usage(*argv); + } + for (i = optind; i != argc; i++) { while (*last) last = &(*last)->next; if (edits) {