Skip to content

Commit

Permalink
simplified version printing
Browse files Browse the repository at this point in the history
  • Loading branch information
justanhduc committed Aug 5, 2022
1 parent 5d8586b commit f06085f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
Please find the license in the provided COPYING file.
*/
#define TS_VERSION_FALLBACK "1.4.0"
#ifndef TS_VERSION
#define TS_VERSION 1.4.0
#endif

/* from https://github.com/LLNL/lbann/issues/117
* and https://gcc.gnu.org/onlinedocs/cpp/Stringizing.html#Stringizing */
Expand Down Expand Up @@ -37,14 +39,9 @@ static char *old_getopt_env;
static char version[1024];

static void init_version() {
#ifdef TS_VERSION
char *ts_version = TS_MAKE_STR(TS_VERSION);
sprintf(version, "Task Spooler %s - a task queue system for the unix user.\n"
"Copyright (C) 2007-2020 Duc Nguyen - Lluis Batlle i Rossell", ts_version);
#else
sprintf(version, "Task Spooler %s - a task queue system for the unix user.\n"
"Copyright (C) 2007-2020 Duc Nguyen - Lluis Batlle i Rossell", TS_VERSION_FALLBACK);
#endif
}

static void default_command_line() {
Expand Down

0 comments on commit f06085f

Please sign in to comment.