fix printing multiple word field names with spaces
This commit is contained in:
parent
e4e520f6f6
commit
40837d70af
@ -39,7 +39,7 @@ _pass_field() {
|
|||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
plaintext="$(pass show $password | tail -n +2)"
|
plaintext="$(pass show $password | tail -n +2)"
|
||||||
for line in $plaintext; do
|
for line in $plaintext; do
|
||||||
if [[ $line == $1:* ]]; then
|
if [[ $line =~ ^${1}:* ]]; then
|
||||||
printf "$(_trim "$(printf "$line" | cut -d: -f1 -s --complement)")"
|
printf "$(_trim "$(printf "$line" | cut -d: -f1 -s --complement)")"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -52,7 +52,7 @@ _pass_get() {
|
|||||||
elif [[ $1 == "OTP" ]]; then
|
elif [[ $1 == "OTP" ]]; then
|
||||||
pass otp "$password" | tail -n1 | { IFS= read -r pass; printf %s "$pass"; }
|
pass otp "$password" | tail -n1 | { IFS= read -r pass; printf %s "$pass"; }
|
||||||
else
|
else
|
||||||
printf "$(_pass_field $1)"
|
printf "$(_pass_field $*)"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user