Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gfarrell opened this issue Dec 16, 2024 · 0 comments
Open

Comments

@gfarrell
Copy link

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:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant