# HG changeset patch # User Matti Hamalainen # Date 1425253591 -7200 # Node ID 2b07e452fd785b3057f1e927d9c601939bbe3661 # Parent 791eaeb4f4127d68a9d308487ce55e475d44e3b4 Adjust program banner printing. diff -r 791eaeb4f412 -r 2b07e452fd78 th_util.c --- 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); }