pub struct Launcher<G: Command> { /* private fields */ }Expand description
Launcher before any subcommand has been registered.
Calling Launcher::command transitions to LauncherWithSubs.
Implementations§
Source§impl<G: Command + 'static> Launcher<G>
impl<G: Command + 'static> Launcher<G>
pub fn of() -> Self
Sourcepub fn command<S>(self, name: &str) -> LauncherWithSubs<G>where
S: Command + SubCommandOf<G> + 'static,
pub fn command<S>(self, name: &str) -> LauncherWithSubs<G>where
S: Command + SubCommandOf<G> + 'static,
Register the first subcommand, moving into subcommand mode.
Sourcepub fn command_with_description<S>(
self,
name: &str,
description: &str,
) -> LauncherWithSubs<G>where
S: Command + SubCommandOf<G> + 'static,
pub fn command_with_description<S>(
self,
name: &str,
description: &str,
) -> LauncherWithSubs<G>where
S: Command + SubCommandOf<G> + 'static,
Like Launcher::command but with a description override.
Sourcepub fn execute(self) -> !where
G: Runnable,
pub fn execute(self) -> !where
G: Runnable,
Parse std::env::args(), run G::run, and exit. Parse-origin
failures (including those from G::from_parsed, e.g. missing
required args, invalid typed values) route through the help printer
with exit code 2. Runtime failures from G::run exit with code 1
and no help banner.
Auto Trait Implementations§
impl<G> Freeze for Launcher<G>
impl<G> RefUnwindSafe for Launcher<G>where
G: RefUnwindSafe,
impl<G> Send for Launcher<G>where
G: Send,
impl<G> Sync for Launcher<G>where
G: Sync,
impl<G> Unpin for Launcher<G>where
G: Unpin,
impl<G> UnsafeUnpin for Launcher<G>
impl<G> UnwindSafe for Launcher<G>where
G: UnwindSafe,
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