pub struct Command {
pub name: String,
pub about: String,
pub long_about: String,
pub args: Vec<Arg>,
pub flags: Vec<Flag>,
pub examples: Vec<String>,
pub destructive: bool,
pub subcommands: Vec<Command>,
}Expand description
A subcommand. The run closure is stored on the app side; this struct holds
only the descriptive spec used for parsing and help.
Fields§
§name: String§about: String§long_about: StringA longer description shown in the command’s own --help.
args: Vec<Arg>§flags: Vec<Flag>§examples: Vec<String>Example invocations shown in long help.
destructive: boolMarks the command as performing destructive on-disk changes, so the app
can enforce the confirmation/--sudo guards.
subcommands: Vec<Command>Child command specs, when this command is a group. Populated by the app’s group builder so help and completion can render the nested tree. Empty for leaf commands.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Forget for Command
impl Freeze for Command
impl Move for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more