You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I give a bad option or combination of options to stack it just prints the usage, without telling me what the problem is. It should tell me what it doesn't like about my options.
For example, I'm trying to figure out the stack test equivalent of cabal test --test-option=<op1> --test-option=<op2>. Looking at stack test --help I see the --test-arguments option. First I try
stack test --test-argument=<op1> --test-argument=<op2>
and stack prints a generic Usage: ... message without any hint about what is wrong.
The problem is that the option is called --test-arguments (plural), not --test-argument (singular); Stack should tell me what the problem is: the option I gave is unknown (bonus points for suggesting the correct option like GHC does with typoed symbols, but that's a fancier fix).
I then wonder if I'm only allowed to use the --test-argument option once and try
stack test --test-argument=<op1>
and stack says Usage: .... Again, I have no idea what I've done wrong.
I then realize I was supposed to write --test-arguments, plural, so I try
stack test --test-arguments=<op1>
which works. So, I try two arguments again with
stack test --test-arguments=<op1> --test-arguments=<op2>
and stack says Usage: .... The problem now is that I'm not allowed to specify --test-arguments twice; Stack should tell me this.
Finally, I try the correct
stack test --test-arguments='<op1> <op2>'
and the test runs :)
The text was updated successfully, but these errors were encountered:
Some of this is because stack isn't consistent about how it handles certain kinds of arguments (just opened #652 about this), some is because of the way we use optparse-applicative, and some comes down to limitations in optparse-applicative that may be more difficult to overcome. I've created a new milestone to group all the options parsing-related issues together.
If I give a bad option or combination of options to
stack
it just prints the usage, without telling me what the problem is. It should tell me what it doesn't like about my options.For example, I'm trying to figure out the
stack test
equivalent ofcabal test --test-option=<op1> --test-option=<op2>
. Looking atstack test --help
I see the--test-arguments
option. First I tryand stack prints a generic
Usage: ...
message without any hint about what is wrong.The problem is that the option is called
--test-arguments
(plural), not--test-argument
(singular); Stack should tell me what the problem is: the option I gave is unknown (bonus points for suggesting the correct option like GHC does with typoed symbols, but that's a fancier fix).I then wonder if I'm only allowed to use the
--test-argument
option once and tryand stack says
Usage: ...
. Again, I have no idea what I've done wrong.I then realize I was supposed to write
--test-arguments
, plural, so I trywhich works. So, I try two arguments again with
and stack says
Usage: ...
. The problem now is that I'm not allowed to specify--test-arguments
twice; Stack should tell me this.Finally, I try the correct
and the test runs :)
The text was updated successfully, but these errors were encountered: