jdx/usage

"Panic: unexpected word" should silently do nothing

mrak opened this issue · 0 comments

mrak commented

I observed this behavior in mise Tab-completion, but it appears to be a bug in usage due to an uncaught panic.

Steps to reproduce:

  1. Install mise
  2. Run mise completion fish | source (or for your shell)
  3. Run mise use -g usage
  4. Type mise add (with trailing space)
  5. Press Tab

Observed behavior:

$ mise add thread 'main' panicked at lib/src/cli.rs:155:9:
unexpected word: add
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected behavior (no output as there are no possible completions):

$ mise add

While informative for the library developer, this should probably be a silent exit 0 with no suggestions when used for tab completion.