bal, bs, cf, is: update flat/tree help; order options a bit better
This commit is contained in:
parent
f5e1fb2625
commit
09b1736d5a
@ -12,6 +12,7 @@ module Hledger.Cli.CliOptions (
|
|||||||
-- * cmdargs flags & modes
|
-- * cmdargs flags & modes
|
||||||
helpflags,
|
helpflags,
|
||||||
detailedversionflag,
|
detailedversionflag,
|
||||||
|
flattreeflags,
|
||||||
hiddenflags,
|
hiddenflags,
|
||||||
inputflags,
|
inputflags,
|
||||||
reportflags,
|
reportflags,
|
||||||
@ -190,6 +191,13 @@ reportflags = [
|
|||||||
])
|
])
|
||||||
]
|
]
|
||||||
|
|
||||||
|
-- | Flags for selecting flat/tree mode, used in accounts/balance reports.
|
||||||
|
flattreeflags :: [Flag RawOpts]
|
||||||
|
flattreeflags = [
|
||||||
|
flagNone ["flat"] (setboolopt "flat") "show accounts as a list; amounts exclude subaccounts, except where account is depth-clipped"
|
||||||
|
,flagNone ["tree"] (setboolopt "tree") "show accounts as a tree; amounts include subaccounts"
|
||||||
|
]
|
||||||
|
|
||||||
-- | Common flags that are accepted but not shown in --help,
|
-- | Common flags that are accepted but not shown in --help,
|
||||||
-- such as --effective, --aux-date.
|
-- such as --effective, --aux-date.
|
||||||
hiddenflags :: [Flag RawOpts]
|
hiddenflags :: [Flag RawOpts]
|
||||||
|
|||||||
@ -38,8 +38,8 @@ accountsmode = hledgerCommandMode
|
|||||||
$(embedFileRelative "Hledger/Cli/Commands/Accounts.txt")
|
$(embedFileRelative "Hledger/Cli/Commands/Accounts.txt")
|
||||||
[flagNone ["declared"] (setboolopt "declared") "show account names declared with account directives"
|
[flagNone ["declared"] (setboolopt "declared") "show account names declared with account directives"
|
||||||
,flagNone ["used"] (setboolopt "used") "show account names referenced by transactions"
|
,flagNone ["used"] (setboolopt "used") "show account names referenced by transactions"
|
||||||
,flagNone ["tree"] (setboolopt "tree") "show short account names, as a tree"
|
|
||||||
,flagNone ["flat"] (setboolopt "flat") "show full account names, as a list (default)"
|
,flagNone ["flat"] (setboolopt "flat") "show full account names, as a list (default)"
|
||||||
|
,flagNone ["tree"] (setboolopt "tree") "show short account names, as a tree"
|
||||||
,flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "flat mode: omit N leading account name parts"
|
,flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "flat mode: omit N leading account name parts"
|
||||||
]
|
]
|
||||||
[generalflagsgroup1]
|
[generalflagsgroup1]
|
||||||
|
|||||||
@ -279,20 +279,20 @@ balancemode = hledgerCommandMode
|
|||||||
"show balance change accumulated across periods (in multicolumn reports)"
|
"show balance change accumulated across periods (in multicolumn reports)"
|
||||||
,flagNone ["historical","H"] (setboolopt "historical")
|
,flagNone ["historical","H"] (setboolopt "historical")
|
||||||
"show historical ending balance in each period (includes postings before report start date)\n "
|
"show historical ending balance in each period (includes postings before report start date)\n "
|
||||||
,flagNone ["tree"] (setboolopt "tree") "show accounts as a tree; amounts include subaccounts (default in simple reports)"
|
]
|
||||||
,flagNone ["flat"] (setboolopt "flat") "show accounts as a list; amounts exclude subaccounts except when account is depth-clipped (default in multicolumn reports)\n "
|
++ flattreeflags ++
|
||||||
|
[flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "omit N leading account name parts (in flat mode)"
|
||||||
,flagNone ["average","A"] (setboolopt "average") "show a row average column (in multicolumn reports)"
|
,flagNone ["average","A"] (setboolopt "average") "show a row average column (in multicolumn reports)"
|
||||||
,flagNone ["row-total","T"] (setboolopt "row-total") "show a row total column (in multicolumn reports)"
|
,flagNone ["row-total","T"] (setboolopt "row-total") "show a row total column (in multicolumn reports)"
|
||||||
,flagNone ["no-total","N"] (setboolopt "no-total") "omit the final total row"
|
,flagNone ["no-total","N"] (setboolopt "no-total") "omit the final total row"
|
||||||
,flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "omit N leading account name parts (in flat mode)"
|
|
||||||
,flagNone ["no-elide"] (setboolopt "no-elide") "don't squash boring parent accounts (in tree mode)"
|
,flagNone ["no-elide"] (setboolopt "no-elide") "don't squash boring parent accounts (in tree mode)"
|
||||||
,flagReq ["format"] (\s opts -> Right $ setopt "format" s opts) "FORMATSTR" "use this custom line format (in simple reports)"
|
,flagReq ["format"] (\s opts -> Right $ setopt "format" s opts) "FORMATSTR" "use this custom line format (in simple reports)"
|
||||||
,flagNone ["pretty-tables"] (setboolopt "pretty-tables") "use unicode to display prettier tables"
|
,flagNone ["pretty-tables"] (setboolopt "pretty-tables") "use unicode to display prettier tables"
|
||||||
,flagNone ["sort-amount","S"] (setboolopt "sort-amount") "sort by amount instead of account code/name (in flat mode). With multiple columns, sorts by the row total, or by row average if that is displayed."
|
,flagNone ["sort-amount","S"] (setboolopt "sort-amount") "sort by amount instead of account code/name (in flat mode). With multiple columns, sorts by the row total, or by row average if that is displayed."
|
||||||
,flagNone ["budget"] (setboolopt "budget") "show performance compared to budget goals defined by periodic transactions"
|
,flagNone ["percent", "%"] (setboolopt "percent") "express values in percentage of each column's total"
|
||||||
,flagNone ["invert"] (setboolopt "invert") "display all amounts with reversed sign"
|
,flagNone ["invert"] (setboolopt "invert") "display all amounts with reversed sign"
|
||||||
,flagNone ["transpose"] (setboolopt "transpose") "transpose rows and columns"
|
,flagNone ["transpose"] (setboolopt "transpose") "transpose rows and columns"
|
||||||
,flagNone ["percent", "%"] (setboolopt "percent") "express values in percentage of each column's total"
|
,flagNone ["budget"] (setboolopt "budget") "show performance compared to budget goals defined by periodic transactions"
|
||||||
,outputFormatFlag ["txt","html","csv","json"]
|
,outputFormatFlag ["txt","html","csv","json"]
|
||||||
,outputFileFlag
|
,outputFileFlag
|
||||||
]
|
]
|
||||||
|
|||||||
@ -53,8 +53,8 @@ data CompoundBalanceCommandSpec = CompoundBalanceCommandSpec {
|
|||||||
compoundBalanceCommandMode :: CompoundBalanceCommandSpec -> Mode RawOpts
|
compoundBalanceCommandMode :: CompoundBalanceCommandSpec -> Mode RawOpts
|
||||||
compoundBalanceCommandMode CompoundBalanceCommandSpec{..} =
|
compoundBalanceCommandMode CompoundBalanceCommandSpec{..} =
|
||||||
hledgerCommandMode
|
hledgerCommandMode
|
||||||
cbcdoc
|
cbcdoc
|
||||||
[flagNone ["change"] (setboolopt "change")
|
([flagNone ["change"] (setboolopt "change")
|
||||||
("show balance change in each period" ++ defType PeriodChange)
|
("show balance change in each period" ++ defType PeriodChange)
|
||||||
,flagNone ["cumulative"] (setboolopt "cumulative")
|
,flagNone ["cumulative"] (setboolopt "cumulative")
|
||||||
("show balance change accumulated across periods (in multicolumn reports)"
|
("show balance change accumulated across periods (in multicolumn reports)"
|
||||||
@ -64,12 +64,12 @@ compoundBalanceCommandMode CompoundBalanceCommandSpec{..} =
|
|||||||
("show historical ending balance in each period (includes postings before report start date)"
|
("show historical ending balance in each period (includes postings before report start date)"
|
||||||
++ defType HistoricalBalance
|
++ defType HistoricalBalance
|
||||||
)
|
)
|
||||||
,flagNone ["flat"] (setboolopt "flat") "show accounts as a list"
|
]
|
||||||
,flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "flat mode: omit N leading account name parts"
|
++ flattreeflags ++
|
||||||
,flagNone ["no-total","N"] (setboolopt "no-total") "omit the final total row"
|
[flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "flat mode: omit N leading account name parts"
|
||||||
,flagNone ["tree"] (setboolopt "tree") "show accounts as a tree; amounts include subaccounts (default in simple reports)"
|
|
||||||
,flagNone ["average","A"] (setboolopt "average") "show a row average column (in multicolumn reports)"
|
,flagNone ["average","A"] (setboolopt "average") "show a row average column (in multicolumn reports)"
|
||||||
,flagNone ["row-total","T"] (setboolopt "row-total") "show a row total column (in multicolumn reports)"
|
,flagNone ["row-total","T"] (setboolopt "row-total") "show a row total column (in multicolumn reports)"
|
||||||
|
,flagNone ["no-total","N"] (setboolopt "no-total") "omit the final total row"
|
||||||
,flagNone ["no-elide"] (setboolopt "no-elide") "don't squash boring parent accounts (in tree mode)"
|
,flagNone ["no-elide"] (setboolopt "no-elide") "don't squash boring parent accounts (in tree mode)"
|
||||||
,flagReq ["format"] (\s opts -> Right $ setopt "format" s opts) "FORMATSTR" "use this custom line format (in simple reports)"
|
,flagReq ["format"] (\s opts -> Right $ setopt "format" s opts) "FORMATSTR" "use this custom line format (in simple reports)"
|
||||||
,flagNone ["pretty-tables"] (setboolopt "pretty-tables") "use unicode when displaying tables"
|
,flagNone ["pretty-tables"] (setboolopt "pretty-tables") "use unicode when displaying tables"
|
||||||
@ -77,7 +77,7 @@ compoundBalanceCommandMode CompoundBalanceCommandSpec{..} =
|
|||||||
,flagNone ["percent", "%"] (setboolopt "percent") "express values in percentage of each column's total"
|
,flagNone ["percent", "%"] (setboolopt "percent") "express values in percentage of each column's total"
|
||||||
,outputFormatFlag ["txt","html","csv","json"]
|
,outputFormatFlag ["txt","html","csv","json"]
|
||||||
,outputFileFlag
|
,outputFileFlag
|
||||||
]
|
])
|
||||||
[generalflagsgroup1]
|
[generalflagsgroup1]
|
||||||
hiddenflags
|
hiddenflags
|
||||||
([], Just $ argsFlag "[QUERY]")
|
([], Just $ argsFlag "[QUERY]")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user