diff options
author | thing1 <thing1@seacrossedlovers.xyz> | 2025-04-08 09:53:29 +0100 |
---|---|---|
committer | thing1 <thing1@seacrossedlovers.xyz> | 2025-04-08 09:53:29 +0100 |
commit | 2ebbe89ddf64a1cdaea65b4d49ffe668c6577e00 (patch) | |
tree | 45f0b0d95d8959c951fe614ccb81e35e33291a95 /gn.c | |
parent | 39b1d95bcdb6f6dfe17186a05798084234d0cc24 (diff) |
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; |