From 6f2e5c35da79905fb9a35b36cb0e1a5fe1ec4873 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Sun, 2 Aug 2015 14:52:53 -0500 Subject: output help text to stdout instead of stderr --- src/satmkboot.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/satmkboot.c') diff --git a/src/satmkboot.c b/src/satmkboot.c index ffef46c..63e7bb6 100644 --- a/src/satmkboot.c +++ b/src/satmkboot.c @@ -118,10 +118,10 @@ fail: return -1; } -static void print_symbols(FILE *fp, int width, const struct symbolname *symbols) +static void print_symbols(int width, const struct symbolname *symbols) { for (; symbols->symbol; symbols++) { - fprintf(fp, "\t%*s%c: %s\n", width+4, "", symbols->symbol, symbols->name); + printf("\t%*s%c: %s\n", width+4, "", symbols->symbol, symbols->name); } } @@ -129,17 +129,17 @@ static void usage(const char *progname) { const int width = 20; - fprintf(stderr, "usage: %s -h\n", progname); - fprintf(stderr, " %s -o[iprms]\n\n", progname); - fprintf(stderr, "\t%-*s%s\n", width, "-h", "Show this help text"); - fprintf(stderr, "\t%-*s%s\n", width, "-o output", "Output file"); - fprintf(stderr, "\t%-*s%s\n", width, "-i ip.bin", "Initial program code file"); - fprintf(stderr, "\t%-*s%s\n", width, "-p peripherals", "Supported peripherals (default: control pad):"); - print_symbols(stderr, width, peripheraldefs); - fprintf(stderr, "\t%-*s%s\n", width, "-r regions", "Geographical regions (default: all):"); - print_symbols(stderr, width, regiondefs); - fprintf(stderr, "\t%-*s%s\n", width, "-m master_stack", "Master stack address (default 0x06002000)"); - fprintf(stderr, "\t%-*s%s\n", width, "-s slave_stack", "Slave stack address (default 0x06001000)"); + printf("usage: %s -h\n", progname); + printf(" %s -o[iprms]\n\n", progname); + printf("\t%-*s%s\n", width, "-h", "Show this help text"); + printf("\t%-*s%s\n", width, "-o output", "Output file"); + printf("\t%-*s%s\n", width, "-i ip.bin", "Initial program code file"); + printf("\t%-*s%s\n", width, "-p peripherals", "Supported peripherals (default: control pad):"); + print_symbols(width, peripheraldefs); + printf("\t%-*s%s\n", width, "-r regions", "Geographical regions (default: all):"); + print_symbols(width, regiondefs); + printf("\t%-*s%s\n", width, "-m master_stack", "Master stack address (default 0x06002000)"); + printf("\t%-*s%s\n", width, "-s slave_stack", "Slave stack address (default 0x06001000)"); exit(0); } -- cgit v1.2.3