Add ManifestPathConflictedWithBatchInstallation

to error `BinstallError`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-07-20 19:09:59 +10:00
parent bcb97803c3
commit 08190ac179
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -175,6 +175,16 @@ pub enum BinstallError {
help("Remove the `--version req` or simply use `$crate_name`") help("Remove the `--version req` or simply use `$crate_name`")
)] )]
DuplicateVersionReq, 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 { impl BinstallError {
@ -202,6 +212,7 @@ impl BinstallError {
VersionMismatch { .. } => 82, VersionMismatch { .. } => 82,
VersionUnavailable { .. } => 83, VersionUnavailable { .. } => 83,
DuplicateVersionReq => 84, DuplicateVersionReq => 84,
ManifestPathConflictedWithBatchInstallation => 85,
}; };
// reserved codes // reserved codes