mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-16 02:27:03 +01:00
feat(expressvpn): add plugin for ExpressVPN
This fix makes the autocompletion script also work on zsh without
changing how it works for Bash.
The expression "${COMP_WORDS[@]:2:$COMP_CWORD-2}" does not behave the
same on Bash and Zsh when the command has only zero or one arguments,
e.g. typing "expressvpn conne<TAB>" or "expressvpn <TAB>" would print
the error "autocomplete:8: substring expression: 1 < 2". This fixes it
by handling the case of the short command separately in a simpler way
and handling the rest of the cases the same way as before.
With this fix, zsh users just have to use the command "source
/usr/share/bash-completion/completions/expressvpn" to get the same
auto-completion as bash users.
File : /usr/share/bash-completion/completions/expressvpn
Diff to the original file (using the `diff` command) :
9a10,12
> opts=$( ${COMP_WORDS[0]} "$cmd" "${COMP_WORDS[@]:2:$COMP_CWORD-2}" --generate-bash-completion )
> else
> opts=$( ${COMP_WORDS[0]} --generate-bash-completion )
11d13
< opts=$( ${COMP_WORDS[0]} "$cmd" "${COMP_WORDS[@]:2:$COMP_CWORD-2}" --generate-bash-completion )
This commit is contained in:
parent
dfee71c773
commit
f56eb6de31
2 changed files with 63 additions and 0 deletions
14
plugins/expressvpn/README.md
Normal file
14
plugins/expressvpn/README.md
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# ExpressVPN
|
||||
|
||||
This plugin provides completion support for [`ExpressVPN`](https://www.expressvpn.com/vpn-software/vpn-linux)
|
||||
command line interface on Linux.
|
||||
|
||||
To use it, add expressvpn to the plugins array in your zshrc file.
|
||||
|
||||
```zsh
|
||||
plugins=(... expressvpn)
|
||||
```
|
||||
|
||||
## INSTALLATION NOTES
|
||||
|
||||
Besides oh-my-zsh, `expressvpn` needs to be installed by following these steps: https://www.expressvpn.com/support/vpn-setup/app-for-linux/.
|
||||
Loading…
Add table
Add a link
Reference in a new issue