jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
8.11k stars 214 forks source link

`mise completion` outputs an error even though `usage` is installed. #2200

Open rawalplawit opened 1 month ago

rawalplawit commented 1 month ago

Describe the bug Hi, i'm getting usage not installed when trying to generate the completions in fish.

➜ usage -V                                                                                                                                                                                                                                                                                                                                        
usage-cli 0.3.0

➜ mise completion fish --verbose

[DEBUG] ARGS: mise completion fish --verbose
[DEBUG] $ usage generate completion fish mise --usage-cmd mise usage
# if "usage" is not installed show an error
if ! command -v usage &> /dev/null
    echo >&2
    echo "Error: usage CLI not found. This is required for completions to work in mise." >&2
    echo "See https://usage.jdx.dev for more information." >&2
    return 1
end

set _usage_spec_mise (mise usage | string collect)
complete -xc mise -a '(usage complete-word --shell fish -s "$_usage_spec_mise" -- (commandline -cop) (commandline -t))'

To Reproduce mise completion fish

Expected behavior The command mise completion <shell> should print out the relevant completions in stdout.

mise doctor output

version: 2024.5.23 linux-x64 (2024-05-27)
activated: yes
shims_on_path: no

build_info: 
  Target: x86_64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS
  Built: Mon, 27 May 2024 03:41:45 +0000
  Rust Version: rustc 1.80.0-nightly (bdbbb6c6a 2024-05-26)
  Profile: release

shell: 
  /usr/bin/fish
  fish, version 3.7.1

dirs: 
  data: ~/.local/share/mise
  config: ~/.config/mise
  cache: ~/.cache/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files: 
  ~/.config/mise/config.toml

backends: 
  cargo
  core
  go
  npm
  pipx
  ubi

plugins: 
  bun     (core)
  deno    (core)
  erlang  (core)
  gleam   https://github.com/asdf-community/asdf-gleam.git#b45a651
  go      (core)
  java    (core)
  node    (core)
  python  (core)
  ruby    (core)
  usage   https://github.com/jdx/mise-usage.git#fe3888a

toolset: 
  node@22.2.0    
  ruby@3.3.1     
  bun@system     
  usage@0.3.0    
  erlang@system  
  elixir@system  
  gleam@nightly  

env_vars: 
  MISE_SHELL=fish

settings: 
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf_compat = false
  cargo_binstall = true
  color = true
  disable_default_shorthands = false
  disable_tools = []
  experimental = false
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  node_compile = false
  not_found_auto_install = true
  paranoid = false
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "/home/elric/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  raw = false
  trusted_config_paths = []
  quiet = false
  verbose = true
  yes = false
  ci = false
  debug = false
  trace = false
  log_level = "debug"
  python_venv_auto_create = false

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false

No warnings found
No problems found