-
Notifications
You must be signed in to change notification settings - Fork 151
Closed
Description
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?
struct FooBar {
#[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
Metadata
Metadata
Assignees
Labels
No labels