Skip to content

Commit

Permalink
list options for each report in config file
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhantac committed Aug 4, 2024
1 parent dc455ea commit 50c9ae4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
13 changes: 12 additions & 1 deletion config.debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@
"reports": [
{
"name": "assets",
"cmd": "hledger balance type:a -f data/hledger.journal "
"cmd": "hledger balance type:a -f data/hledger.journal ",
"options": [
"acct",
"begin",
"end",
"depth",
"drop",
"tree",
"average",
"layout",
"sort"
]
},
{
"name": "expenses",
Expand Down
7 changes: 4 additions & 3 deletions ui/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (
)

type Report struct {
Cmd string `json:"cmd"`
Name string `json:"name"`
Locked bool `json:"locked"`
Cmd string `json:"cmd"`
Name string `json:"name"`
Locked bool `json:"locked"`
Options []string `json:"options"`
}

type Config struct {
Expand Down
9 changes: 5 additions & 4 deletions ui/genericPager.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ type genericContent struct {

type genericPager struct {
*pager
id int
locked bool
cmd func(options hledger.Options) string
id int
locked bool
cmd func(options hledger.Options) string
options hledger.Options
}

func newGenericPager(id int, name string, locked bool, cmd func(options hledger.Options) string) *genericPager {
func newGenericPager(id int, name string, locked bool, cmd func(options hledger.Options) string, options hledger.Options) *genericPager {
p := newPager(name)
p.ready = true
return &genericPager{
Expand Down

0 comments on commit 50c9ae4

Please sign in to comment.