feat: expand owner/repo shorthand for --install with a --git-host flag
--install someuser/repo expands to https://github.com/someuser/repo; --git-host overrides the default host and forces source interpretation even when the value matches an installed bundle name. Two or more path segments are accepted so nested GitLab-style groups work, and #ref pinning applies to shorthand values. --uninstall resolves owner/repo against recorded sources: a single match uninstalls, multiple matches prompt an interactive selection showing each bundle's source, and non-interactive runs bail instead of guessing.
This commit is contained in:
@@ -3500,11 +3500,16 @@ impl RequestContext {
|
||||
values = super::map_completion_values(
|
||||
InstallFilter::NAMES.iter().map(|s| s.to_string()).collect(),
|
||||
);
|
||||
} else if prev == "--git-host" {
|
||||
values = super::map_completion_values(vec!["github.com".to_string()]);
|
||||
} else {
|
||||
let has_filter = args.iter().enumerate().any(|(i, a)| {
|
||||
a.starts_with("--filter=") || (*a == "--filter" && i < args.len() - 1)
|
||||
});
|
||||
let has_force = args.contains(&"--force");
|
||||
let has_git_host = args.iter().enumerate().any(|(i, a)| {
|
||||
a.starts_with("--git-host=") || (*a == "--git-host" && i < args.len() - 1)
|
||||
});
|
||||
let mut available: Vec<&str> = vec![];
|
||||
|
||||
if !has_filter {
|
||||
@@ -3513,6 +3518,9 @@ impl RequestContext {
|
||||
if !has_force {
|
||||
available.push("--force");
|
||||
}
|
||||
if !has_git_host {
|
||||
available.push("--git-host");
|
||||
}
|
||||
|
||||
values = super::map_completion_values(available);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user