Commit Graph

9601 Commits

Author SHA1 Message Date
Simon Michael
7690b85e51 ;announce: 1.21 2021-03-10 11:52:31 -08:00
Simon Michael
5cdbd04974 ;finalise manuals 2021-03-10 11:12:06 -08:00
Simon Michael
532a4622ac ;finalise changelogs 2021-03-10 11:10:13 -08:00
Simon Michael
240d14672c install: bump to 1.21 2021-03-10 08:27:23 -08:00
Simon Michael
00beaf1423 ;update cabal files 2021-03-10 08:24:59 -08:00
Simon Michael
eeddfc2509 ;bump version to 1.21 2021-03-10 08:24:58 -08:00
Simon Michael
f82bdb15e4 ;update changelogs 2021-03-10 08:24:12 -08:00
Simon Michael
40d1d7f7a7 ;update manuals 2021-03-10 08:22:39 -08:00
Simon Michael
be50572d97 shake: bump to lts-17.4, like the rest 2021-03-10 08:19:10 -08:00
Stephen Morgan
fb02d86884 lib: Do not do any valuation with --value=cost, perform AtEnd valuation with --value=cost,COMM. 2021-03-10 12:42:01 +11:00
Stephen Morgan
1702b8cca4 Revert "fix valuation tests after #1499"
This reverts commit 696114cfa8.
2021-03-10 12:29:06 +11:00
Simon Michael
696114cfa8 fix valuation tests after #1499 2021-03-09 10:17:26 -08:00
Simon Michael
ae435fd33e ;doc: changelog tweaks 2021-03-09 10:16:02 -08:00
Simon Michael
269b25bc8d doc: edited changelogs 2021-03-09 09:31:28 -08:00
Simon Michael
51d582e845 also keep supporting --value=cost,COMM for now (#1499) 2021-03-09 07:37:52 -08:00
Simon Michael
4ae401cbec ;bal: cli help tweaks 2021-03-09 07:29:40 -08:00
Simon Michael
346429d070 ;bal: doc tweaks 2021-03-09 07:29:12 -08:00
Simon Michael
faf68f3def ;doc: bump changelogs to latest revision 2021-03-08 15:16:54 -08:00
Simon Michael
ec4d131d22 ;doc: cherry pick recent edited changelogs from 1.21-branch 2021-03-08 15:15:57 -08:00
Simon Michael
325aa15f74 ;doc: restore changelogs up to a5f9f8ce0 2021-03-08 15:14:47 -08:00
Simon Michael
54b95af9ff ;doc: merge 1.20.3, 1.20.4 changelogs from 1.20-branch 2021-03-08 15:12:39 -08:00
Simon Michael
72a9b612c1 ;cli: fix "hledger CMD --info" with older info
This should open the info node for CMD, but was giving an
error with info 4.8 on macs. Now it's more robust.
2021-03-07 17:40:50 -08:00
Simon Michael
36aa01f67a ;update manuals 2021-03-07 10:25:13 -08:00
Simon Michael
5dc644d280 ;update CLI usage texts 2021-03-07 10:25:08 -08:00
Simon Michael
fce0a690dd ;doc: contributing: draftprs.hledger.org, readyprs.hledger.org 2021-03-07 10:02:24 -08:00
Simon Michael
1ca448bb45 Merge branch 'bash-completion' (#1410)
An extensive overhaul by @zhelezov of the bash programmable
completions in shell-completions/.

"This was supposed to be just a fix for #1404 but upon visiting the source
several issues became apparent and that is why the commit grew a bit more than
expected. A complete list of changes bellow:

Fix #1404
No more orphaned temporary directories. Commands, options, etc. that used to be
stored in there are included at build-time as here documents in the source.

Fix artifacts in /tmp after build
Upon fixing the above I became aware that the build itself was leaving behind a
heap of artifacts in /tmp that were not taken care of with a make clean.
Fixed by using temporary files and directories in the build directory. Makefile
and build scripts adjusted.

Produce command aliases
Regular expressions in build scripts changed to produce all command aliases
except single letter ones (see below)

Do not propose single letters completions
It is simply not useful and adds a lot of noise. It makes completion slower as
well because you need to hit yes on the prompt:
Display all 200 possibilities? (y or n)
output-options.sh now excludes those.

Query filters simplified
Keep only the prefix of the filter with the colon in query-filters.txt. This
change has two reasons:

Single letter completions are not useful (see above)
It allows for completion suggestions specific to each
Bonus reason: it's a completion engine, not a user manual.
Fix completion impacts on global environment
The completion script was making a couple of changes to the global environment
which had an impact for the rest of the shell session.

set -o pipefail: the change is hidden from the user and could lead to subtle
errors throughout the shell session
COMP_WORDBREAKS=" ": this affects subsequent completions for us and other
programs too. I exclude the colon : from its value and use
compopt -o filenames to handle escaping of special characters for us. I would
like to find a solution without messing with COMP_WORDBREAKS but it is not
straight forward.
Fix hiding of legit subcommands
Completion was hiding all possibilities if a subcommand happens to be the prefix
of another. On typing balance, one should be proposed balancesheet and
balancesheetequity as well.

Return early
Try to complete depending on the current context and return immediately if
successful. Keep completion list relevant and as short as possible.

Context aware completion

Add handlers for option parameter completion, see _hledger_compreply_optarg()
Add handlers for query filters:, see _hledger_compreply_query()
Use --file and --rules-file arguments when proposing completions for the
above, see _hledger()
Propose only top level accounts at first. Again, keep it short and focused.
Custom compgen wrapper
compgen is fairly complicated. There is no way to feed it a word list with
literals. It will mangle your input in so many ways that we cannot trust it. To
work around this several wrappers are used: _hledger_compgen() works with
_hledger_quote_by_ref() to process and escape newline separated input which is
then fed to compgen and finally in COMPREPLY through _hledger_compreply()
and _hledger_compreply_append(). It sounds messy and I guess it is, I would like
to find a more straight forward way to do it. I think it is still a way better
and safer interface with readline than trying to grep our way through.

Replace declare with local
Again, this script is sourced by the shell -- keep variable scopes as narrow as
possible. Oops, they are actually synonymous when used in a function but
local declares our intentions explicitly.

Use compopt -o nosort
Often I resort to using it to keep different groups of completions together.
Whether this is more ergonomic or not is subjective. But our input lists are
already sorted at build-time so why not. Sort manually query-filters.txt when
editing it.

Remove irrelevant comments
And add some new ones :)

I think that is all. Give it a spin, try to abuse it, in and outside of quotes,
with some funky accounts, payees, tags, whatever, and tell me where it breaks or
behaves unexpectedly."
2021-03-05 16:12:08 -08:00
Simon Michael
750db7ed6f stack: bump default to lts-17.4/ghc-8.10.4 2021-03-05 14:56:33 -08:00
Simon Michael
3a7c578f2d ;bal: doc: tweaks 2021-03-05 14:55:24 -08:00
Simon Michael
e521518eb6 ;bal: doc: tweaks 2021-03-05 10:43:47 -08:00
Simon Michael
2023e9cd65 ;bal: doc: more updates & cleanups (#1496) 2021-03-05 10:21:46 -08:00
Stephen Morgan
baab33b58d tools: Include more commodities and prices in generated journals. 2021-03-05 10:12:49 -08:00
Stephen Morgan
2aae54a02c test: Test bal --valuechange throws an error for bad --value options. 2021-03-05 10:09:14 -08:00
Stephen Morgan
efb37c3343 lib: Default to PeriodChange report when using ValueChangeReport. 2021-03-05 10:09:14 -08:00
Stephen Morgan
3f408c2117 lib,cli: Restore old --change option for per-period summation, use --sum for basic ValueChange balance report. 2021-03-05 10:09:14 -08:00
Simon Michael
ae73eea7cb ;bs,bse,cf,is: update docs 2021-03-04 10:26:58 -08:00
Simon Michael
7b8a873471 ;check: update manual 2021-03-03 15:43:38 -08:00
Stephen Morgan
d931e4919e cli: Allow overriding with --periodic (rather than the old --change) and properly calculate requestedspan in CompoundBalanceReport. 2021-03-03 15:43:02 -08:00
Simon Michael
e9f04d5ed6 check: ordereddates now checks each file separately (fix #1493) 2021-03-03 06:44:50 -08:00
Simon Michael
2505c69f80 lib: transactionFile 2021-03-03 06:44:25 -08:00
Simon Michael
642ad24b0e ;check: refactor 2021-03-03 06:06:39 -08:00
Simon Michael
ffb985f1a2 ui, web: make --man and --info work, similar to hledger
(cf #1410)
2021-03-03 05:57:31 -08:00
Simon Michael
cb0526381e ;bal: doc updates 2021-03-03 05:30:53 -08:00
Stephen Morgan
edaaef897b lib: Do not include price directives in journalDateSpan. Only include
price directives after the last transaction/posting date if using
--value=end.

Also enlarges the reportspan to encompass full intervals for budget
goals.
2021-03-03 05:26:55 -08:00
Simon Michael
ff5e810c78 ;bal: more doc updates 2021-03-03 04:10:23 -08:00
Simon Michael
dccd39171e ;gather investing examples 2021-03-03 04:09:41 -08:00
Vladimir Zhelezov
deb2a27e45 Rebuild completion after the rebase on upstream/master
* `help` command's output is no longer listing help topics, so
those completions are removed.
* `check` command supersedes `check-dates`, `check-dupes`, etc.
2021-02-28 08:36:42 +01:00
Vladimir Zhelezov
066fa964b6 Disable shell expansion in here-docs
Better be safe that sorry...
2021-02-28 08:33:18 +01:00
Vladimir Zhelezov
3d3cd2d4a2 Makefile: move all variable definitions to the top, before targets 2021-02-28 08:33:18 +01:00
Vladimir Zhelezov
36fca65404 README: fix syntax highlighting, quotes 2021-02-28 08:33:18 +01:00
Vladimir Zhelezov
3ab796fd9e Update README 2021-02-28 08:33:18 +01:00