diff --git a/completions/_mise b/completions/_mise index 3d0ef61575..af5bf03024 100644 --- a/completions/_mise +++ b/completions/_mise @@ -27,11 +27,11 @@ _mise() { zstyle ":completion:${curcontext}:" cache-policy _usage_mise_cache_policy fi - if ( [[ -z "${_usage_spec_mise_2025_7_5:-}" ]] || _cache_invalid _usage_spec_mise_2025_7_5 ) \ - && ! _retrieve_cache _usage_spec_mise_2025_7_5; + if ( [[ -z "${_usage_spec_mise_2025_7_7:-}" ]] || _cache_invalid _usage_spec_mise_2025_7_7 ) \ + && ! _retrieve_cache _usage_spec_mise_2025_7_7; then spec="$(mise usage)" - _store_cache _usage_spec_mise_2025_7_5 spec + _store_cache _usage_spec_mise_2025_7_7 spec fi _arguments "*: :(($(usage complete-word --shell zsh -s "$spec" -- "${words[@]}" )))" diff --git a/completions/mise.bash b/completions/mise.bash index 6b948ee7e5..e39efb2516 100644 --- a/completions/mise.bash +++ b/completions/mise.bash @@ -6,14 +6,14 @@ _mise() { return 1 fi - if [[ -z ${_usage_spec_mise_2025_7_5:-} ]]; then - _usage_spec_mise_2025_7_5="$(mise usage)" + if [[ -z ${_usage_spec_mise_2025_7_7:-} ]]; then + _usage_spec_mise_2025_7_7="$(mise usage)" fi local cur prev words cword was_split comp_args _comp_initialize -n : -- "$@" || return # shellcheck disable=SC2207 - _comp_compgen -- -W "$(usage complete-word --shell bash -s "${_usage_spec_mise_2025_7_5}" --cword="$cword" -- "${words[@]}")" + _comp_compgen -- -W "$(usage complete-word --shell bash -s "${_usage_spec_mise_2025_7_7}" --cword="$cword" -- "${words[@]}")" _comp_ltrim_colon_completions "$cur" # shellcheck disable=SC2181 if [[ $? -ne 0 ]]; then diff --git a/completions/mise.fish b/completions/mise.fish index 95b145cd11..584d07bc15 100644 --- a/completions/mise.fish +++ b/completions/mise.fish @@ -6,12 +6,12 @@ if ! command -v usage &> /dev/null return 1 end -if ! set -q _usage_spec_mise_2025_7_5 - set -g _usage_spec_mise_2025_7_5 (mise usage | string collect) +if ! set -q _usage_spec_mise_2025_7_7 + set -g _usage_spec_mise_2025_7_7 (mise usage | string collect) end set -l tokens if commandline -x >/dev/null 2>&1 - complete -xc mise -a '(usage complete-word --shell fish -s "$_usage_spec_mise_2025_7_5" -- (commandline -xpc) (commandline -t))' + complete -xc mise -a '(usage complete-word --shell fish -s "$_usage_spec_mise_2025_7_7" -- (commandline -xpc) (commandline -t))' else - complete -xc mise -a '(usage complete-word --shell fish -s "$_usage_spec_mise_2025_7_5" -- (commandline -opc) (commandline -t))' + complete -xc mise -a '(usage complete-word --shell fish -s "$_usage_spec_mise_2025_7_7" -- (commandline -opc) (commandline -t))' end diff --git a/src/backend/platform.rs b/src/backend/platform.rs index 04d0b11d22..a56a130b88 100644 --- a/src/backend/platform.rs +++ b/src/backend/platform.rs @@ -32,14 +32,16 @@ pub fn platform_aliases() -> Vec<(String, String)> { /// Looks up a value in a BTreeMap using all possible platform key aliases. /// Example: for key_type = "url", will check platform_macos_x64_url, platform_darwin_amd64_url, etc. +/// Also supports both "platforms_" and "platform_" prefixes. pub fn lookup_platform_key<'a>( opts: &'a BTreeMap, key_type: &str, ) -> Option<&'a String> { for (os, arch) in platform_aliases() { - let key = format!("platform_{os}_{arch}_{key_type}"); - if let Some(val) = opts.get(&key) { - return Some(val); + for prefix in ["platforms", "platform"] { + if let Some(val) = opts.get(&format!("{prefix}_{os}_{arch}_{key_type}")) { + return Some(val); + } } } None