Skip to content

Commit

Permalink
imp: balcmds: tweak --base-url help [#2226]
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Sep 29, 2024
1 parent c871095 commit 40b8d2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions hledger/Hledger/Cli/Commands/Balance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,11 @@ balancemode = hledgerCommandMode
,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)"
,flagReq ["format"] (\s opts -> Right $ setopt "format" s opts) "FORMATSTR" "use this custom line format (in simple reports)"
,flagReq ["base-url"] (\s opts -> Right $ setopt "base-url" s opts) "URLPREFIX" "add anchors to table cells with respect to this base URL"
,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 ["percent", "%"] (setboolopt "percent") "express values in percentage of each column's total"
,flagNone ["related","r"] (setboolopt "related") "show postings' siblings instead"
,flagNone ["invert"] (setboolopt "invert") "display all amounts with reversed sign"
,flagNone ["transpose"] (setboolopt "transpose") "transpose rows and columns"
,flagReq ["layout"] (\s opts -> Right $ setopt "layout" s opts) "ARG"
(unlines
["how to lay out multi-commodity amounts and the overall table:"
Expand All @@ -354,9 +356,7 @@ balancemode = hledgerCommandMode
,"'bare' : commodity symbols in one column"
,"'tidy' : every attribute in its own column"
])
,flagNone ["related","r"] (setboolopt "related") "show postings' siblings instead"
,flagNone ["invert"] (setboolopt "invert") "display all amounts with reversed sign"
,flagNone ["transpose"] (setboolopt "transpose") "transpose rows and columns"
,flagReq ["base-url"] (\s opts -> Right $ setopt "base-url" s opts) "URLPREFIX" "in html output, generate hyperlinks to hledger-web, with this prefix. (Usually the base url shown by hledger-web; can also be relative.)"

-- output:
,outputFormatFlag ["txt","html","csv","tsv","json","fods"]
Expand Down
7 changes: 6 additions & 1 deletion hledger/Hledger/Cli/CompoundBalanceCommand.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ compoundBalanceCommandMode :: CompoundBalanceCommandSpec -> Mode RawOpts
compoundBalanceCommandMode CompoundBalanceCommandSpec{..} =
hledgerCommandMode
cbcdoc
-- keep roughly consistent order with Balance.hs. XXX refactor

([flagNone ["sum"] (setboolopt "sum")
"show sum of posting amounts (default)"
,flagNone ["valuechange"] (setboolopt "valuechange")
Expand All @@ -82,6 +84,7 @@ compoundBalanceCommandMode CompoundBalanceCommandSpec{..} =
("accumulate amounts from journal start to column end (includes postings before report start date)"
++ defaultMarker Historical)
]

++ flattreeflags True ++
[flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "flat mode: omit N leading account name parts"
,flagNone ["declared"] (setboolopt "declared") "include non-parent declared accounts (best used with -E)"
Expand All @@ -91,7 +94,6 @@ compoundBalanceCommandMode CompoundBalanceCommandSpec{..} =
,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)"
,flagReq ["format"] (\s opts -> Right $ setopt "format" s opts) "FORMATSTR" "use this custom line format (in simple reports)"
,flagReq ["base-url"] (\s opts -> Right $ setopt "base-url" s opts) "URLPREFIX" "add anchors to table cells with respect to this base URL"
,flagNone ["sort-amount","S"] (setboolopt "sort-amount") "sort by amount instead of account code/name"
,flagNone ["percent", "%"] (setboolopt "percent") "express values in percentage of each column's total"
,flagReq ["layout"] (\s opts -> Right $ setopt "layout" s opts) "ARG"
Expand All @@ -101,8 +103,11 @@ compoundBalanceCommandMode CompoundBalanceCommandSpec{..} =
,"'tall' : each commodity on a new line"
,"'bare' : bare numbers, symbols in a column"
])
,flagReq ["base-url"] (\s opts -> Right $ setopt "base-url" s opts) "URLPREFIX" "in html output, generate hyperlinks to hledger-web, with this prefix. (Usually the base url shown by hledger-web; can also be relative.)"

,outputFormatFlag ["txt","html","csv","tsv","json"]
,outputFileFlag

])
cligeneralflagsgroups1
(hiddenflags ++
Expand Down

0 comments on commit 40b8d2b

Please sign in to comment.