diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-07 16:05:00 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-09 02:56:28 +0800 |
| commit | 25ece73e61cd5a9076c63fe884c84a86b35b5b42 (patch) | |
| tree | 2536540b176ecc3d4c1ba0a50bf3031d4fe07591 /mingling_cli/src/pkg_mgr.rs | |
| parent | c2de5313748e7d5f8ad7efee9ffecb513994443a (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"); +} |
