diff options
author | Steven Schubiger <stsc@refcnt.org> | 2014-07-24 12:50:07 +0200 |
---|---|---|
committer | Steven Schubiger <stsc@refcnt.org> | 2014-07-24 12:50:07 +0200 |
commit | cbc423545a5b9952ef129a2c0bf6905d4b3912a7 (patch) | |
tree | de54d6b1bee2a419e5a8713cdfe455430487350e /colorize.c | |
parent | 32458f1006aa98c549909ebcdd731dec08f0c474 (diff) | |
download | colorize-cbc423545a5b9952ef129a2c0bf6905d4b3912a7.tar.gz colorize-cbc423545a5b9952ef129a2c0bf6905d4b3912a7.tar.bz2 |
Merge duplicated version printing code
Diffstat (limited to 'colorize.c')
-rw-r--r-- | colorize.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -408,6 +408,7 @@ print_version (void) #else const char *version = NULL; #endif + const char *version_prefix, *version_string; const char *c_flags; struct bytes_size bytes_size; bool debug; @@ -421,10 +422,10 @@ print_version (void) #else debug = false; #endif - if (version) - printf ("colorize %s (compiled at %s, %s)\n", version, __DATE__, __TIME__); - else - printf ("colorize v%s (compiled at %s, %s)\n", VERSION, __DATE__, __TIME__); + version_prefix = version ? "" : "v"; + version_string = version ? version : VERSION; + printf ("colorize %s%s (compiled at %s, %s)\n", version_prefix, version_string, __DATE__, __TIME__); + printf ("Compiler flags: %s\n", c_flags); if (get_bytes_size (BUF_SIZE, &bytes_size)) { |