Gabriella439 / Gabriella439/optparse-generic

Handling lists the typical way shells might do (e.g. with globs for files)

Open
#114 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
215
Forks
36
PR merge metrics
No merged PRs in 30d

Description

When working with files, I'd like to be able to do something like `mycli -i ./**/*.hs` and have all the files populate `[FilePath]`. MVE:

```haskell
data MyCLI = MyCLI { files :: [FilePath], output :: FilePath }
deriving (Generic)
deriving anyclass (ParseRecord)

main :: IO ()
main = getRecord "file-based CLI" >>= print
```

Running this as `cabal run mycli -- --files ./**/*.hs --output ./output.txt` fails to parse with "InvalidArgument".

I can see that, from the docs, you expect lists to be handled as `--files x.hs --files y.hs` etc., but with file globbing that's not going to happen.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.