Skip to content

Problem in parsing k and K#1

Open
nicoinn wants to merge 1 commit intosolonas13:masterfrom
nicoinn:patch-1
Open

Problem in parsing k and K#1
nicoinn wants to merge 1 commit intosolonas13:masterfrom
nicoinn:patch-1

Conversation

@nicoinn
Copy link

@nicoinn nicoinn commented May 8, 2015

No error is generated when user mistakenly input "-k" twice instead of "-k" and "-K" (see below).
The program silently attributes the value of the second "-k" to both k and K.

The proposed modification is a quick and dirty way of avoiding the bug.
A better way to solve this would be for the function decode_switches() to return an error. Changing from -k / -K to, for example, -kmin / -kmax could also circumvent the problem.

Problem demo :

./maw -a DNA -i U00096.fna -o test.fna -k 2 -K 10

k is 2 and K is 10

./maw -a DNA -i U00096.fna -o test.fna -k 2 -k 10

k is 10 and K is 10

No error is generated when user mistakenly input "-k" twice instead of "-k" and "-K" (see below). 
The program silently attributes the value of the second "-k" to both k and K.

The proposed modification is a quick and dirty way of avoiding the bug. 
A better way to solve this would be for the function decode_switches() to return an error.  Changing from -k / -K to, for example, -kmin / -kmax could also circumvent the problem. 


Problem demo : 
#./maw -a DNA -i U00096.fna -o test.fna -k 2 -K  10
k is 2 and  K is 10
#./maw -a DNA -i U00096.fna -o test.fna -k 2 -k 10
k is 10 and  K is 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant