Previously depth-limiting was universal across all accounts, e.g. all
accounts are clipped to depth 2. However, sometimes you want certain
accounts clipped to a different depth than others, e.g. all expenses to
depth 3, while all assets to depth 2. This commit enables depth-limiting
to optionally include a regular expression, which limits the accounts it
applies to.
More than one depth limit can be passed, and they are applied to each
account name by the following rules:
- If one or more regular-expression depth limit applies, use the
most specific one
- If no regular-expression depth limits apply, and a flat depth limit is
supplied, use that
- Otherwise, do not do any depth limiting
For example, this will clip all accounts matching "assets" to depth 3,
all accounts matching "expenses" to depth 2, and all other accounts to
depth 1.
--depth assets=3 --depth expenses=2 --depth 1
Market prices are now shown using one line each,
the known prices are listed (forward / forward+reverse),
and the status of --infer-market-prices is shown.
- These special hidden tags, used internally, have been renamed:
- `_modified` -> `_modified-transaction`
- `_cost-matched` -> `_cost-posting`
- `_conversion-matched` -> `_conversion-posting`
- All special hidden tags now have a similarly-named visible tag,
and `--verbose-tags` now shows those more often, which is useful
when troubleshooting `--infer-equity`, `--infer-costs`,
or the matching of redundant costs and conversion postings.
- The `generated-posting:` tag added by `--infer-equity` is now valueless.
- The `modified-transaction:` tag added by `--auto` now appears on its own line.
Unsupported chars are now hex-encoded, not just converted to dashes.
This helps keep account and commodity names unique, especially with
the equity conversion account names generated by --infer-equity when
using currency symbols.
(Those could also be converted to ISO 4217 codes, in theory, but
for now we just hex encode them, which is easier to make robust.)
Also, Beancount commodity symbols are no longer enclosed in
hledger-style double quotes.
Hledger.Utils.IO's ansi style/color helpers now respect --color=yes,
so that eg `hledger --color=yes | less -R` shows bold headings as
you'd expect.
Hledger.Utils.IO.rgb' now takes Float arguments instead of Word8.
When using `less` as pager, if HLEDGER_LESS is defined, it will
provide the options (instead of LESS + hledger's extra options).
You can set your own preferred options here, or you can set it
equal to LESS to use exactly those options.
[#2272]-related
Currently this sets a rather ambitious set of options,
and overrides the existing LESS:
--chop-long-lines
--hilite-unread
--ignore-case
--mouse
--no-init
--QUIT-AT-EOF
--quit-if-one-screen
--RAW-CONTROL-CHARS
--squeeze-blank-lines
--use-backslash
--use-color
This fixes the error displayed when quitting the pager with long output.
It also replaces the pager lib with more robust homegrown pager utilities,
which should prevent a number of failure modes.
The equity:conversion account, and its variations equity:trade(s) and equity:trading,
normally detected as V/Conversion type, now become ordinary E/Equity accounts
if some other account is declared as V/Conversion type.
This is motivated by the next commit, in which `check accounts` will
stop warning about conversion accounts and their subaccounts,
which means all of the above names and their subaccounts would remain
always exempt from strict account checking.
Now, if the user declares their own conversion account, those default
accounts will become controllable by account checking again.
Which at least reduces the allowlist a bit.
Hopefully this won't cause hassles.
Builds made with ghc 9.10+ and the 'debug' build flag, will show
(some kind of, partial) stack traces when the program ends with an
error. (And also will have ghc-debug support enabled.)
The stack traces will probably improve in due course.
--color now also works in a config file, like --pager, except for two
cases: it does not affect colouring of debug output, or the colouring
helpers used in the check recentassertions error message.