From c707e6e00e08ff0f0c9e5c04859ecdb6ab920f54 Mon Sep 17 00:00:00 2001 From: Zamin Iqbal Date: Sat, 8 Aug 2015 23:48:18 +0100 Subject: [PATCH] Modify version code to use a #define --- include/predictor/core/base_species.h | 15 ++++++++------- src/predictor/staph/cmd_line.c | 7 ++++--- src/predictor/staph/main.c | 8 ++------ src/predictor/tb/cmd_line.c | 7 ++++--- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/include/predictor/core/base_species.h b/include/predictor/core/base_species.h index 39a0603..d9211d6 100644 --- a/include/predictor/core/base_species.h +++ b/include/predictor/core/base_species.h @@ -1,16 +1,13 @@ -/* - * Copyright 2015 Zamin Iqbal (zam@well.ox.ac.uk) - * - * - * species.h -*/ - /* * Copyright 2015 Zamin Iqbal (zam@well.ox.ac.uk) * * * base_species.h */ + +#ifndef BASE_SPECIES_H_ +#define BASE_SPECIES_H_ + #include "dB_graph.h" #ifdef STAPH @@ -173,3 +170,7 @@ void print_json_phylogenetics(SpeciesInfo* species_info); void print_json_phylo_group(SpeciesInfo* species_info); void print_json_species(SpeciesInfo* species_info); void print_json_lineage(SpeciesInfo* species_info); + + + +#endif diff --git a/src/predictor/staph/cmd_line.c b/src/predictor/staph/cmd_line.c index ed61816..e43b495 100644 --- a/src/predictor/staph/cmd_line.c +++ b/src/predictor/staph/cmd_line.c @@ -17,6 +17,7 @@ #include #endif #include +#include "myk_pred_global.h" #ifdef __mingw__ #define __override_realpath(N,R) _fullpath((R),(N),_MAX_PATH) @@ -186,9 +187,9 @@ int parse_cmdline_inner_loop(int argc, char* argv[], int unit_size, CmdLine* cmd case 'z': { - printf("0.1.3\n"); - exit(0); - break; + printf("Mykrobe predictor for S. aureus Version %d.%d.%d\n", MYK_VERSION,MYK_SUBVERSION,MYK_SUBSUBVERSION); + exit(0); + break; } case 'i': diff --git a/src/predictor/staph/main.c b/src/predictor/staph/main.c index 2bc2482..c83aea0 100644 --- a/src/predictor/staph/main.c +++ b/src/predictor/staph/main.c @@ -44,14 +44,9 @@ int main(int argc, char **argv) { return -1; } - // VERSION_STR is passed from the makefile -- usually last commit hash parse_cmdline(cmd_line, argc,argv,sizeof(Element)); - if (cmd_line->format==Stdout){ - printf("myKrobe.predictor for Staphylococcus, version %d.%d.%d.%d"VERSION_STR"\n", - VERSION, SUBVERSION, SUBSUBVERSION, SUBSUBSUBVERSION); - } dBGraph * db_graph = NULL; @@ -495,4 +490,5 @@ void timestamp(){ ltime = time(NULL); printf("%s",asctime(localtime(<ime))); fflush(stdout); -} \ No newline at end of file +} + diff --git a/src/predictor/tb/cmd_line.c b/src/predictor/tb/cmd_line.c index ddaf99f..d5144f1 100644 --- a/src/predictor/tb/cmd_line.c +++ b/src/predictor/tb/cmd_line.c @@ -17,6 +17,7 @@ #include #endif #include +#include "myk_pred_global.h" #ifdef __mingw__ #define __override_realpath(N,R) _fullpath((R),(N),_MAX_PATH) @@ -184,9 +185,9 @@ int parse_cmdline_inner_loop(int argc, char* argv[], int unit_size, CmdLine* cmd } case 'z': { - printf("0.1.3\n"); - exit(0); - break; + printf("Mykrobe predictor for M. tuberculosis Version %d.%d.%d\n", MYK_VERSION,MYK_SUBVERSION,MYK_SUBSUBVERSION); + exit(0); + break; } case 'i':