750b7abcd5
- .claude/CLAUDE.md - .claude/agents/fn-recopilador/SKILL.md - .claude/rules/INDEX.md - .claude/rules/cpp_apps.md - bash/functions/infra/build_cpp_windows.sh - cpp/CMakeLists.txt - cpp/PATTERNS.md - cpp/framework/app_base.cpp - cpp/framework/app_base.h - dev/issues/README.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
40 lines
1018 B
Bash
40 lines
1018 B
Bash
# keepass_list
|
|
# ------------
|
|
# Lista paths de entries del KeePassXC database como array JSON.
|
|
# Filtra opcionalmente por prefijo de grupo.
|
|
#
|
|
# REQUIERE:
|
|
# - keepass_dump (sourced o en PATH del registry)
|
|
# - jq instalado
|
|
#
|
|
# USO (sourced):
|
|
# source keepass_dump.sh
|
|
# source keepass_list.sh
|
|
# all=$(keepass_list)
|
|
# servers=$(keepass_list "Servers/")
|
|
|
|
keepass_list() {
|
|
local prefix="$1"
|
|
|
|
if ! declare -F keepass_dump >/dev/null 2>&1; then
|
|
local here
|
|
here=$(dirname "${BASH_SOURCE[0]}")
|
|
if [ -f "$here/keepass_dump.sh" ]; then
|
|
# shellcheck source=keepass_dump.sh
|
|
source "$here/keepass_dump.sh"
|
|
else
|
|
echo "keepass_list: keepass_dump no disponible" >&2
|
|
return 1
|
|
fi
|
|
fi
|
|
|
|
local dump
|
|
dump=$(keepass_dump) || return 1
|
|
|
|
if [ -n "$prefix" ]; then
|
|
printf '%s' "$dump" | jq --arg p "$prefix" '[.[] | .path | select(startswith($p))]'
|
|
else
|
|
printf '%s' "$dump" | jq '[.[] | .path]'
|
|
fi
|
|
}
|