aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <[email protected]>2016-04-11 18:00:45 -0400
committerQuentin Carbonneaux <[email protected]>2016-04-11 18:00:45 -0400
commit8bb7d57b4ef4d0c0f04dbeb67eb1e3f55d407c0d (patch)
treedb74da1e73473a56c94057b1afae2bd482680cbb /main.c
parent3a3c88532c4d1c5fdf89d159cb24706dcbc6fc28 (diff)
improve help message slightly
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/main.c b/main.c
index b1047c9..5fad26e 100644
--- 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) {