Skip to content

Commit 4bb6678

Browse files
committed
Close #10
1 parent b42c50a commit 4bb6678

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/main.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,13 @@ SOFTWARE.
3737
#include "analysis.hpp"
3838

3939
void print_help(void);
40+
void print_version(void);
4041

4142
int main(int argc, char** argv)
4243
{
4344
std::string paf_filename, filter, output;
4445
std::uint64_t coverage_min = 0;
4546

46-
if(argc < 3)
47-
{
48-
print_help();
49-
return -1;
50-
}
51-
5247
int c;
5348

5449
const struct option longopts[] =
@@ -61,7 +56,7 @@ int main(int argc, char** argv)
6156
};
6257

6358
int option_index = 0;
64-
while((c = getopt_long(argc, argv, "hi:c:f:o:", longopts, &option_index)) != -1)
59+
while((c = getopt_long(argc, argv, "hvi:c:f:o:", longopts, &option_index)) != -1)
6560
{
6661
switch(c)
6762
{
@@ -90,6 +85,9 @@ int main(int argc, char** argv)
9085
coverage_min = atol(optarg);
9186
break;
9287

88+
case 'v':
89+
print_version();
90+
return -1;
9391
case 'h':
9492
print_help();
9593
return -1;
@@ -120,15 +118,21 @@ int main(int argc, char** argv)
120118
return 0;
121119
}
122120

123-
void print_help()
121+
void print_help(void)
124122
{
125123
std::cerr<<"usage: yacrd [-h] [-c coverage_min] [-f file_to_filter.(fasta|fastq|mhap|paf) -o output.(fasta|fastq|mhap|paf)]-i mapping.(paf|mhap)\n";
126124
std::cerr<<"\n";
127125
std::cerr<<"options:\n";
128126
std::cerr<<"\t-h Print help message\n";
127+
std::cerr<<"\t-v Print version number\n";
129128
std::cerr<<"\t-c,--min_coverage If coverage are minus or equal to this create a gap [0]\n";
130129
std::cerr<<"\t-i,--in Maping input file in PAF or MHAP format (with .paf or .mhap extension)\n";
131130
std::cerr<<"\t-f,--filter File contain data need to be filter (fasta|fastq|paf) output option need to be set\n";
132131
std::cerr<<"\t-o,--output File where filtered data are write (fasta|fastq|paf) filter option need to be set\n";
133132
std::cerr<<std::endl;
134133
}
134+
135+
void print_version(void)
136+
{
137+
std::cerr<<"yacrd 0.2 Abok"<<std::endl;
138+
}

0 commit comments

Comments
 (0)