Use two options and less surprising behaviour. Notes:
* a recognised suffix on the output file name can set the format
* but --output-format always wins
* -o - means stdout
* currently these are command-specific options on balance, print, register
* later, --output-file should become a global option
* and --output-format should be available at least on all commands which
support multiple formats. Each command may support a different set of
output formats, which should be listed in its command line help.
The -A flag now enables -E, so that with a report interval the averages
are always per-period and not per-report-line. (Without a report
interval, -E is already the default).
To avoid totally breaking the layout of multicolumn balance reports when
there are multi-commodity balances, these are now rendered on a single
line, comma separated. Simple balance reports still use the old vertical
format for now.
This is a workaround for a cmdargs limitation. Having "--debug 2"
or "--width 100" produce no output (because the number is parsed
as a separate argument) is too annoying.
Can be helpful when reading Ledger files, where assertions may have
different semantics; or for getting some answers from your journal
to help you fix your assertions.
Could be called --no-assertions, but this might create surprise when it
has an effect contrary to --no-new-accounts.
I had to add another flag throughout the parsers & journal read
functions, ok for now.
We provided a very limited implementation of --display only for one use
case: to see an accurate running balance. Now that is achieved more easily
with -H/--historical, similar to the balance command, and --display
can be dropped.
Drop the special case where we hide an add-on's source version if a
compiled version is also present. Better to be simple and explicit.
Improve robustness of command parsing, eg "hledger addon.hs"
will now work even though the command is listed as "addon".
And ignore any add-ons which would shadow a built-in command
(or any of the official command aliases displayed in the command list,
like "bal" and "reg"). Built-ins may not be replaced by an add-on.
We now hide add-ons' file extensions in the commands list except when
they are needed for disambiguation. There are three cases:
- when an add-on exists with only one file extension, the extension is
not displayed.
- when an add-on has exactly two variants, one with the .[l]hs extension
and the other with none or .exe - presumably the source and compiled
versions - we omit the source version from the list.
- otherwise when an add-on has multiple variants differing by file
extension, they are listed with their extensions displayed.
In addition to hledger-X and hledger-X.hs, other common executable file
extensions will be recognised. In particular, on windows hledger now
lists hledger-web.exe as an add-on. The current list is:
bat, com, exe, hs, lhs, pl, py, rb, rkt, sh.
Periodic, cumulative and historical multicolumn balance reports are now
generated by one code path, which helps with consistency and reducing
the bug/test surface. --tree now also works with --cumulative or
--historical.
Multicolumn balance reports can now be switched to a hierarchical view
with --tree. This is similar to the single column balance report with
--no-elide, ie we do not elide boring parents into the following line.
The --flat and --tree flags are opposites; the last one to appear on
the command line is decisive (in future, if not already).
To end a transaction, period is required because there might be another
default posting being suggested, and enter usually means "accept the
default". But having to switch back and forth from enter to period
during data entry is a bit unergonomic, requiring too much thought.
Now, in the (common) case where you have entered a balanced transaction
and there are no more default postings to suggest, enter is also allowed
to end the transaction. Experimental; this might be too inconsistent.
The code is now much more manageable, faciliating further
improvements. Completion now works at all prompts, and
will insert the default value if the input area is empty.
Account and amount defaults are more robust and useful
in various situations. There might be a slight regression
with default commodity handling.
Previously executables with eg digits in their name were ignored.
It now finds all files beginning with hledger-, optionally ending with
.hs or .lhs, and with no other dots in the name.
As before, we don't check for executable permission (performance ?).