-
Notifications
You must be signed in to change notification settings - Fork 96
Description
Describe the bug
Completion installation seems to complete, but logs an error at the end of the process. The correct scripts are generated
"error" is output every time you hit tab to attempt to use auto complete.
This happens with my own CLI app that I'm migrating from Caporal 1.x to 2.x as well as with the "pizza" example.
To Reproduce
- Clone the repo
npm ci
in the rootnpm run build
in the rootcd examples
npm ci
npm link
pizza --install-completion
- Choose
zsh
- Enter
Y
when prompted to install the completion to~/.zshrc
- Observe the output. The last statement will be: "error: Unknown command --install-completion"
- Reload your shell
- enter
pizza
and hit tab - Observe the output. The word "error" is output next to "pizza ".
Environment informations (please complete the following information):
- OS: macOS on an Intel Mac
- OS version: 11.0.1
- Shell: zsh
- Caporal version: 2.0.2 (master branch as of 540bd81)
- node: 12.18.3
- nvm: 6.14.8
Additional context
I suspected the issue may be tabtab
but I cannot reproduce this issue using tabtab
's example, which works as expected.
Output from my shell
- Output from
pizza --install-completion
$ pizza --install-completion
? Which Shell do you use ? zsh
? We will install completion to ~/.zshrc, is it ok ? Yes
=> Tabtab line already exists in ~/.zshrc file
=> Tabtab line already exists in ~/.config/tabtab/__tabtab.zsh file
=> Wrote completion script to /Users/georgecox/.config/tabtab/pizza.zsh file
=> Tabtab source line added to ~/.zshrc for pizza package.
Make sure to reload your SHELL.
error: Unknown command --install-completion.
- Output from entering
pizza
then hitting tab.
$ pizza error
- Running
pizza completion
also produces an error: "error: Unknown command completion". Since that's what the completion script calls, I'm guessing thecompletion
command isn't getting registered correctly for some reason.
Update 1
Confirmed that the error being thrown when typing pizza
+ tab is, indeed, "Unknown command completion"
Update 2
It doesn't look like completion has worked at all in v2.x. The unit tests call complete
directly and do not test whether it is called when the completion -- ???
command is run.