Volta: Completion for `volta list` is broken in Zsh

Created on 18 Jun 2020  路  3Comments  路  Source: volta-cli/volta

% zsh --version
zsh 5.8 (x86_64-apple-darwin19.3.0)
% volta --version
0.8.2

% fpath=(~/.zsh/functions $fpath)
% volta completions zsh -f -o ~/.zsh/functions/_volta
success: installed completions to /Users/uasi/.zsh/functions/_volta

# Type `volta list <Tab>`
% volta list (eval):1: command not found: all                                                                                                                                             [master ~]
_arguments:453: command not found: ,

The use of : in the help message for volta list is invalid.

# ~/.zsh/functions/_volta line 93-106
_arguments "${_arguments_options[@]}" \
'--format=[Specify the output format]: :(human plain)' \
'(-d --default)-c[Show the currently-active tool(s)]' \
'(-d --default)--current[Show the currently-active tool(s)]' \
'(-c --current)-d[Show your default tool(s).]' \
'(-c --current)--default[Show your default tool(s).]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'--verbose[Enables verbose diagnostics]' \
'(--verbose)--quiet[Prevents unnecessary output]' \
'::tool -- The tool to lookup: `all`, `node`, `yarn`, or the name of a package or binary.:_files' \

Ref: zsh: 20 Completion System

bug

All 3 comments

Thanks for the investigation @uasi! We had an outstanding issue #496 where I noted the problem with volta list, but I didn't have the experience with the completions format to understand how to tackle it. With what you found it was straightforward, and I opened #772 to avoid using : characters in the description.

@uasi Just released Volta 0.8.3, which includes the fix for this. Thanks again for the investigation making it an easy fix!

@charlespierce Thanks for letting me now! I'm impressed that your replies are always quick and helpful.

Was this page helpful?
0 / 5 - 0 ratings