Skip to main content

available_flags

Function available_flags 

Source
pub fn available_flags(chain: &[&SpecCommand]) -> Vec<Arc<SpecFlag>>
Expand description

Every flag a command accepts, resolved the way parsing an invocation of it resolves them.

chain runs from the root command (spec.cmd) down to the command in question; an empty chain yields no flags.

This is not “the command’s flags plus its ancestors’ globals”. A subcommand that re-declares a global’s long name is describing the same flag rather than a new one, so the global’s help, argument and effect survive and only the re-declaration’s extra aliases are added — see [merge_subcommand_flags]. Anything that reports a command’s flags without going through this will disagree with what the parser actually accepts.