You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to create a global debug flag, so that all sub-commands accept this flag. However, adding global = 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?
structFooBar{#[structopt(long, short, help = "Prints debug information", global = true, env = "STRINGS__DEBUG")]debug:bool,input:String,#[structopt(subcommand)]cmd:SubCommand}
when executing with this configuration, and providing just --debug, the app fails with the following error:
error: The argument '--debug <debug>' requires a value but none was supplied
The text was updated successfully, but these errors were encountered:
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.
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:The text was updated successfully, but these errors were encountered: