From e3d59bae4051a36f3c95523ca82b980ab8e464b4 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 25 Aug 2023 19:40:40 +0300 Subject: vlt: Add the ‘raw’ subcommand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .local/bin/vlt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to '.local') 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_ "$@" ;; -- cgit v1.2.3