Skip to content

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

@gfarrell

Description

@gfarrell

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions