Commit e8e73a5e authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

vidjil.cpp: check that there is at most one option -s/-k

It could be nicer with python argparse :)
parent 447496a7
...@@ -272,6 +272,8 @@ int main (int argc, char **argv) ...@@ -272,6 +272,8 @@ int main (int argc, char **argv)
char c ; char c ;
int options_s_k = 0 ;
//$$ options: getopt //$$ options: getopt
while ((c = getopt(argc, argv, "AhaG:V:D:J:k:r:R:vw:e:C:t:l:dc:m:M:N:s:p:Sn:o:Lx%:Z:z:u")) != EOF) while ((c = getopt(argc, argv, "AhaG:V:D:J:k:r:R:vw:e:C:t:l:dc:m:M:N:s:p:Sn:o:Lx%:Z:z:u")) != EOF)
...@@ -345,6 +347,7 @@ int main (int argc, char **argv) ...@@ -345,6 +347,7 @@ int main (int argc, char **argv)
case 'k': case 'k':
k = atoi(optarg); k = atoi(optarg);
seed = seed_contiguous(k); seed = seed_contiguous(k);
options_s_k++ ;
break; break;
case 'w': case 'w':
...@@ -398,6 +401,7 @@ int main (int argc, char **argv) ...@@ -398,6 +401,7 @@ int main (int argc, char **argv)
#ifndef NO_SPACED_SEEDS #ifndef NO_SPACED_SEEDS
seed = string(optarg); seed = string(optarg);
k = seed_weight(seed); k = seed_weight(seed);
options_s_k++ ;
#else #else
cerr << "To enable the option -s, please compile without NO_SPACED_SEEDS" << endl; cerr << "To enable the option -s, please compile without NO_SPACED_SEEDS" << endl;
#endif #endif
...@@ -439,6 +443,12 @@ int main (int argc, char **argv) ...@@ -439,6 +443,12 @@ int main (int argc, char **argv)
w = default_w ; w = default_w ;
if (options_s_k > 1)
{
cout << "use at most one -s or -k option." << endl ;
exit(1);
}
string out_seqdir = out_dir + "/seq/" ; string out_seqdir = out_dir + "/seq/" ;
if (verbose) if (verbose)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment