Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List options for each report in config file #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading