Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/cli/args/backend_arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,23 @@ impl BackendArg {
bail!("{plugin_name} is not a valid plugin name");
}
} else {
// Check if the tool is in the registry but has no available backends
if let Some(rt) = REGISTRY.get(self.short.as_str())
&& rt.backends().is_empty()
&& !rt.backends.is_empty()
{
let all_backends: Vec<&str> = rt.backends.iter().map(|rb| rb.full).collect();
bail!(
"{self} is in the mise tool registry but none of its backends ({}) are supported in the current configuration",
all_backends.join(", ")
);
}

let registry_shorts: Vec<&str> = REGISTRY.keys().copied().collect();
let mut suggestions: Vec<String> =
xx::suggest::similar_n_with_threshold(&self.short, &registry_shorts, 3, 0.8)
.into_iter()
.filter(|s| *s != self.short)
.map(|s| s.to_string())
.collect();

Expand Down
Loading