hs-cli icon indicating copy to clipboard operation
hs-cli copied to clipboard

FlagShort doesn't accept a value with '='

Open nishirken opened this issue 2 years ago • 0 comments

Example:

import Console.Options
import Data.Char (isDigit)
import Data.Monoid

data MyADT = A | B | C
    deriving (Show,Eq)

main = defaultMain $ do
    nameFlag <- flagParam (FlagShort 'n' <> FlagLong "name" <> FlagDescription "name of something")
                          (FlagRequired $ \s -> Right s)

    command "sample" $ do
        action $ \toParam -> do
            putStrLn $ show $ toParam nameFlag

stack run -- sample -n=n

outputs

Nothing

whereas FlagLong parses "n" as a value

version 0.2.0

nishirken avatar Apr 10 '22 08:04 nishirken