aboutsummaryrefslogtreecommitdiff
path: root/mling/src/cli/install.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-06-07 02:25:27 +0800
committer魏曹先生 <1992414357@qq.com>2026-06-07 02:25:27 +0800
commit81528b273c18693ebd3f05c6f8057ff8e632f4a0 (patch)
tree85026c27535337c0123d4650c844ae364bc9780a /mling/src/cli/install.rs
parente41e8bda221b44d09d7e93ffc43675147ab60a6d (diff)
Refactor mling to use new program architecture and install scripts
Diffstat (limited to 'mling/src/cli/install.rs')
-rw-r--r--mling/src/cli/install.rs32
1 files changed, 0 insertions, 32 deletions
diff --git a/mling/src/cli/install.rs b/mling/src/cli/install.rs
deleted file mode 100644
index cca7483..0000000
--- a/mling/src/cli/install.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-use mingling::{
- ShellContext, Suggest,
- macros::{chain, completion, dispatcher, pack, suggest},
- parser::Picker,
-};
-
-use crate::{Next, project_installer::install_all};
-
-dispatcher!("install", InstallCommand => InstallEntry);
-
-pack!(ResultInstallCompleted = ());
-
-#[completion(InstallEntry)]
-pub(crate) fn comp_install(ctx: &ShellContext) -> Suggest {
- if ctx.typing_argument() {
- return suggest! {
- "--clean": "Clean build artifacts before installation",
- "-c": "Clean build artifacts before installation",
- };
- }
- return suggest!();
-}
-
-#[chain]
-pub(crate) fn handle_install_entry(prev: InstallEntry) -> Next {
- let is_clean_before_build = Picker::new(prev.inner)
- .pick::<bool>(["--clean", "-c"])
- .unpack();
- let _ = install_all(is_clean_before_build);
-
- ResultInstallCompleted::new(())
-}