Closed ThorstenHans closed 2 years ago
That's not global fault, that's env that change your flag to option. There is no really any solution for this using structopt and clapv2, but clapv3 (in alpha stage) should propose a solution for this.
Don't know if we've solved every problem here but https://github.com/clap-rs/clap/issues/2539 was closed by https://github.com/clap-rs/clap/pull/2664
🙏🏼 Thanks for pointing me to env
.
I wanted to create a global
debug
flag, so that all sub-commands accept this flag. However, addingglobal = true
turns my flag into an argument which requires a value.From documentation, I don't see another way how I can turn a flag into a global flag. Any suggestions here?
when executing with this configuration, and providing just
--debug
, the app fails with the following error: