pub struct ModCli {
pub registry: CommandRegistry,
/* private fields */
}Expand description
Represents a CLI application and provides command registration and dispatch.
Typical usage:
use modcli::ModCli;
let args: Vec<String> = std::env::args().skip(1).collect();
let mut cli = ModCli::new();
cli.run(args);Fields§
§registry: CommandRegistryImplementations§
Source§impl ModCli
impl ModCli
Sourcepub fn set_prefix(&mut self, prefix: &str)
pub fn set_prefix(&mut self, prefix: &str)
Sets the command prefix used for prefix routing (e.g., tool:hello).
Sourcepub fn get_prefix(&self) -> &str
pub fn get_prefix(&self) -> &str
Gets the current command prefix.
Sourcepub fn with_config(path: &str) -> Self
pub fn with_config(path: &str) -> Self
Preferred constructor: sets config path before CLI boot.
Sourcepub fn with_owned_config(cfg: CliConfig) -> Self
pub fn with_owned_config(cfg: CliConfig) -> Self
Construct with an owned configuration (non-global). Prefer this in library usage/tests.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModCli
impl !RefUnwindSafe for ModCli
impl !Send for ModCli
impl !Sync for ModCli
impl Unpin for ModCli
impl !UnwindSafe for ModCli
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