From 4588f4bf54ae6eefd7a75904d81ce2256afb805d Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 1 Jul 2026 11:37:53 +0200 Subject: feat: tx add echoes transfer direction to stderr (v0.3.5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Transfers are easy to reverse silently (swapped --from/--to), showing up later as a 2x balance discrepancy (ISSUES.md #5). On a transfer, tx add now prints "transfer: , " to stderr before writing, in both the real-write and --dry-run paths. stdout JSON and exit codes are unchanged, so the contract holds; PATCH bump. Withdrawals/deposits are unaffected. Co-Authored-By: Claude Opus 4.8 --- firefly_cli/__init__.py | 2 +- firefly_cli/commands/transaction.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'firefly_cli') diff --git a/firefly_cli/__init__.py b/firefly_cli/__init__.py index b7a8764..4b170ef 100644 --- a/firefly_cli/__init__.py +++ b/firefly_cli/__init__.py @@ -2,4 +2,4 @@ # Copyright (C) 2026 Danilo M. # Licensed under the GNU General Public License v2.0 only. -__version__ = "0.3.4" +__version__ = "0.3.5" diff --git a/firefly_cli/commands/transaction.py b/firefly_cli/commands/transaction.py index 8d858b6..df1ffc4 100644 --- a/firefly_cli/commands/transaction.py +++ b/firefly_cli/commands/transaction.py @@ -54,6 +54,13 @@ def cmd_add(args, ctx): split["category_name"] = args.category if args.tags: split["tags"] = [t.strip() for t in args.tags.split(",") if t.strip()] + if ttype == "transfer": + # Transfer direction is easy to reverse silently (ISSUES.md #5); echo it + # to stderr so the user/agent can catch a swapped --from/--to. stdout + # JSON unchanged; shown for both real writes and --dry-run. + import sys + print(f'transfer: {src["name"]} → {dst["name"]}, {split["amount"]}', + file=sys.stderr) if args.dry_run: # Accounts already resolved above (missing name = hard error). Write nothing. # dry-run wins over skip-dupes: caller wants a preview, not a write. -- cgit v1.2.3