aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2022-12-03 21:02:40 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2022-12-03 21:02:47 -0500
commite2083fe8d58f73a03f072eeeb6cf7f267c10735c (patch)
tree6a597969d565b3ab323ab600cee1c1142fada769
parentfa176cd219bab720152891f6bc3bb20ea4e98664 (diff)
downloaddpw-e2083fe8d58f73a03f072eeeb6cf7f267c10735c.tar.gz
dpw-e2083fe8d58f73a03f072eeeb6cf7f267c10735c.tar.xz
Add an option to copy a full file to the clipboard
-rwxr-xr-xdpw10
1 files changed, 10 insertions, 0 deletions
diff --git a/dpw b/dpw
index 29ed97e..d21f8f5 100755
--- a/dpw
+++ b/dpw
@@ -60,6 +60,7 @@ EOF
_printH "show <key>" "dumps secret to stdout"
_printH "copy <key>" "copies the first line of the secret to the clipboard"
+_printH "copyf <key>" "copies the entire secret to the clipboard"
_printH "type <key>" "types the first line of the secret with xdotool"
_printH "list [<key>]" "dumps a listing of all subkeys if key is supplied"
_printH "ls [<key>]" "Same as above"
@@ -146,6 +147,14 @@ pth="$1"; shift
_clip_clear
}
+copyf() {
+pth="$1"; shift
+"${DPW_BACKEND}" show "$pth" \
+ | _clip
+
+_clip_clear
+}
+
_type() {
pth="$1"; shift
"${DPW_BACKEND}" show "$pth" \
@@ -268,6 +277,7 @@ case $1 in
;;
show) shift ;;
copy) action=copy; shift ;;
+ copyf) action=copyf; shift ;;
type) action=_type; shift ;;
list|ls) action=list; shift ;;
rm) action=remove; shift ;;