-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Given following program:
data Cli
= Serve { filePath :: FilePath }
| Inspect { filePath :: FilePath }
deriving (Show, Data, Typeable)
cliServe :: Cli
cliServe = Serve { filePath = def &= typ "Path to file" &= args }
cliInspect :: Cli
cliInspect = Inspect { filePath = def &= typ "Path to file" &= args }Executing it leads to this help text:
$ stack run -- --help
The cli program
cli [COMMAND] ... [OPTIONS]
Common flags:
-? --help Display help message
-V --version Print version information
cli serve [OPTIONS] [Path to file]
cli inspect [OPTIONS]
-f --filepath=ITEMFor serve it gets parsed as a normal argument and for inspect as a flag.
When I change the typ of one of them to something else, it works. 😳
This also happens when I remove both typ expressions, since the name then seems to default to ITEM.
This can't be right, can it?
ad-si, lbuchli, das-g, pacien and kbmackenzie
Metadata
Metadata
Assignees
Labels
No labels