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