diff options
author | Marc Cornellà <hello@mcornella.com> | 2022-03-26 15:10:56 +0100 |
---|---|---|
committer | Marc Cornellà <hello@mcornella.com> | 2022-03-26 15:10:56 +0100 |
commit | a64d9403775f45036daf3b66693c35df7bab3c53 (patch) | |
tree | 5f4ee1d442ad36966594969fe82043d113d2685f /plugins/1password/_opswd | |
parent | 4dce175e0e4a678b7f93be80c64247c8f5fbab3e (diff) | |
download | zsh-a64d9403775f45036daf3b66693c35df7bab3c53.tar.gz zsh-a64d9403775f45036daf3b66693c35df7bab3c53.tar.bz2 zsh-a64d9403775f45036daf3b66693c35df7bab3c53.zip |
refactor(1password): extract `opswd` function
Diffstat (limited to 'plugins/1password/_opswd')
-rw-r--r-- | plugins/1password/_opswd | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/1password/_opswd b/plugins/1password/_opswd new file mode 100644 index 000000000..b92bf8fc8 --- /dev/null +++ b/plugins/1password/_opswd @@ -0,0 +1,9 @@ +#compdef opswd + +function _opswd() { + local -a services + services=("${(@f)$(op list items --categories Login 2>/dev/null | op get item - --fields title 2>/dev/null)}") + [[ -z "$services" ]] || compadd -a -- services +} + +_opswd "$@" |