generate-*: cosmetic changes
authorStefan Sauer <ensonic@users.sf.net>
Wed, 29 May 2013 08:30:16 +0000 (10:30 +0200)
committerStefan Sauer <ensonic@users.sf.net>
Wed, 29 May 2013 08:30:16 +0000 (10:30 +0200)
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).

orc/generate-bytecode.c
orc/generate-emulation.c

index db583d2..795a1e4 100644 (file)
@@ -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");
index 2a79990..09c2776 100644 (file)
@@ -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");