doc: balance --format does not support - any more

This commit is contained in:
Simon Michael 2015-10-10 15:07:49 -07:00
parent cbbe07e3c4
commit 1d944ac1a9
2 changed files with 26 additions and 26 deletions

View File

@ -1581,19 +1581,19 @@ $ hledger balance -V ...
##### Custom balance output ##### Custom balance output
``` {.shell .right} ``` {.shell .right}
$ hledger balance --format "%20(account) %-(total)" $ hledger balance --format "%20(account) %12(total)"
assets $-1 assets $-1
bank:saving $1 bank:saving $1
cash $-2 cash $-2
expenses $2 expenses $2
food $1 food $1
supplies $1 supplies $1
income $-2 income $-2
gifts $-1 gifts $-1
salary $-1 salary $-1
liabilities:debts $1 liabilities:debts $1
-------------------- ---------------------------------
0 0
``` ```
In simple (non-multi-column) balance reports, you can customise the In simple (non-multi-column) balance reports, you can customise the
@ -1601,15 +1601,15 @@ output with `--format FMT`. FMT (plus a newline) will be displayed for
each account/balance pair. It is a format string with data fields each account/balance pair. It is a format string with data fields
interpolated by interpolated by
`%[-][MIN][.MAX](FIELDNAME)` `%[MIN][.MAX](FIELDNAME)`
where a minus sign means left-justify, MIN means pad with spaces to at where MIN means pad with spaces to at least this width, and MAX means
least this width, and MAX means truncate at this width. The field name truncate at this width. The field name must be enclosed in
must be enclosed in parentheses. Three are available: parentheses. Three fields are available:
- `depth_spacer` - a number of spaces equal to the account's depth, or if MIN is specified, MIN * depth spaces. - `depth_spacer` - a number of spaces equal to the account's depth, or if MIN is specified, MIN * depth spaces.
- `account` - the account's name - `account` - the account's name
- `total` - the account's balance/sum of postings - `total` - the account's balance/posted total, right justified
When the total has multiple commodities, by default each commodity is When the total has multiple commodities, by default each commodity is
displayed on a separate line, and the report item will be bottom displayed on a separate line, and the report item will be bottom
@ -1620,13 +1620,12 @@ beginning the format with a special prefix:
- `%^` - render on multiple lines, top-aligned - `%^` - render on multiple lines, top-aligned
- `%,` - render on one line, with multi-line values comma-separated - `%,` - render on one line, with multi-line values comma-separated
There are some quirks: There are some quirks, and experimentation may be needed to get pleasing output.
In one-line mode, `%(depth_spacer)` has no effect, instead `%(account)` has indentation built in.
- In one-line mode, `%(depth_spacer)` has no effect, instead `%(account)` has indentation built in. <!-- XXX retest:
- Consistent column widths are not well enforced, causing ragged edges unless you set suitable widths. Consistent column widths are not well enforced, causing ragged edges unless you set suitable widths.
- Beware of specifying a maximum width; it will clip account names and amounts that are too wide, with no visible indication. Beware of specifying a maximum width; it will clip account names and amounts that are too wide, with no visible indication.
-->
Some experimentation may be needed to get pleasing output.
Examples: Examples:

View File

@ -63,7 +63,8 @@ data ReportItemField =
AccountField -- ^ A posting or balance report item's account name AccountField -- ^ A posting or balance report item's account name
| DefaultDateField -- ^ A posting or register or entry report item's date | DefaultDateField -- ^ A posting or register or entry report item's date
| DescriptionField -- ^ A posting or register or entry report item's description | DescriptionField -- ^ A posting or register or entry report item's description
| TotalField -- ^ A balance or posting report item's balance or running total | TotalField -- ^ A balance or posting report item's balance or running total.
-- Always rendered right-justified.
| DepthSpacerField -- ^ A balance report item's indent level (which may be different from the account name depth). | DepthSpacerField -- ^ A balance report item's indent level (which may be different from the account name depth).
-- Rendered as this number of spaces, multiplied by the minimum width spec if any. -- Rendered as this number of spaces, multiplied by the minimum width spec if any.
| FieldNo Int -- ^ A report item's nth field. May be unimplemented. | FieldNo Int -- ^ A report item's nth field. May be unimplemented.