From a64d9403775f45036daf3b66693c35df7bab3c53 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sat, 26 Mar 2022 15:10:56 +0100 Subject: refactor(1password): extract `opswd` function --- plugins/1password/_opswd | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/1password/_opswd (limited to 'plugins/1password/_opswd') 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 "$@" -- cgit v1.2.3-70-g09d2