tomerfiliba / plumbum

Plumbum: Shell Combinators
https://plumbum.readthedocs.io
MIT License
2.8k stars 182 forks source link

cli.SwitchAttr/Flag doesn't account for envname and mandatory together #551

Closed wtanksleyjr closed 3 years ago

wtanksleyjr commented 3 years ago

It would make sense to allow a mandatory argument to be provided by an envname, but the parser raises an error without checking the environment.

class App(cli.Application):
    OUTPUT = cli.SwitchAttr(['d', "destination"], cli.ExistingDirectory, mandatory=True, envname="MY_FOLDER")
wtanksleyjr commented 3 years ago

Ugh, cancel this. Bad testing on my part.