pub struct CmdMeta {
pub name: String,
pub description: String,
}Expand description
testing
Fields§
§name: StringThe name
description: StringThe description
Implementations§
Source§impl CmdMeta
meta
impl CmdMeta
meta
Sourcepub fn new(name: &str, description: &str) -> Self
pub fn new(name: &str, description: &str) -> Self
TODO
Examples found in repository?
examples/framework.rs (line 12)
3fn main() {
4 let clier_builder = Clier::parse().meta(CliMeta {
5 name: "example-clier".into(),
6 usage: Some("[command]".into()),
7 description: "testing".into(),
8 version: Some("0.0.0".into()),
9 });
10
11 let app = clier_builder.runnable(vec![Commands::Collection(CmdCollection {
12 meta: CmdMeta::new("testing", "testing"),
13 children: Box::from([Commands::Command {
14 meta: CmdMeta::new("testchild", "testing"),
15 handler: |_| {
16 println!("hello");
17 ExitCode(0)
18 },
19 }]),
20 })]);
21
22 app.run();
23}Trait Implementations§
Auto Trait Implementations§
impl Freeze for CmdMeta
impl RefUnwindSafe for CmdMeta
impl Send for CmdMeta
impl Sync for CmdMeta
impl Unpin for CmdMeta
impl UnwindSafe for CmdMeta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more