progress i guess
parent
889dc48d6c
commit
1a2c88687f
|
|
@ -37,10 +37,24 @@ func Main() {
|
|||
}
|
||||
cmd := positional[0]
|
||||
|
||||
likes := []ledger.Like{}
|
||||
for _, query := range positional[1:] {
|
||||
panic(query)
|
||||
panic(likes)
|
||||
likePattern := ""
|
||||
notLikePattern := ""
|
||||
i := 1
|
||||
for i < len(positional) {
|
||||
switch positional[i] {
|
||||
case "not":
|
||||
_ = notLikePattern
|
||||
panic(positional[i:])
|
||||
case "and":
|
||||
panic(positional[i:])
|
||||
default:
|
||||
if likePattern == "" {
|
||||
likePattern = positional[i]
|
||||
} else {
|
||||
likePattern = fmt.Sprintf("%s|%s", likePattern, positional[i])
|
||||
}
|
||||
}
|
||||
i += 1
|
||||
}
|
||||
|
||||
deltas, err := ledgerFiles.Deltas()
|
||||
|
|
@ -64,6 +78,12 @@ func Main() {
|
|||
switch cmd[:3] {
|
||||
case "bal":
|
||||
balances := deltas.Balances()
|
||||
if likePattern != "" {
|
||||
balances = balances.Like(likePattern)
|
||||
}
|
||||
if notLikePattern != "" {
|
||||
balances = balances.NotLike(notLikePattern)
|
||||
}
|
||||
|
||||
keys := []string{}
|
||||
for k := range balances {
|
||||
|
|
|
|||
Loading…
Reference in New Issue