From: Stefan Sauer Date: Wed, 29 May 2013 08:30:16 +0000 (+0200) Subject: generate-*: cosmetic changes X-Git-Tag: orc-0.4.18~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7951525fa5bcf8914cd1e1d314497ddd5a5c18ce;p=platform%2Fupstream%2Forc.git generate-*: cosmetic changes Print the file name if we use the default. Consider the header_flag for the default name. Correct the help() desc for the --header flag (it takes no arg). --- diff --git a/orc/generate-bytecode.c b/orc/generate-bytecode.c index db583d2..795a1e4 100644 --- a/orc/generate-bytecode.c +++ b/orc/generate-bytecode.c @@ -34,7 +34,7 @@ void help (void) printf("\n"); printf("Application Options:\n"); printf(" -o, --output FILE Write output to FILE\n"); - printf(" --header FILE Write header to FILE\n"); + printf(" --header Write header instead of .c file\n"); printf("\n"); exit (0); @@ -78,7 +78,8 @@ main (int argc, char *argv[]) } if (output_file == NULL) { - output_file = "out.c"; + output_file = output_header ? "out.h" : "out.c"; + printf("Writing to file: %s\n", output_file); } output = fopen (output_file, "w"); diff --git a/orc/generate-emulation.c b/orc/generate-emulation.c index 2a79990..09c2776 100644 --- a/orc/generate-emulation.c +++ b/orc/generate-emulation.c @@ -35,7 +35,7 @@ void help (void) printf("\n"); printf("Application Options:\n"); printf(" -o, --output FILE Write output to FILE\n"); - printf(" --header FILE Write header to FILE\n"); + printf(" --header Write header instead of .c file\n"); printf("\n"); exit (0); @@ -79,7 +79,8 @@ main (int argc, char *argv[]) } if (output_file == NULL) { - output_file = "out.c"; + output_file = output_header ? "out.h" : "out.c"; + printf("Writing to file: %s\n", output_file); } output = fopen (output_file, "w");