pub struct CommandSpec {
pub command_path: Vec<String>,
pub about: Option<String>,
pub reference_note: Option<String>,
pub arguments: Vec<ArgSpec>,
pub combinations: Vec<Combination>,
}Expand description
One exact command path in a CLI registry.
Fields§
§command_path: Vec<String>§about: Option<String>§reference_note: Option<String>Prose for the generated reference, after this command’s argument table.
An argument’s about is one table cell and has to stay one — but some
commands need a paragraph that belongs to no single argument: where a
default is read from, what two options mean together, what the result
reports back. Without somewhere to put it, that paragraph ends up
hand-written into a file whose own header says “generated, do not edit
by hand”, where the next regeneration silently deletes it.
Reference only. --help stays the machine-readable shape of a command;
this is for the document a person reads.
arguments: Vec<ArgSpec>§combinations: Vec<Combination>Implementations§
Source§impl CommandSpec
impl CommandSpec
pub fn root() -> Self
pub fn new<I, S>(command_path: I) -> Self
pub fn about(self, about: impl Into<String>) -> Self
Sourcepub fn reference_note(self, note: impl Into<String>) -> Self
pub fn reference_note(self, note: impl Into<String>) -> Self
Prose for the generated reference, after this command’s argument table.
pub fn arg(self, argument: ArgSpec) -> Self
pub fn combination(self, combination: Combination) -> Self
Trait Implementations§
Source§impl Clone for CommandSpec
impl Clone for CommandSpec
Source§fn clone(&self) -> CommandSpec
fn clone(&self) -> CommandSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandSpec
impl Debug for CommandSpec
Source§impl<'de> Deserialize<'de> for CommandSpec
impl<'de> Deserialize<'de> for CommandSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CommandSpec
impl PartialEq for CommandSpec
Source§impl Serialize for CommandSpec
impl Serialize for CommandSpec
impl StructuralPartialEq for CommandSpec
Auto Trait Implementations§
impl Freeze for CommandSpec
impl RefUnwindSafe for CommandSpec
impl Send for CommandSpec
impl Sync for CommandSpec
impl Unpin for CommandSpec
impl UnsafeUnpin for CommandSpec
impl UnwindSafe for CommandSpec
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