lastpass / lastpass-cli

LastPass command line interface tool
GNU General Public License v2.0
2.85k stars 292 forks source link

zsh completion not working #407

Open bedge opened 6 years ago

bedge commented 6 years ago

This was already filed here: https://github.com/lastpass/lastpass-cli/issues/297 Merged here: https://github.com/lastpass/lastpass-cli/pull/379 but seems non-functional.

1) No comment in the 'info' output to show what file to source for zsh?

eg: See last line:

Should there be a comment added to the 'info' text to show what file to source for zsh?

❯ brew info lastpass-cli lastpass-cli: stable 1.3.0 (bottled), HEAD .... ==> Caveats Bash completion has been installed to: /usr/local/etc/bash_completion.d

An an example, awscli, which provides both bash & zsh completion:

Bash completion has been installed to: /usr/local/etc/bash_completion.d zsh completions and functions have been installed to: /usr/local/share/zsh/site-functions Completion file is symlinked into /usr/local/share/zsh/site-functions:

The resultant completion file should end up here:

❯ ls -l /usr/local/share/zsh/site-functions total 0 lrwxr-xr-x 1 bedge admin 60 May 1 11:25 _aws -> ../../../Cellar/awscli/1.15.10/share/zsh/site-functions/_aws lrwxr-xr-x 1 bedge admin 39 Apr 23 18:35 _brew -> ../../../Homebrew/completions/zsh/_brew

2) The zsh completion file is not included in the package:

❯ find /usr/local/Cellar/lastpass-cli/1.3.0 -name *completion* /usr/local/Cellar/lastpass-cli/1.3.0/etc/bash_completion.d /usr/local/Cellar/lastpass-cli/1.3.0/etc/bash_completion.d/lpass_bash_completion /usr/local/Cellar/lastpass-cli/1.3.0/share/fish/vendor_completions.d /usr/local/Cellar/lastpass-cli/1.3.0/share/fish/vendor_completions.d/completions-lpass.fish

project0 commented 6 years ago

Works fine with linux (using Arch). If file is missing or wrong placed, its more a problem of the packaging: https://github.com/Homebrew/homebrew-core/blob/master/Formula/lastpass-cli.rb#L29