mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-19 07:38:28 +00:00
feat(pass-cli): add completions plugin (#13740)
This commit is contained in:
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" &|
|
||||
Reference in New Issue
Block a user