pub struct SpecCommandBuilder { /* private fields */ }Expand description
Builder for SpecCommand
Implementations§
Source§impl SpecCommandBuilder
impl SpecCommandBuilder
Sourcepub fn alias(self, alias: impl Into<String>) -> Self
pub fn alias(self, alias: impl Into<String>) -> Self
Add an alias (can be called multiple times)
Add a hidden alias (can be called multiple times)
Add multiple hidden aliases at once
Sourcepub fn flags(self, flags: impl IntoIterator<Item = SpecFlag>) -> Self
pub fn flags(self, flags: impl IntoIterator<Item = SpecFlag>) -> Self
Add multiple flags at once
Sourcepub fn args(self, args: impl IntoIterator<Item = SpecArg>) -> Self
pub fn args(self, args: impl IntoIterator<Item = SpecArg>) -> Self
Add multiple arguments at once
Sourcepub fn subcommand_required(self, required: bool) -> Self
pub fn subcommand_required(self, required: bool) -> Self
Set subcommand required
Sourcepub fn deprecated(self, msg: impl Into<String>) -> Self
pub fn deprecated(self, msg: impl Into<String>) -> Self
Set deprecated message
Sourcepub fn restart_token(self, token: impl Into<String>) -> Self
pub fn restart_token(self, token: impl Into<String>) -> Self
Set restart token for resetting argument parsing
e.g., mise run lint ::: test ::: check with restart_token=“:::”
Sourcepub fn subcommand(self, cmd: SpecCommand) -> Self
pub fn subcommand(self, cmd: SpecCommand) -> Self
Add a subcommand (can be called multiple times)
Sourcepub fn subcommands(self, cmds: impl IntoIterator<Item = SpecCommand>) -> Self
pub fn subcommands(self, cmds: impl IntoIterator<Item = SpecCommand>) -> Self
Add multiple subcommands at once
Sourcepub fn before_help(self, text: impl Into<String>) -> Self
pub fn before_help(self, text: impl Into<String>) -> Self
Set before_help text (displayed before the help message)
Sourcepub fn before_help_long(self, text: impl Into<String>) -> Self
pub fn before_help_long(self, text: impl Into<String>) -> Self
Set before_help_long text
Sourcepub fn before_help_md(self, text: impl Into<String>) -> Self
pub fn before_help_md(self, text: impl Into<String>) -> Self
Set before_help markdown text
Sourcepub fn after_help(self, text: impl Into<String>) -> Self
pub fn after_help(self, text: impl Into<String>) -> Self
Set after_help text (displayed after the help message)
Sourcepub fn after_help_long(self, text: impl Into<String>) -> Self
pub fn after_help_long(self, text: impl Into<String>) -> Self
Set after_help_long text
Sourcepub fn after_help_md(self, text: impl Into<String>) -> Self
pub fn after_help_md(self, text: impl Into<String>) -> Self
Set after_help markdown text
Sourcepub fn example(self, code: impl Into<String>) -> Self
pub fn example(self, code: impl Into<String>) -> Self
Add an example (can be called multiple times)
Sourcepub fn example_with_help(
self,
code: impl Into<String>,
header: impl Into<String>,
help: impl Into<String>,
) -> Self
pub fn example_with_help( self, code: impl Into<String>, header: impl Into<String>, help: impl Into<String>, ) -> Self
Add an example with header and help text
Sourcepub fn build(self) -> SpecCommand
pub fn build(self) -> SpecCommand
Build the final SpecCommand
Trait Implementations§
Source§impl Clone for SpecCommandBuilder
impl Clone for SpecCommandBuilder
Source§fn clone(&self) -> SpecCommandBuilder
fn clone(&self) -> SpecCommandBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SpecCommandBuilder
impl Debug for SpecCommandBuilder
Source§impl Default for SpecCommandBuilder
impl Default for SpecCommandBuilder
Source§fn default() -> SpecCommandBuilder
fn default() -> SpecCommandBuilder
Auto Trait Implementations§
impl !Freeze for SpecCommandBuilder
impl RefUnwindSafe for SpecCommandBuilder
impl Send for SpecCommandBuilder
impl Sync for SpecCommandBuilder
impl Unpin for SpecCommandBuilder
impl UnwindSafe for SpecCommandBuilder
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
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>
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>
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