diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-07 16:05:00 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-07 16:57:24 +0800 |
| commit | 1d7efb22dc82780dc3fb1d3311188c0514d93991 (patch) | |
| tree | b6708a5d19b238249961aac8b607bea2da055565 /mingling_cli/src/pkg_mgr.rs | |
| parent | 180f72d307d75351bc8baa19b8ac662ef58fc35f (diff) | |
feat: implement pkg-enable and pkg-disable commands
Add package enable/disable functionality with version matching
for pkg-enable, and fix help text to reflect implemented commands.
Diffstat (limited to 'mingling_cli/src/pkg_mgr.rs')
| -rw-r--r-- | mingling_cli/src/pkg_mgr.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mingling_cli/src/pkg_mgr.rs b/mingling_cli/src/pkg_mgr.rs index 7aea59d..2f947df 100644 --- a/mingling_cli/src/pkg_mgr.rs +++ b/mingling_cli/src/pkg_mgr.rs @@ -1,4 +1,6 @@ pub mod cmd_install; +pub mod cmd_pkg_disable; +pub mod cmd_pkg_enable; pub mod cmd_uninstall; use std::path::PathBuf; @@ -12,6 +14,8 @@ use crate::ThisProgram; pack_err!(ErrorRootPackageNotFound); pack_err!(ErrorNoDataDirectory); +pack_err!(ErrorPackageSpecInvalid = String); +pack_err!(ErrorPackageNameRequired); /// The `.mingling` packages directory under the user's data directory. #[derive(Debug, Default, Clone)] @@ -38,3 +42,13 @@ pub fn render_error_root_package_not_found(_: ErrorRootPackageNotFound) { pub fn render_error_no_data_directory(_: ErrorNoDataDirectory) { r_println!("error: failed to determine the data directory"); } + +#[renderer(buffer)] +pub fn render_error_package_spec_invalid(err: ErrorPackageSpecInvalid) { + r_println!("error: invalid package spec: {}", err.info); +} + +#[renderer(buffer)] +pub fn render_error_package_name_required(_: ErrorPackageNameRequired) { + r_println!("error: a package name is required"); +} |
