pfs (417B)
1 #!/bin/sh 2 3 # reliable password fuzzy searcher 4 5 : ${PASSWORD_STORE_DIR?"Error var not set"} 6 cd "${PASSWORD_STORE_DIR}" || exit 1 7 8 PASSTOOL=spm 9 type ${PASSTOOL} 2>/dev/null || PASSTOOL=pass 10 11 selection="$(find -L . -name '*.gpg' | sed 's/.gpg$//g' | ${FUZZER})" 12 13 test -z "${selection}" || { 14 case ${selection} in 15 *totp/*) pass ${1:-"otp"} "${selection}" ;; 16 ?*)pass ${1:-"show"} "${selection}" ;; 17 esac 18 }