From 266af7353a1cff388f39a4104b2db50da36af3ed Mon Sep 17 00:00:00 2001 From: bel Date: Thu, 3 Apr 2025 22:32:56 -0600 Subject: [PATCH] cli accepts -with PATTERN to filter transactions by all attendees --- cmd/cli/main.go | 4 ++++ cmd/cli/query.go | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/cli/main.go b/cmd/cli/main.go index ef4ee7d..00afd6f 100644 --- a/cmd/cli/main.go +++ b/cmd/cli/main.go @@ -87,6 +87,10 @@ func Main() { deltas = ana.NewDefaultNormalizer().Normalize(deltas) } + if config.Query.With != "" { + deltas = deltas.Like(ledger.LikeWith(config.Query.With)) + } + switch cmd[:3] { case "bal": balances := deltas.Balances(). diff --git a/cmd/cli/query.go b/cmd/cli/query.go index e8e1a55..f5db8fb 100644 --- a/cmd/cli/query.go +++ b/cmd/cli/query.go @@ -71,10 +71,6 @@ func buildQuery(config Config, args args) (ledger.Like, error) { } } - if config.Query.With != "" { - like = andLike(like, ledger.LikeWith(config.Query.With)) - } - return like, nil }