Skip to content

Commit 34a50b4

Browse files
committed
fix the sanity check
1 parent bcfc920 commit 34a50b4

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

rtk/Rare.cpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "ClStr2Mat.h"
22
#include "Rare.h"
3+
#include "options.h"
34

45
const char* rar_ver="0.9";
56

@@ -125,11 +126,7 @@ options::options(int argc, char** argv) :input(""), output(""), mode(""),
125126
depth(0), repeats(10), write(0), threads(1), writeSwap(true), verbose(false),
126127
modDB(""), modRedund(5), modEnzCompl(0.5f), modModCompl(0.5f), modWrXtraInfo(false),
127128
xtra("") {
128-
/* RefTaxFile(""), blastres(""), outF(""), input_format("bl8"),
129-
BLfilter(true), calcHighMats(false), hitRD(false), isReads(false),
130-
annotateAll(false), nativeSlVdb(false),
131-
numThr(1), taxDepth(defDep), LCAfract(0.9f), idThr(defDep,0),
132-
blFiles(0), refDBs(0), Taxlvls(defDep)*/
129+
133130

134131
bool hasErr = false;
135132
if (argc == 0) { return; }//could be the pseudo mod opt object
@@ -179,10 +176,12 @@ xtra("") {
179176
// sanity checks
180177
// we need input
181178
if (input == "") {//just set some defaults
182-
//cerr << "A input must be given\n";
183-
//hasErr = true;
184-
input = argv[2];
185-
output = argv[3];
179+
cerr << "Input must be specified\n";
180+
hasErr = true;
181+
}
182+
if (output == "") {//just set some defaults
183+
cerr << "Output must be specified\n";
184+
hasErr = true;
186185
}
187186

188187
if (hasErr) {
@@ -372,6 +371,7 @@ void rareExtremLowMem(string inF, string outF, int writeFiles, string arg4, int
372371

373372
int main(int argc, char* argv[])
374373
{
374+
375375
if (argc < 2) { cerr << "Not enough arguments. Use \"rtk -h\" for getting started.\n"; exit(3); }
376376

377377
options* opts = new options(argc, argv);
@@ -386,10 +386,6 @@ int main(int argc, char* argv[])
386386

387387
//all modes that classify as rarefactions:
388388
if (mode == "swap" || mode == "memory") {
389-
if(opts->input == ""){
390-
cerr << "No input file specified. Exiting" << std::endl;
391-
exit(0);
392-
}
393389
opts->print_rare_details();
394390
}
395391

0 commit comments

Comments
 (0)