Skip to content

Commit

Permalink
Merge pull request #17 from gtamazian/master
Browse files Browse the repository at this point in the history
Show version in help messages
  • Loading branch information
ad3002 committed Aug 24, 2015
2 parents 6eb5023 + 1e1b4bb commit d87de1c
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CXX = g++
CXXFLAGS = -std=c++0x -Wall -O2
PREFIX ?= /usr/local/bin

OBJ = seq.o search.o stats.o fileroutines.o readroutines.o
OBJ = seq.o search.o stats.o fileroutines.o readroutines.o version.o

all: rm_reads extract remove separate

Expand All @@ -21,6 +21,9 @@ search.o: search.h search.cpp
stats.o: stats.h stats.cpp
$(CXX) -c $(CXXFLAGS) stats.cpp

version.o: version.h version.cpp
$(CXX) -c $(CXXFLAGS) version.cpp

rm_reads: rm_reads.cpp $(OBJ)
$(CXX) $(CXXFLAGS) -o rm_reads rm_reads.cpp $(OBJ)

Expand Down
3 changes: 2 additions & 1 deletion src/cookiecutter
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ def cookiecutter():
"""
parser = argparse.ArgumentParser(
description='Cookiecutter: a kmer-based read filtration and '
'extraction tool.')
'extraction tool.',
version='1.0.0')
subparsers = parser.add_subparsers(dest='command')

parser.add_argument('-e', '--echo', action='store_true',
Expand Down
2 changes: 2 additions & 0 deletions src/extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "search.h"
#include "stats.h"
#include "seq.h"
#include "version.h"

/*! \brief Read adapter patterns from an input stream
*
Expand Down Expand Up @@ -144,6 +145,7 @@ void print_help()
{
std::cerr << "Usage:" << std::endl;
std::cerr << "extract [-i raw_data.fastq | -1 raw_data1.fastq -2 raw_data2.fastq] -o output_dir --fragments fragments.dat" << std::endl;
show_version();
}

/*! \brief The main function of the **extract** tool. */
Expand Down
2 changes: 2 additions & 0 deletions src/remove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "search.h"
#include "stats.h"
#include "seq.h"
#include "version.h"

/*! \brief Read adapter patterns from an input stream
*
Expand Down Expand Up @@ -123,6 +124,7 @@ void print_help()
{
std::cerr << "Usage:" << std::endl;
std::cerr << "remove [-i raw_data.fastq | -1 raw_data1.fastq -2 raw_data2.fastq] -o output_dir --fragments fragments.dat" << std::endl;
show_version();
}

/*! \brief The main function of the **remove** tool. */
Expand Down
2 changes: 2 additions & 0 deletions src/rm_reads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "search.h"
#include "stats.h"
#include "seq.h"
#include "version.h"

/*! \brief Read adapter patterns from an input stream
*
Expand Down Expand Up @@ -145,6 +146,7 @@ void print_help()
{
std::cerr << "Usage:" << std::endl;
std::cerr << "rm_reads [-i raw_data.fastq | -1 raw_data1.fastq -2 raw_data2.fastq] -o output_dir --polyG 13 --length 50 --fragments fragments.dat --dust_cutoff cutoff --dust_k k" << std::endl;
show_version();
}

/*! \brief The main function of the **rm_reads** tool. */
Expand Down
2 changes: 2 additions & 0 deletions src/separate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "search.h"
#include "stats.h"
#include "seq.h"
#include "version.h"

/*! \brief Read adapter patterns from an input stream
*
Expand Down Expand Up @@ -140,6 +141,7 @@ void print_help()
{
std::cerr << "Usage:" << std::endl;
std::cerr << "separate [-i raw_data.fastq | -1 raw_data1.fastq -2 raw_data2.fastq] -o output_dir --fragments fragments.dat" << std::endl;
show_version();
}

/*! \brief The main function of the **rm_reads** tool. */
Expand Down
7 changes: 7 additions & 0 deletions src/version.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "version.h"

void show_version()
{
std::cerr << "Version: " << version << std::endl;
}

7 changes: 7 additions & 0 deletions src/version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <iostream>
#include <string>

static const std::string version = "1.0.0";

void show_version();

0 comments on commit d87de1c

Please sign in to comment.