shithub: mc

Download patch

ref: 81c19d1a4fb393758ce2f08c63f8511ada5bc413
parent: c9397174e261c485d586d826699525bb805c0665
parent: f73f37cc9ddf43db97fb55f50a5d774484881405
author: Ori Bernstein <ori@eigenstate.org>
date: Thu Mar 3 07:32:33 EST 2016

Merge branch 'args' of https://github.com/kirbyfan64/mc

--- a/6/main.c
+++ b/6/main.c
@@ -33,8 +33,8 @@
 
 static void usage(char *prog)
 {
-	printf("%s [-?] [-o outfile] [-d[dbgopts]] inputs\n", prog);
-	printf("\t-?\tPrint this help\n");
+	printf("%s [-?|-h] [-o outfile] [-d[dbgopts]] inputs\n", prog);
+	printf("\t-?|-h\tPrint this help\n");
 	printf("\t-o\tOutput to outfile\n");
 	printf("\t-S\tGenerate assembly source alongside object code\n");
 	printf("\t-c\tEnable additional (possibly flaky) checking\n");
@@ -165,7 +165,7 @@
 
 	outfile = NULL;
 
-	optinit(&ctx, "cd:hSo:I:9G", argv, argc);
+	optinit(&ctx, "cd:?hSo:I:9G", argv, argc);
 	asmsyntax = Defaultasm;
 	while (!optdone(&ctx)) {
 		switch (optnext(&ctx)) {
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,9 @@
 SUB = parse \
       mi \
+      util \
       6 \
       muse \
       rt \
-      util \
       doc
 
 EXTRA=buildmyr
--- a/util/util.c
+++ b/util/util.c
@@ -175,7 +175,7 @@
 	c = *ctx->curarg;
 	ctx->curarg++;
 	if (!optinfo(ctx, c, &take, &mand)) {
-		printf("Unexpected argument %c\n", *ctx->curarg);
+		printf("Unexpected argument %c\n", c);
 		exit(1);
 	}