From 881e7399b2417c32fa996d94c6b389c1e06d8eb1 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 28 Apr 2026 16:18:12 +0800 Subject: Add scaffolding CLI tool `mling` --- mling/src/cli.rs | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 mling/src/cli.rs (limited to 'mling/src/cli.rs') 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) {} -- cgit