From 68e15e67405ea0b01e548d904ef61355cc26b4a2 Mon Sep 17 00:00:00 2001 From: Ehsan Haghshenas Date: Tue, 13 Nov 2018 18:32:50 -0800 Subject: [PATCH 1/2] printing short help (#14) --- src/CommandLineParser.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/CommandLineParser.cpp b/src/CommandLineParser.cpp index da2f2f9..b0cb850 100644 --- a/src/CommandLineParser.cpp +++ b/src/CommandLineParser.cpp @@ -75,6 +75,13 @@ void printHelp() #endif } +void printHelp_short() +{ + fprintf(stderr, "usage: lordfast --index ref.fa\n"); + fprintf(stderr, " lordfast --search ref.fa --seq reads.fa [options]\n"); + fprintf(stderr, "For more details and command line options run \"lordfast --help\"\n"); +} + int set_read_group(char *rg_line) { char *p, *q; @@ -118,6 +125,11 @@ int set_read_group(char *rg_line) int parseCommandLine (int argc, char *argv[]) { + if(argc < 2) + { + printHelp_short(); + return 1; + } int i; int index, ch; @@ -224,6 +236,7 @@ int parseCommandLine (int argc, char *argv[]) exit(EXIT_SUCCESS); break; default: + printHelp_short(); return 1; } @@ -232,12 +245,14 @@ int parseCommandLine (int argc, char *argv[]) if (indexingMode + searchingMode != 1) { fprintf(stderr, "[ERROR] (parseCommandLine) indexing / searching mode should be selected\n"); + printHelp_short(); return 1; } if ( indexingMode && refFile == NULL ) { fprintf(stderr, "[ERROR] (parseCommandLine) reference file should be indicated for indexing\n"); + printHelp_short(); return 1; } if ( searchingMode ) @@ -245,11 +260,13 @@ int parseCommandLine (int argc, char *argv[]) if (refFile == NULL) { fprintf(stderr, "[ERROR] (parseCommandLine) reference file should be indiciated for searching\n"); + printHelp_short(); return 1; } if (seqFile == NULL) { fprintf(stderr, "[ERROR] (parseCommandLine) please indicate a sequence file for searching.\n"); + printHelp_short(); return 1; } } From 0f03233be2e66ce4379cb489daeb9165b3f0a8de Mon Sep 17 00:00:00 2001 From: Ehsan Haghshenas Date: Tue, 13 Nov 2018 18:40:00 -0800 Subject: [PATCH 2/2] bugfix; anchor len cannot be smaller than kCache. TODO: accept kCache from command line --- src/CommandLineParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CommandLineParser.cpp b/src/CommandLineParser.cpp index b0cb850..42d7d91 100644 --- a/src/CommandLineParser.cpp +++ b/src/CommandLineParser.cpp @@ -271,7 +271,7 @@ int parseCommandLine (int argc, char *argv[]) } } - if (MIN_ANCHOR_LEN < 10 || MIN_ANCHOR_LEN > 20) + if (MIN_ANCHOR_LEN < 12 || MIN_ANCHOR_LEN > 20) { fprintf(stderr, "[ERROR] (parseCommandLine) -k/--minAnchorLen requires an argument in [10..20]\n"); return 1;