Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/vpc-ccg/lordfast
Browse files Browse the repository at this point in the history
  • Loading branch information
haghshenas committed Nov 14, 2018
2 parents 38d96fb + 0f03233 commit eea6bb6
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/CommandLineParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -224,6 +236,7 @@ int parseCommandLine (int argc, char *argv[])
exit(EXIT_SUCCESS);
break;
default:
printHelp_short();
return 1;
}

Expand All @@ -232,29 +245,33 @@ 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 )
{
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;
}
}

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;
Expand Down

0 comments on commit eea6bb6

Please sign in to comment.