Discovered the following bug today. I haven't really explored it, but below is a seemingly minimal example:
import Options.Applicative
data Opt = A | B
opts :: Parser Opt
opts = flag' A (long "test") <|> flag' B (long "test1")
main :: IO ()
main = () <$ customExecParser (prefs disambiguate) (info opts mempty)
Let's call this program test. Running test --test yields:
Invalid option `--test'
Did you mean one of these?
--test
--test1
Usage: test (--test | --test1)
However, test --test1 executes just fine. Furthermore, replacing main by
main = () <$ execParser (info opts mempty)
parses either option just fine.
I've tried this with the latest versions (0.16.0.0 and 0.16.0.1) and also hopped back to 0.15.0.0 just to see if there was any difference.
Discovered the following bug today. I haven't really explored it, but below is a seemingly minimal example:
Let's call this program
test. Runningtest --testyields:However,
test --test1executes just fine. Furthermore, replacingmainbyparses either option just fine.
I've tried this with the latest versions (0.16.0.0 and 0.16.0.1) and also hopped back to 0.15.0.0 just to see if there was any difference.