X-Git-Url: https://git.madduck.net/etc/zsh.git/blobdiff_plain/910ef4f05663ec9859e25ccf26318128e56f4ee8..5365f4cffcb93705d61c9f8df48ed710c93b6049:/.zsh/func/getpw diff --git a/.zsh/func/getpw b/.zsh/func/getpw old mode 100755 new mode 100644 index 7d93e42..108b4cd --- a/.zsh/func/getpw +++ b/.zsh/func/getpw @@ -7,7 +7,7 @@ # Copyright © 2011 martin f. krafft # Released under the terms of the Artistic Licence 2.0 # -# Source repository: git://git.madduck.net/etc/zsh.git +# Source repository: http://git.madduck.net/v/etc/zsh.git # local PWENCFILE=${HOME}/pw.gpg @@ -45,12 +45,12 @@ fi local IFSOLD="$IFS"; IFS=" " local output -gpg --decrypt --batch --quiet "$PWENCFILE" | \ +gpg --decrypt --quiet "$PWENCFILE" | \ { output=$(while read r i p o; do - case "$r/$i" in - (*${resource}*/${identity:+*${identity}}*) - echo "$r $i $p $o";; + case "$r:l/$i:l" in + (*${resource:l}*/${identity:+*${identity:l}}*) + echo "'$r' '$i' '$p' '$o'";; esac done) } @@ -64,8 +64,8 @@ if (( ${#results} == 1 )); then result=(${(z)${results[1]}}) output="${result[3]}" [[ $incother = 1 ]] && output="$output ${result[4]}" - echo "$output" | eval $dest - [[ $clip = 1 ]] && echo >&2 "match for ${result[2]}@${result[1]} put onto X clipboard." + eval echo "$output" | eval $dest + [[ $clip = 1 ]] && eval echo >&2 "match for ${result[1]}, ID ${result[2]} put onto X clipboard." else if [[ $clip = 1 ]]; then echo >&2 "E: multiple matches, hence not putting onto clipboard; use -p option." @@ -73,7 +73,7 @@ else fi for r in $results; do result=(${(z)r}) - output="${result[2]} ${result[3]}" + output="${result[2]}@${result[1]} ${result[3]}" [[ $incother = 1 ]] && output="$output ${result[4]}" echo "$output" done | eval $dest