aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2022-11-20 21:28:53 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2022-11-20 21:28:53 -0500
commit0feed1f952385b6b041805db01012e5e4140f258 (patch)
treeff4eeeddd0e3b9dfbe87986ebfc262833a6fd037
parentfefc6c24ddf29bb29cb7d4c2713a4fde9dab0e25 (diff)
downloaddpw-0feed1f952385b6b041805db01012e5e4140f258.tar.gz
dpw-0feed1f952385b6b041805db01012e5e4140f258.tar.xz
Add a note about 'dpw-env' and allow editing on backends that don't support overwrite
-rwxr-xr-xdpw17
1 files changed, 16 insertions, 1 deletions
diff --git a/dpw b/dpw
index a342366..29ed97e 100755
--- a/dpw
+++ b/dpw
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright 2021 Mitchell Riedstra
+# Copyright 2022 Mitchell Riedstra
#
# Permission to use, copy, modify, and/or distribute this software for any purpose
# with or without fee is hereby granted, provided that the above copyright notice
@@ -84,6 +84,20 @@ If you're using oksh / OpenBSD KSH, completion can be installled with:
show copy type list ls mv cp rm edit otp fnd find insert \\
&& set -A complete_dpw_2 -- \$(dpw list)
+If you would like to make exporting environment variables from passwords easy
+a shell function can be used:
+
+dpw-env() {
+ _f="\$(mktemp)"
+ pass "\$@" > "\$_f"
+ #shellcheck disable=SC1090
+ . "\$_f"
+ rm -f "\$_f"
+}
+
+Just be careful, that will lead your shell to executaing whatever the contents
+of that particular entry are.
+
EOF
exit 0
@@ -180,6 +194,7 @@ _f="$(mktemp "${tmpdir}/dpw.XXXXXXXXXX")"
trap "rm -f \"$_f\"; exit 0" EXIT INT
show "$_pth" > "$_f"
${EDITOR:-vi} "$_f"
+remove "$_pth"
insert "$_pth" < "$_f"
rm -f "$_f"
}