aboutsummaryrefslogtreecommitdiff
path: root/mling/src/cli.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-04-28 16:18:12 +0800
committer魏曹先生 <1992414357@qq.com>2026-04-28 16:18:12 +0800
commit881e7399b2417c32fa996d94c6b389c1e06d8eb1 (patch)
treefd88cb181e9c5a0bae8677c43dff859f4cd82d80 /mling/src/cli.rs
parentdbc811d84fd809ea606a8bbed84b3e78e8cda334 (diff)
Add scaffolding CLI tool `mling`
Diffstat (limited to 'mling/src/cli.rs')
-rw-r--r--mling/src/cli.rs45
1 files changed, 45 insertions, 0 deletions
diff --git a/mling/src/cli.rs b/mling/src/cli.rs
new file mode 100644
index 0000000..e0dfbe6
--- /dev/null
+++ b/mling/src/cli.rs
@@ -0,0 +1,45 @@
+use mingling::{
+ macros::renderer,
+ setup::{BasicProgramSetup, GeneralRendererSetup},
+};
+
+use crate::{__completion_gen::CompletionDispatcher, DispatcherNotFound, ThisProgram};
+
+pub mod list;
+pub use list::*;
+
+pub mod namespace_mgr;
+pub use namespace_mgr::*;
+
+pub mod read;
+pub use read::*;
+
+pub mod refresh;
+pub use refresh::*;
+
+pub fn cli_entry() {
+ let mut program = ThisProgram::new();
+
+ program.with_setup(BasicProgramSetup);
+ program.with_setup(GeneralRendererSetup);
+ program.with_dispatcher(CompletionDispatcher);
+
+ program.with_dispatcher(ListInstalledCommand);
+ program.with_dispatchers((
+ TrustNamespaceCommand,
+ UntrustNamespaceCommand,
+ SetTrustNamespaceCommand,
+ RemoveNamespaceCommand,
+ ));
+ program.with_dispatcher(RefreshCommand);
+ program.with_dispatchers((
+ ReadTargetDirCommand,
+ ReadWorkspaceRootCommand,
+ ReadBinariesCommand,
+ ));
+
+ program.exec();
+}
+
+#[renderer]
+pub(crate) fn render_help(_prev: DispatcherNotFound) {}