feat: --list option to list entries and exit

This commit is contained in:
2025-07-06 13:24:10 +02:00
parent e0a3905a72
commit 29214c6fe5
6 changed files with 45 additions and 8 deletions

View File

@@ -112,7 +112,9 @@ __new() {
collection=$(printf "%s" "$COLLECTION_LABELS" |
tr ';' '\n' |
$FZF \
--ansi \
--prompt="Choose collection> " \
--select-1 \
--no-sort \
--tac \
--margin="30%,30%" \
@@ -146,6 +148,9 @@ __new() {
while [ "$checksum" != "$(cksum "$tmpmd")" ]; do
tmpfile="$tmpmd.ics"
if awk -v uid="$uuid" "$AWK_NEW" "$tmpmd" >"$tmpfile"; then
if [ ! -d "$ROOT/$collection" ]; then
mkdir -p "$ROOT/$collection"
fi
mv "$tmpfile" "$file"
if [ -n "${GIT:-}" ]; then
$GIT add "$file"