pub struct FlattenGroup<'a> {
pub name: &'a str,
pub start: usize,
pub meta: &'a CommandMeta<'a>,
pub help_heading: Option<&'a str>,
}Expand description
A run of one command’s flags that arrived from a flattened Args type.
#[usage(flatten)] splices a struct’s declarations into the command that holds it, so a
set of flags shared by thirty commands is thirty identical copies in the emitted spec.
This records the seam the expansion leaves behind, so Spec::to_kdl can write the set
once as a flagset and a use in each command that has it.
Fields§
§name: &'a strThe name the emitted flagset is given: the flattened type’s, in kebab-case.
start: usizeWhere this group’s flags begin in the flattening command’s flag list.
meta: &'a CommandMeta<'a>The flattened type’s own metadata.
The flagset’s body comes from here rather than from the parent’s slice, so a struct
that flattens another can be written as a set that uses a set.
help_heading: Option<&'a str>Heading for this group’s unheaded flags, from next_help_heading on the flatten site.
A field that already names a heading keeps it. This is clap’s
#[command(flatten, next_help_heading = "…")]: the section is declared where the
group is mounted, not on every field inside it.
Trait Implementations§
Source§impl<'a> Clone for FlattenGroup<'a>
impl<'a> Clone for FlattenGroup<'a>
Source§fn clone(&self) -> FlattenGroup<'a>
fn clone(&self) -> FlattenGroup<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more