From 08190ac179d73f656500fc12ad8a4ffe4b07c08a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 19:09:59 +1000 Subject: [PATCH] Add `ManifestPathConflictedWithBatchInstallation` to error `BinstallError` Signed-off-by: Jiahao XU --- src/errors.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/errors.rs b/src/errors.rs index ec19f29a..6be71942 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -175,6 +175,16 @@ pub enum BinstallError { help("Remove the `--version req` or simply use `$crate_name`") )] DuplicateVersionReq, + + /// This occurs when you specified `--manifest-path` while also + /// specifing multiple crates to install. + #[error("If you use --manifest-path, then you can only specify one crate to install")] + #[diagnostic( + severity(error), + code(binstall::manifest_path), + help("Remove the `--manifest-path` or only specify one `$crate_name`") + )] + ManifestPathConflictedWithBatchInstallation, } impl BinstallError { @@ -202,6 +212,7 @@ impl BinstallError { VersionMismatch { .. } => 82, VersionUnavailable { .. } => 83, DuplicateVersionReq => 84, + ManifestPathConflictedWithBatchInstallation => 85, }; // reserved codes