summaryrefslogtreecommitdiff
path: root/gn.c
diff options
context:
space:
mode:
authorthing1 <thing1@seacrossedlovers.xyz>2025-04-08 09:53:29 +0100
committerthing1 <thing1@seacrossedlovers.xyz>2025-04-08 09:53:29 +0100
commit2ebbe89ddf64a1cdaea65b4d49ffe668c6577e00 (patch)
tree45f0b0d95d8959c951fe614ccb81e35e33291a95 /gn.c
parent39b1d95bcdb6f6dfe17186a05798084234d0cc24 (diff)
made some additions that allow for better outputing of dataHEADmaster
Diffstat (limited to 'gn.c')
-rw-r--r--gn.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/gn.c b/gn.c
index b56d934..f09b078 100644
--- a/gn.c
+++ b/gn.c
@@ -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;