mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-22 04:51:12 +02:00
feat(pass-cli): add completions plugin (#13740)
This commit is contained in:
parent
efd6135bf5
commit
24959d5817
2 changed files with 25 additions and 0 deletions
11
plugins/pass-cli/README.md
Normal file
11
plugins/pass-cli/README.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Proton Pass CLI plugin
|
||||
|
||||
This plugin adds completions for [Proton Pass CLI](https://protonpass.github.io/pass-cli/).
|
||||
|
||||
To use it, add `pass-cli` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... pass-cli)
|
||||
```
|
||||
|
||||
This plugin does not add any aliases.
|
||||
14
plugins/pass-cli/pass-cli.plugin.zsh
Normal file
14
plugins/pass-cli/pass-cli.plugin.zsh
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Autocompletion for Proton Pass CLI (pass-cli)
|
||||
if (( ! $+commands[pass-cli] )); then
|
||||
return
|
||||
fi
|
||||
|
||||
# If the completion file doesn't exist yet, we need to autoload it and
|
||||
# bind it to `pass-cli`. Otherwise, compinit will have already done that.
|
||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_pass-cli" ]]; then
|
||||
typeset -g -A _comps
|
||||
autoload -Uz _pass-cli
|
||||
_comps[pass-cli]=_pass-cli
|
||||
fi
|
||||
|
||||
pass-cli completions zsh >| "$ZSH_CACHE_DIR/completions/_pass-cli" &|
|
||||
Loading…
Add table
Add a link
Reference in a new issue