pub struct CliRunner { /* private fields */ }Expand description
CLI command builder and runner.
Implementations§
source§impl CliRunner
impl CliRunner
sourcepub fn init() -> Self
pub fn init() -> Self
Initializes CLI environment and returns a builder. This should be called as early as possible.
sourcepub fn add_extra_config(self, extra_configs: Config) -> Self
pub fn add_extra_config(self, extra_configs: Config) -> Self
Adds default configs in addition to the normal defaults.
sourcepub fn add_store_factories(self, store_factories: StoreFactories) -> Self
pub fn add_store_factories(self, store_factories: StoreFactories) -> Self
Adds StoreFactories to be used.
sourcepub fn add_working_copy_factories(
self,
working_copy_factories: WorkingCopyFactories,
) -> Self
pub fn add_working_copy_factories( self, working_copy_factories: WorkingCopyFactories, ) -> Self
Adds working copy factories to be used.
pub fn add_symbol_resolver_extension( self, symbol_resolver: Box<dyn SymbolResolverExtension>, ) -> Self
pub fn add_revset_function_extension( self, name: &'static str, func: RevsetFunction, ) -> Self
pub fn add_commit_template_extension( self, commit_template_extension: Box<dyn CommitTemplateLanguageExtension>, ) -> Self
pub fn add_operation_template_extension( self, operation_template_extension: Box<dyn OperationTemplateLanguageExtension>, ) -> Self
pub fn add_start_hook( self, start_hook_fn: Box<dyn FnOnce(&mut Ui, &CommandHelper) -> Result<(), CommandError>>, ) -> Self
sourcepub fn add_subcommand<C, F>(self, custom_dispatch_fn: F) -> Self
pub fn add_subcommand<C, F>(self, custom_dispatch_fn: F) -> Self
Registers new subcommands in addition to the default ones.
sourcepub fn add_global_args<A, F>(self, process_before: F) -> Self
pub fn add_global_args<A, F>(self, process_before: F) -> Self
Registers new global arguments in addition to the default ones.
pub fn run(self) -> ExitCode
Auto Trait Implementations§
impl Freeze for CliRunner
impl !RefUnwindSafe for CliRunner
impl !Send for CliRunner
impl !Sync for CliRunner
impl Unpin for CliRunner
impl !UnwindSafe for CliRunner
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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