Commit Graph

1104 Commits

Author SHA1 Message Date
Simon Michael
349ffd7c0b updateReportSpecFromOpts -> updateReportSpec[With] 2020-12-12 12:05:44 -08:00
Simon Michael
a2bc7f95f0 ;update CLI usage texts 2020-12-08 20:11:32 -08:00
Simon Michael
4f122b605d ;rewrite: replace/update doc in commands list 2020-12-08 19:22:03 -08:00
Simon Michael
786a58ce2a ;cli: drop old command docs from commands list 2020-12-08 09:51:19 -08:00
Simon Michael
7a692284a9 ;doc: replace a few addon with add-on 2020-12-08 09:27:36 -08:00
Simon Michael
2066bb5e9f ;update CLI usage texts 2020-11-30 15:21:40 -08:00
Simon Michael
26dc66e118 ;check: doc updates 2020-11-30 08:49:10 -08:00
Simon Michael
679373c835 ;update CLI usage texts 2020-11-30 08:41:21 -08:00
Simon Michael
a5adc14aaa ;check: doc updates 2020-11-30 08:41:07 -08:00
Simon Michael
090e810761 check: rename ordereddates, uniqueleafnames 2020-11-30 08:26:48 -08:00
Simon Michael
4dba59b0a1 ;check: doc updates 2020-11-30 08:26:16 -08:00
Simon Michael
4db9ec1e79 ;update CLI usage texts 2020-11-29 21:21:29 -08:00
Simon Michael
a0907e6567 check: doc 2020-11-29 21:21:20 -08:00
Simon Michael
e33667f580 check: support quoted check name + args
A "hledger check" argument may now be a quoted string containing
the check name followed by space-separated arguments, for
checks which make use of those. This means the check command
can replicate "check-dates --unique" and (in principle)
"check-fancyassertions ASSERTIONS..". Eg:

hledger check "dates --unique"

I think it'll be better for checks to take no arguments or options,
so this is probably just a transitional feature for compatibility.
2020-11-29 20:48:31 -08:00
Simon Michael
78542ca32e check-dates: rename --strict to --unique; improve output 2020-11-29 15:28:14 -08:00
Simon Michael
c5b0eab37a ;cli: slightly clearer message for this unlikely error case 2020-11-29 13:37:30 -08:00
Simon Michael
19f257621c ;cli: commands list: descriptions for tagfiles & fancyassertions addons 2020-11-29 13:36:24 -08:00
Simon Michael
724fb9961d check: new command incorporating check-dates, check-dupes, etc.
This is intended to work in three modes:

- hledger check: just run the standard data checks, like all other
commands but with no output on success. Equivalent to
hledger stats >/dev/null but simpler and platform-independent.

- hledger check --strict: run the standard + strict data checks,
like other commands in strict mode.

- hledger check CHECK1 CHECK2 ...: run the named checks. This allows
running more or less checks than the default or strict mode, or
a single check of interest. The arguments are standard lowercase names
for the checks. For now this command supports two checks: "dates" and
"leafnames". These are equivalent to the check-dates and check-dupes
commands which are now hidden and considered deprecated, though
still supported for the moment.

