Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Commit

Permalink
Modify version code to use a #define
Browse files Browse the repository at this point in the history
  • Loading branch information
zamiqbal committed Aug 8, 2015
1 parent 7fdaa87 commit c707e6e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
15 changes: 8 additions & 7 deletions include/predictor/core/base_species.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/*
* Copyright 2015 Zamin Iqbal ([email protected])
*
*
* species.h
*/

/*
* Copyright 2015 Zamin Iqbal ([email protected])
*
*
* base_species.h
*/

#ifndef BASE_SPECIES_H_
#define BASE_SPECIES_H_

#include "dB_graph.h"

#ifdef STAPH
Expand Down Expand Up @@ -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
7 changes: 4 additions & 3 deletions src/predictor/staph/cmd_line.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <err.h>
#endif
#include <errno.h>
#include "myk_pred_global.h"

#ifdef __mingw__
#define __override_realpath(N,R) _fullpath((R),(N),_MAX_PATH)
Expand Down Expand Up @@ -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':
Expand Down
8 changes: 2 additions & 6 deletions src/predictor/staph/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -495,4 +490,5 @@ void timestamp(){
ltime = time(NULL);
printf("%s",asctime(localtime(&ltime)));
fflush(stdout);
}
}

7 changes: 4 additions & 3 deletions src/predictor/tb/cmd_line.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <err.h>
#endif
#include <errno.h>
#include "myk_pred_global.h"

#ifdef __mingw__
#define __override_realpath(N,R) _fullpath((R),(N),_MAX_PATH)
Expand Down Expand Up @@ -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':
Expand Down

6 comments on commit c707e6e

@iqbal-lab
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope this OK with you Phelim?

@Phelimb
Copy link
Collaborator

@Phelimb Phelimb commented on c707e6e Aug 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you forget to commit myk_pred_global.h? This commit is breaking for me. Can't compile.

@zamiqbal
Copy link
Contributor Author

@zamiqbal zamiqbal commented on c707e6e Aug 9, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zamiqbal
Copy link
Contributor Author

@zamiqbal zamiqbal commented on c707e6e Aug 9, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Phelimb
Copy link
Collaborator

@Phelimb Phelimb commented on c707e6e Aug 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, no rush.

@iqbal-lab
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done here f621b84

Please sign in to comment.