changeset 177:2b07e452fd78

Adjust program banner printing.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 02 Mar 2015 01:46:31 +0200
parents 791eaeb4f412
children e9a5eed1f2c5
files th_util.c
diffstat 1 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/th_util.c	Sun Mar 01 15:59:36 2015 +0200
+++ b/th_util.c	Mon Mar 02 01:46:31 2015 +0200
@@ -46,13 +46,20 @@
 
 void th_print_banner(FILE *outFile, const char *name, const char *usage)
 {
-    fprintf(outFile,
-            "\n%s v%s (%s)\n"
-            "%s\n"
-            "%s\n"
-            "Usage: %s %s\n",
-            th_prog_name, th_prog_version, th_prog_desc,
-            th_prog_author, th_prog_license, name, usage);
+    fprintf(outFile, "\n%s", th_prog_name);
+    if (th_prog_version != NULL)
+        fprintf(outFile, " v%s", th_prog_version);
+    if (th_prog_desc != NULL)
+        fprintf(outFile, " (%s)", th_prog_desc);
+    fprintf(outFile, "\n");
+
+    if (th_prog_author != NULL)
+        fprintf(outFile, "%s\n", th_prog_author);
+
+    if (th_prog_license != NULL)
+        fprintf(outFile, "%s\n", th_prog_license);
+
+    fprintf(outFile, "Usage: %s %s\n", name, usage);
 }