This command needs more work and I'm rushing it a little, but I think
it's the right direction and I'd like to put it out there to get
feedback.
2020-11-29 13:27:35 -08:00
Simon Michael
325a155f0b check-dates: on success, be silent and don't force program exit 2020-11-29 13:24:33 -08:00
Simon Michael
cd7156013d check-dupes: return a non-zero exit code on failure 2020-11-29 13:24:14 -08:00
Simon Michael
ee026f5442 Revert the rename of check-dupes
We'll keep the old name, soon to be a hidden command, for compatibility.
2020-11-28 15:32:07 -08:00
Simon Michael
d9b4446837 ;check-leafnames: fix, one more rename 2020-11-27 13:23:04 -08:00
Simon Michael
d330c4910e check-dupes: rename to check-leafnames, per "How to check for errors" 2020-11-27 12:51:41 -08:00
Simon Michael
ec3ad14ae5 strict mode: -s/--strict requires posted accounts to be declared 2020-11-26 08:48:16 -08:00
Simon Michael
982486e5d2 ;update CLI usage texts 2020-11-24 09:23:47 -08:00
Simon Michael
13e3e7607e ;cli: update example in Cli.Main haddock 2020-11-23 10:05:53 -08:00
Simon Michael
16f12d8263 ;bal: budget: improve doc 2020-11-20 17:20:50 -08:00
Simon Michael
322d62483e ;bal: budget: heading type 2020-11-20 17:05:48 -08:00
Simon Michael
adc9bf94bc ;bal: budget: document a start date gotcha 2020-11-20 17:04:24 -08:00
Simon Michael
372c9724a8 bal: improve budget, MultiBalanceReport debug output
Comply with debug levels policy, clarify some labels.
2020-11-19 14:42:46 -08:00
Simon Michael
0295be5553 ;update CLI usage texts 2020-11-19 09:19:12 -08:00
Dmitry Astapov
d53dc46a5a roi: docs 2020-11-19 09:17:28 -08:00
Dmitry Astapov
c0582ec895 roi: TWR now handles samy-day pnl changes and cashflows 2020-11-19 09:17:28 -08:00
Simon Michael
3afd52248b ;roi: document calculation failures 2020-11-19 09:17:28 -08:00
Simon Michael
ab305b3244 roi: add adept's IRC discussion to doc 2020-11-19 09:17:28 -08:00
Simon Michael
a92aa3cd26 ;bal: fix a warning 2020-11-18 16:31:32 -08:00
Simon Michael
4e529372a4 ;update CLI usage texts 2020-11-18 16:30:40 -08:00
Simon Michael
18f8f91520 ;more budget-related cleanup 2020-11-18 16:29:04 -08:00
Simon Michael
5bb9006b6c bal: support CSV output for --budget reports (#1155) 2020-11-18 16:29:04 -08:00
Dmitry Astapov
98a46fcaeb cli: improve error for roi IRR rootfinding problems (closes #1398) 2020-11-18 01:03:20 +00:00
Simon Michael
541aa3ee5b ;update CLI usage texts 2020-11-17 07:29:38 -08:00
Simon Michael
ec2a774b18 cli, lib: move functional tests into hledger/test/ 2020-11-16 08:47:41 -08:00
Simon Michael
2448d07148 ;roi: doc: link example file 2020-11-15 11:20:52 -08:00
Simon Michael
0ce9c352ec add: don't let number style disturb the default (Fixes #1378) 2020-11-14 11:08:01 -08:00
Simon Michael
e8672c4cd5 ;lib: don't catch in maybeFileModificationTime (#1390)
It's overkill.. it's understood that any IO action can
throw an exception, and it's best to handle them at top level,
eg as Yesod does.
2020-11-13 16:50:17 -08:00
Simon Michael
1f94aa1628 ;lib: make file modification/reloading helpers more robust (#1390)
Work on hledger-web tests showed some bad behaviour, in particular
journalReloadIfNewer would always reload a journal read from a string
or stdout. This is now fixed, and an ugly read.show conversion has
been cleaned up.

Hledger.Cli.Utils API changes:

removed:
- journalSpecifiedFileIsNewer
- fileModificationTime

added:
- utcTimeToClockTime

changed:
- journalFileIsNewer now requires a file argument
2020-11-13 16:28:35 -08:00
Simon Michael
94b01dd19d ;update CLI usage texts 2020-11-09 17:14:38 -08:00
Simon Michael
78894d46c8 import: apply journal's commodity styles to imported amounts 2020-11-09 17:14:38 -08:00
Stephen Morgan
76dd4d83bc cli, docs: Add documentation, improve test comments, and clarify report titles for reports with valuation date changing over different columns. 2020-11-08 17:11:05 -08:00
Simon Michael
0df6998b58 ;bal: doc tweak (#1283, #1379) 2020-11-05 11:07:23 -10:00
Simon Michael
f615c07d0f ;update CLI usage texts 2020-11-05 11:00:38 -10:00
Simon Michael
10facfdb50 ;bal: improve -S docs (#1283, #1379) 2020-11-05 11:00:26 -10:00
Stephen Morgan
83a518af99 lib,cli,ui: In ReportOpts, store query terms term-by-term in a list in
querystring_.

This helps deal with tricky quoting issues, as we no longer have to make
sure everything is quoted properly before merging it into a string.
2020-11-04 08:47:30 -08:00
Stephen Morgan
a620ab9666 lib: Expand Tabular.AsciiWide to allow multiline cells, either top or bottom aligned. 2020-11-04 14:25:21 +11:00
Stephen Morgan
0bebda7313 lib,cli,ui: Elide amounts to a width of 32 characters, rather than 22 characters. 2020-11-04 14:25:20 +11:00
Stephen Morgan
e9a16edb58 cli: Use new mixed amount display functions for balance format strings. 2020-11-04 14:25:20 +11:00
Stephen Morgan
9de238757b lib,cli,ui: Introduce showMixed*Unnormalised, eliminate most direct calls of strWidth.
This introduces some new helper functions which are exactly the same
as what we had before, but do not call
normaliseMixedAmountSquashPricesForDisplay, so that we can use the new
functions for displaying Transaction and Posting. It also goes through
and gets rid of most uses of the old showMixed* functions which would
benefit from using the new interface.
2020-11-04 14:25:20 +11:00
Stephen Morgan
a838366c9d cli: Ensure register reports are correctly aligned for negative numbers.
This uses the new showMixed* function for the register report. This
fixes some misaligned negative numbers which appeared in one of the
earlier commits, and adds a test for it.
2020-11-04 14:25:20 +11:00
Stephen Morgan
162a936360 lib: BudgetReport uses new renderTable inteface, now has more compact output.
This changes showMixedAmountElided so that the width to elide to is
given as an argument, rather than fixed at 22 characters. This
actually uses the new renderTable interface. Mostly this is just an
internal change, but since we have more information about the widths
of things, we can actually get rid of some superfluous spaces in the
budget report output, previously there to make sure it stayed aligned
with the largest reasonable contents.
2020-11-04 14:25:20 +11:00
Stephen Morgan
33369dfa6c lib: renderTable can now receive alignment and width specifications on all cells, and has an option to display the outer border.
This gives renderTable a little more customisation. Before any of the
commits of this PR, render would just receive a string to display in
each cell. After the second commit of this PR it would also receive a
width of the string (in place of stripping ANSI sequences and then
calculating the width). After this commit, it now also takes an
alignment, so you can make cells left or right aligned. The function
render calls renderTable with appropriate options to give the same
behaviour as before. Also, previously render would always put a border
around the table. We would take this output, and would sometimes strip
the border by dropping the first and last rows, and first and last
characters of every row. I've just added an option to control whether
to put the border in, so we can just not add it in the first place,
rather than stripping it later. Note that this is again just defining
helper functions; this extra power is not yet used anywhere.
2020-11-04 14:25:20 +11:00
Stephen Morgan
a2b7a03fc4 lib,cli: bal uses new amount display functions, no longer needs to strip ansi. 2020-11-04 14:25:20 +11:00
Stephen Morgan
affc8d10f2 lib: Generalise CBCSubreportSpec to allow more subreport control. 2020-10-23 16:15:41 -07:00
Stephen Morgan
260283e2f1 lib,cli,ui,web: Introduce ReportSpec, which holds ReportOpts, the day of
the report, and the parsed Query.
2020-10-23 14:14:11 -07:00
Stephen Morgan
19ab222599 lib,cli: Remove old impure ReportOpts date functions. 2020-10-23 14:14:11 -07:00
Stephen Morgan
2aaab4b1b7 lib: Make Default instances clearer, remove Default instance for Bool. 2020-10-23 14:14:11 -07:00
Stephen Morgan
1171c23eee lib,cli,ui: Ensure ReportOpts always has today_ set. 2020-10-23 14:14:11 -07:00
Stephen Morgan
c45663d41d lib,cli: Store parsed Query in ReportOpts, rather than an unparsed
String.
2020-10-23 14:14:11 -07:00
Stephen Morgan
103308e795 lib,cli: Store StringFormat in ReportOpts, rather than unparsed String.
StringFormat now also takes an optional overline width, which is
currently only used by defaultBalanceLineFormat.
2020-10-23 14:14:11 -07:00
Simon Michael
291a35d8b4 ;lib: refactor 2020-10-19 09:09:38 -07:00
Simon Michael
2761324404 journal: apply commodity styles to forecasted transactions (#1371) 2020-10-19 08:59:25 -07:00
Simon Michael
831ec0dcf0 ;lib: refactor journalAddForecast 2020-10-19 08:52:00 -07:00
Simon Michael
1f81730a00 balcmds: mention --no-elide's new commodity-revealing function 2020-10-05 08:57:08 -07:00
Simon Michael
c5513ba722 ;tweak a few parse errors for clarity, consistency (#1329) 2020-09-19 08:10:39 -07:00
Simon Michael
a1321b7f26 ;shake: commandhelp -> commandtxts, don't build this for "manuals" 2020-09-07 11:41:56 -07:00
Simon Michael
a9fbaaf284 ;partial comment cleanups 2020-09-03 09:52:00 -07:00
Simon Michael
e44c1cfae8 ;regen manuals 2020-09-01 16:31:18 -07:00
Simon Michael
c1a985f1c8 ;bal: doc: drop link to resolved sorting issue (#1279) 2020-09-01 16:31:18 -07:00
Stephen Morgan
07dd30c1e5 lib,cli,ui: Change to consistent naming scheme for Hledger.Utils.Regex. 2020-09-01 11:36:34 +10:00
Stephen Morgan
af31d6e140 lib,cli,ui: Remove redundant Typeable and Data instances.
Also add some explicit import lists.
2020-08-31 15:41:30 +10:00
Stephen Morgan
e5371d5a6a lib,cli,ui,web: Make Regexp a wrapper for Regex. 2020-08-31 12:04:45 +10:00
Stephen Morgan
f6fa76bba7 lib,cli: Get rid of magic values for asprecision, use a sum type instead. 2020-08-30 23:00:35 +10:00
Stephen Morgan
371b349b2e lib,cli: Replace parsedate and mkdatespan with direct applications of fromGregorian, transaction now takes Day instead of a date string. 2020-08-29 15:08:28 -07:00
Stephen Morgan
2fd678e415 lib,cli,ui: Remove old CPP directives made redundant by version bounds. 2020-08-29 15:08:28 -07:00
Stephen Morgan
4d5888aa8d cli: No longer force --no-total in compound balance reports when using --percent. 2020-08-11 15:16:29 -07:00
Simon Michael
3f55c23603 ;review, tag all error calls with an easier to find PARTIAL: comment (#1312) 2020-08-05 16:08:33 -07:00
Simon Michael
242c05fc9a lib, journal: parseQuery, modifyTransactions are now total (#1312)
modifyTransactions now also requires a reference date, for parsing queries.
Relative dates are now permitted in auto posting rules.
2020-08-05 13:44:04 -07:00
Simon Michael
5d40b54043 ;doc: regen manuals 2020-08-01 12:41:54 -07:00
Stephen Morgan
081ee390ab lib: Change skipMany spacenonewline to takeWhileP Nothing isNonNewlineSpace. 2020-07-22 14:58:53 -07:00
Simon Michael
1c4e0c3cff ;reg,areg: interlink their docs 2020-07-22 07:57:53 -07:00
Simon Michael
640d2f2972 ;bs/bse/cf/is: update help to mention account types 2020-07-19 11:15:50 -07:00
Simon Michael
847fc23236 ui: use t/l keys for tree/list, T for "today", drop vi keys?! retune help (#1286) 2020-07-17 15:42:05 -07:00
Simon Michael
3636875a5d cli: add -t/-l short flags for --tree/--flat; improve help (#1286) 2020-07-17 15:36:07 -07:00
Simon Michael
ba49699728 cli: improve --color/--colour help & help layout 2020-07-17 15:36:07 -07:00
Stephen Morgan
30f02b0882 lib: account name clipping takes Maybe Int as depth. 2020-07-17 07:41:27 -07:00
Stephen Morgan
51ea6d9f25 lib: Make queryDepth return Maybe Int. 2020-07-16 10:05:53 -07:00
Simon Michael
144415f6fa ;cli: improve --color help 2020-07-14 12:22:11 -07:00
Simon Michael
031f72ac4b ;help/manuals 2020-07-14 12:09:54 -07:00
Simon Michael
3452270241 cli: --color/--colour option; smart emacs, windows autodetection (#1296) 2020-07-14 12:08:36 -07:00
Simon Michael
02043d4e65 ;areg: doc: fix heading level 2020-07-14 10:37:49 -07:00
Simon Michael
4f7bee7abf ;regen help, manuals 2020-07-14 10:25:04 -07:00