pub struct CommandBuilder { /* private fields */ }Expand description
Builder for a single command’s spec.
Implementations§
Source§impl CommandBuilder
impl CommandBuilder
Sourcepub fn arg<S: Into<String>>(self, name: S, help: S) -> Self
pub fn arg<S: Into<String>>(self, name: S, help: S) -> Self
Add a required positional argument.
Sourcepub fn arg_opt<S: Into<String>>(self, name: S, help: S) -> Self
pub fn arg_opt<S: Into<String>>(self, name: S, help: S) -> Self
Add an optional positional argument.
Sourcepub fn switch<S: Into<String>>(
self,
long: S,
short: Option<char>,
help: S,
) -> Self
pub fn switch<S: Into<String>>( self, long: S, short: Option<char>, help: S, ) -> Self
Add a boolean switch flag.
Sourcepub fn value<S: Into<String>>(
self,
long: S,
short: Option<char>,
help: S,
) -> Self
pub fn value<S: Into<String>>( self, long: S, short: Option<char>, help: S, ) -> Self
Add a value-taking flag.
Sourcepub fn example<S: Into<String>>(self, ex: S) -> Self
pub fn example<S: Into<String>>(self, ex: S) -> Self
Attach an example invocation (shown in long help).
Sourcepub fn long_about<S: Into<String>>(self, s: S) -> Self
pub fn long_about<S: Into<String>>(self, s: S) -> Self
Longer description for the command’s own --help.
Sourcepub fn destructive(self) -> Self
pub fn destructive(self) -> Self
Mark this command as destructive (enables guard helpers/semantics).
Auto Trait Implementations§
impl Forget for CommandBuilder
impl Freeze for CommandBuilder
impl Move for CommandBuilder
impl RefUnwindSafe for CommandBuilder
impl Send for CommandBuilder
impl Sync for CommandBuilder
impl Unpin for CommandBuilder
impl UnsafeUnpin for CommandBuilder
impl UnwindSafe for CommandBuilder
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