WIP cmd/cli$ go run ../ cli $(printf " -f %s" $HOME/Sync/Core/ledger/eras/2022-/*.txt) -n -w ^Housey --depth 1 -usd bal
All checks were successful
cicd / ci (push) Successful in 1m32s

This commit is contained in:
Bel LaPointe
2025-04-03 21:39:36 -06:00
parent 697fc16b52
commit dd20f066a3
3 changed files with 18 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ import (
type Query struct{}
func BuildQuery(args args) (ledger.Like, error) {
func BuildQuery(config Config, args args) (ledger.Like, error) {
var result ledger.Like
var err error
func() {
@@ -18,12 +18,12 @@ func BuildQuery(args args) (ledger.Like, error) {
err = fmt.Errorf("panicked: %v", err)
}
}()
result, err = buildQuery(args)
result, err = buildQuery(config, args)
}()
return result, err
}
func buildQuery(args args) (ledger.Like, error) {
func buildQuery(config Config, args args) (ledger.Like, error) {
likeName := func(s string) ledger.Like {
return ledger.LikeName(s)
}
@@ -71,6 +71,10 @@ func buildQuery(args args) (ledger.Like, error) {
}
}
if config.Query.With != "" {
like = andLike(like, ledger.LikeWith(config.Query.With))
}
return like, nil
}