commit 8bb7d57b4ef4d0c0f04dbeb67eb1e3f55d407c0d
parent 3a3c88532c4d1c5fdf89d159cb24706dcbc6fc28
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Mon, 11 Apr 2016 18:00:45 -0400
improve help message slightly
Diffstat:
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/main.c b/main.c
@@ -84,7 +84,7 @@ main(int ac, char *av[])
asm = Defaultasm;
outf = stdout;
- while ((c = getopt(ac, av, "d:o:G:")) != -1)
+ while ((c = getopt(ac, av, "hd:o:G:")) != -1)
switch (c) {
case 'd':
for (; *optarg; optarg++)
@@ -107,9 +107,14 @@ main(int ac, char *av[])
exit(1);
}
break;
+ case 'h':
default:
- fprintf(stderr, "usage: %s [-d <flags>] [-o out] {file.ssa, -}\n", av[0]);
- exit(1);
+ fprintf(stderr, "%s [OPTIONS] {file.ssa, -}\n", av[0]);
+ fprintf(stderr, "\t%-10s prints this help\n", "-h");
+ fprintf(stderr, "\t%-10s output to file\n", "-o file");
+ fprintf(stderr, "\t%-10s generate gas (e) or osx (m) asm\n", "-G {e,m}");
+ fprintf(stderr, "\t%-10s dump debug information\n", "-d <flags>");
+ exit(c != 'h');
}
switch (asm) {