Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An argument cannot take negative number as it's value #194

Closed
redspade opened this issue Sep 27, 2012 · 1 comment
Closed

An argument cannot take negative number as it's value #194

redspade opened this issue Sep 27, 2012 · 1 comment

Comments

@redspade
Copy link

Negative numbers are treated as individual arguments, not values :
e.g. -minThreshold -3 is translated into two arguments (--min, --3), instead of min argument with 3 as its value.

If this is not an intended behavior, I think negative number should be treated differently.

In order to support multiple numbers as a value, e.g. --select -7,3,-2,5, I think something like following will do:

       if(arg == noDashes || arg.matches("-\\d+.*") )
          (acc.head._1 -> (arg :: acc.head._2)) :: acc.tail
@azymnis
Copy link
Contributor

azymnis commented Sep 27, 2012

Good catch. Here's the pull request with the fix:

#195

@redspade redspade closed this as completed Oct 4, 2012
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

No branches or pull requests

2 participants