pub struct App<C> { /* private fields */ }Expand description
One ctl process: short-circuits, help, parsing, execution, and presentation.
Implementations§
Source§impl<C> App<C>
impl<C> App<C>
Sourcepub fn view(self, select: impl Fn(&C) -> View + 'static) -> Self
pub fn view(self, select: impl Fn(&C) -> View + 'static) -> Self
Select output, color, and quiet policy from the parsed CLI.
Sourcepub fn automatic_width_buffer(self, columns: u16) -> Self
pub fn automatic_width_buffer(self, columns: u16) -> Self
Override the automatic-width buffer for help, errors, and command output. Zero disables buffering; explicit view widths remain exact.
Sourcepub fn automatic_width_buffer_envs(self, names: &'static [&'static str]) -> Self
pub fn automatic_width_buffer_envs(self, names: &'static [&'static str]) -> Self
Replace the ordered environment names for every automatic-width render. An empty slice disables environment lookup.
Sourcepub fn minimum_automatic_width(self, columns: u16) -> Self
pub fn minimum_automatic_width(self, columns: u16) -> Self
Set the floor for automatically detected effective widths.
Sourcepub fn fallback_width(self, width: Option<u16>) -> Self
pub fn fallback_width(self, width: Option<u16>) -> Self
Lay out to width when no width is detected; None disables it.
Sourcepub fn styles(self, styles: RenderOptions) -> Self
pub fn styles(self, styles: RenderOptions) -> Self
Take record style, list style, and row separation from styles for
help, errors, and command output.
Sourcepub fn json_layout(self, layout: JsonLayout) -> Self
pub fn json_layout(self, layout: JsonLayout) -> Self
Lay out JSON output as layout.
Sourcepub fn before_parse(
self,
hook: impl Fn(&[OsString]) -> Option<ExitCode> + 'static,
) -> Self
pub fn before_parse( self, hook: impl Fn(&[OsString]) -> Option<ExitCode> + 'static, ) -> Self
Add an ordered pre-parse short-circuit, such as dynamic completion.
Sourcepub fn mounted_as(self, task: impl Into<String>) -> Self
pub fn mounted_as(self, task: impl Into<String>) -> Self
Expose a mise Usage spec under a mounted task name.
Auto Trait Implementations§
impl<C> !RefUnwindSafe for App<C>
impl<C> !Send for App<C>
impl<C> !Sync for App<C>
impl<C> !UnwindSafe for App<C>
impl<C> Freeze for App<C>
impl<C> Unpin for App<C>
impl<C> UnsafeUnpin for App<C>
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> 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