From 8bb7d57b4ef4d0c0f04dbeb67eb1e3f55d407c0d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 11 Apr 2016 18:00:45 -0400 Subject: improve help message slightly --- main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'main.c') 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 ] [-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 "); + exit(c != 'h'); } switch (asm) { -- cgit 1.4.1