From e2083fe8d58f73a03f072eeeb6cf7f267c10735c Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sat, 3 Dec 2022 21:02:40 -0500 Subject: Add an option to copy a full file to the clipboard --- dpw | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dpw b/dpw index 29ed97e..d21f8f5 100755 --- a/dpw +++ b/dpw @@ -60,6 +60,7 @@ EOF _printH "show " "dumps secret to stdout" _printH "copy " "copies the first line of the secret to the clipboard" +_printH "copyf " "copies the entire secret to the clipboard" _printH "type " "types the first line of the secret with xdotool" _printH "list []" "dumps a listing of all subkeys if key is supplied" _printH "ls []" "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 ;; -- cgit v1.2.3