diff options
| -rwxr-xr-x | dpw | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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" } |
