pub struct CliSpec {
pub command: Vec<Command>,
pub arguments: Vec<Argument>,
pub positional_argument: Option<PositionalArgument>,
pub meta_info: Option<CliSpecMetaInfo>,
}
Expand description
Holds the command line spec (command/parameters/…)
Fields
command: Vec<Command>
A list of all possible commands and sub commands.
arguments: Vec<Argument>
A list of all possible command line arguments.
positional_argument: Option<PositionalArgument>
The name of the argument that will hold all arguments after the last known key based argument. If not defined, such positional arguments are not allowed.
meta_info: Option<CliSpecMetaInfo>
Meta information used for generating version and help messages
Implementations
sourceimpl CliSpec
impl CliSpec
sourcepub fn set_meta_info(self, meta_info: Option<CliSpecMetaInfo>) -> Self
pub fn set_meta_info(self, meta_info: Option<CliSpecMetaInfo>) -> Self
Sets the spec meta info
sourcepub fn add_command(self, command: &str) -> Self
pub fn add_command(self, command: &str) -> Self
Adds a command to the spec
sourcepub fn add_subcommand(self, sub_command: Vec<&str>) -> Self
pub fn add_subcommand(self, sub_command: Vec<&str>) -> Self
Adds a sub command to the spec
sourcepub fn set_positional_argument(
self,
argument: Option<PositionalArgument>
) -> Self
pub fn set_positional_argument(
self,
argument: Option<PositionalArgument>
) -> Self
Sets the PositionalArgument
sourcepub fn add_argument(self, argument: Argument) -> Self
pub fn add_argument(self, argument: Argument) -> Self
Adds a Argument
Trait Implementations
impl StructuralPartialEq for CliSpec
Auto Trait Implementations
impl RefUnwindSafe for CliSpec
impl Send for CliSpec
impl Sync for CliSpec
impl Unpin for CliSpec
impl UnwindSafe for CliSpec
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more