aboutsummaryrefslogtreecommitdiff
path: root/mling/src/cli.rs
diff options
context:
space:
mode:
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) {}