pash: simplify password show
This commit is contained in:
parent
225880b889
commit
f07b3145a0
9
pash
9
pash
@ -56,16 +56,11 @@ pw_del() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pw_show() {
|
pw_show() {
|
||||||
pass=$("$gpg" -dq "$1.gpg")
|
"$gpg" -dq "$1.gpg"
|
||||||
|
|
||||||
# If '$2' is defined, don't print the password to the
|
|
||||||
# terminal. For example, this is used when the password is
|
|
||||||
# copied to the clipboard.
|
|
||||||
[ "$2" ] || printf '%s\n' "$pass"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pw_copy() {
|
pw_copy() {
|
||||||
pw_show "$1" copy
|
pass=$(pw_show "$1")
|
||||||
|
|
||||||
# Disable warning against words-splitting as it is safe
|
# Disable warning against words-splitting as it is safe
|
||||||
# and intentional (globbing is disabled).
|
# and intentional (globbing is disabled).
|
||||||
|
Loading…
Reference in New Issue
Block a user