diff options
Diffstat (limited to 'gn.c')
-rw-r--r-- | gn.c | 24 |
1 files changed, 3 insertions, 21 deletions
@@ -7,26 +7,10 @@ #include "tokens.h" #include "output.h" #include "util.h" - -typedef enum mode { - NONE = 0, - LIST = 1, - CHECK = 2, - OUTPUT = 4, - PRETTY = 8, -} mode; - -typedef enum outputformats { - GOATNOTE, - HTML, - GROFF, - TEXT, -} outputformats; +#include "opts.h" outputformats outputformat; - mode m = NONE; - token tokens[1024]; int tokcount = 0; @@ -80,13 +64,11 @@ int readuntil(char *file, int off, char end, types t) { } void usage() { - fprintf(stderr, - "usage: gn [-l -c -o format -p -H header -F footer -h] < note.gn\n" - ); - exit(1); + eprint("usage: gn [-l -c -o format -p -H header -F footer -h] < note.gn"); } int main(int argc, char **argv) { + if (argc <= 1) usage(); for (int i = 1; i < argc && argc != 1; i++) { if (strcmp(argv[i], "-l") == 0) m |= LIST; else if (strcmp(argv[i], "-c") == 0) m |= CHECK; |