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 set_extra_config(self, extra_configs: Config) -> Self
pub fn set_extra_config(self, extra_configs: Config) -> Self
Adds default configs in addition to the normal defaults.
sourcepub fn set_store_factories(self, store_factories: StoreFactories) -> Self
pub fn set_store_factories(self, store_factories: StoreFactories) -> Self
Replaces StoreFactories to be used.
sourcepub fn set_working_copy_factories(
self,
working_copy_factories: HashMap<String, Box<dyn WorkingCopyFactory>>
) -> Self
pub fn set_working_copy_factories( self, working_copy_factories: HashMap<String, Box<dyn WorkingCopyFactory>> ) -> Self
Replaces working copy factories to be used.
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 !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