summaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-08-25 19:40:40 +0300
committerThomas Voss <mail@thomasvoss.com> 2023-08-25 19:40:40 +0300
commite3d59bae4051a36f3c95523ca82b980ab8e464b4 (patch)
treef012e71d9ba89ea7f396982f6e72780c3a2e55bc /.local/bin
parentb9b163bbda84b58edd8e28ecdfa411adfa6888a2 (diff)
vlt: Add the ‘raw’ subcommand
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/vlt10
1 files changed, 10 insertions, 0 deletions
diff --git a/.local/bin/vlt b/.local/bin/vlt
index 32aea4d..92c2fda 100755
--- a/.local/bin/vlt
+++ b/.local/bin/vlt
@@ -291,6 +291,13 @@ edit_c()
[ ! -t 2 ] && notify 'Category Edit' "The category ‘$c’ was renamed"
}
+raw()
+{
+ shift
+ enchive extract <"$VAULT" \
+ | jq --arg c "$1" --arg n "$2" -r '.[$c] | .[$n]'
+}
+
: ${VAULT_2FA:="2fa"}
: ${VAULT_HOME:=${XDG_DATA_HOME:-$HOME/.local/share}/vault}
readonly VAULT="${VAULT_HOME}/vault.sec"
@@ -308,6 +315,9 @@ edit)
get)
get
;;
+raw)
+ raw "$@"
+ ;;
rm)
rm_ "$@"
;;