refactor(1password): extract opswd function

This commit is contained in:
Marc Cornellà 2022-03-26 15:10:56 +01:00
commit a64d940377
No known key found for this signature in database
GPG key ID: 0314585E776A9C1B
3 changed files with 53 additions and 44 deletions

9
plugins/1password/_opswd Normal file
View file

@ -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 "$@"