1pub mod command;
2pub mod parser;
3pub mod loader;
4pub mod output;
5pub mod config;
6
7#[cfg(feature = "internal-commands")]
8pub mod commands;
9
10use crate::loader::CommandRegistry;
11
12pub struct ModCli {
14 pub registry: CommandRegistry,
15}
16
17impl ModCli {
18 pub fn new() -> Self {
20 Self {
21 registry: CommandRegistry::new(),
22 }
23 }
24
25 pub fn run(&self, args: Vec<String>) {
27 if args.is_empty() {
28 eprintln!("No command provided.");
29 return;
30 }
31
32 let cmd = &args[0];
33 let cmd_args = &args[1..];
34 self.registry.execute(cmd, cmd_args);
35 }
36}
37
38pub fn modcli_version() -> &'static str {
40 env!("CARGO_PKG_VERSION")
41}