Commit Graph

1551 Commits

Author SHA1 Message Date
Simon Michael
029b59093b feat: csv: rules files can be read directly; data file can be specified
CSV rules files can now be read directly, eg you have the option of
writing `hledger -f foo.csv.rules CMD`. By default this will read data
from foo.csv in the same directory.  But you can also specify a
different data file with a new `source FILE` rule. This has some
convenience features:

- If the data file does not exist, it is treated as empty, not an
  error.

- If FILE is a relative path, it is relative to the rules file's
  directory. If it is just a file name with no path, it is relative
  to ~/Downloads/.

- If FILE is a glob pattern, the most recently modified matched file
  is used.

This helps remove some of the busywork of managing CSV downloads.
Most of your financial institutions's default CSV filenames are
different and can be recognised by a glob pattern.  So you can put a
rule like `source Checking1*.csv` in foo-checking.csv.rules,
periodically download CSV from Foo's website accepting your browser's
defaults, and then run `hledger import checking.csv.rules` to import
any new transactions. The next time, if you have done no cleanup, your
browser will probably save it as something like Checking1-2.csv, and
hledger will still see that because of the * wild card. You can choose
whether to delete CSVs after import, or keep them for a while as
temporary backups, or archive them somewhere.
2023-05-19 09:09:21 -10:00
Simon Michael
71ef6ef478 fix: cli: commands list now shows help for hledger-lots if installed 2023-05-18 07:19:36 -10:00
Simon Michael
4c3046dea8 fix: cli: the commands list no longer lists non-installed addons (fix #2034)
And internally has been rewritten for clarity.
2023-05-18 07:19:36 -10:00
Simon Michael
ae4f58beb7 lib: Hledger.Cli.Commands: findCommand -> findBuiltinCommand 2023-05-18 07:13:58 -10:00
Simon Michael
2d03148d7f dev: lib: drop unused pragma 2023-05-09 10:03:15 -10:00
Simon Michael
147d49c66c dev: cln: drop Hledger.Data.RawOptions.inRawOpts 2023-05-09 10:02:24 -10:00
Simon Michael
a771c8fc19 imp: revert 2b5194238 imp: generate auto postings on forecast transactions by default (#2027)
I found at least one user for whom this would be a breaking change
(they generate forecast txns, and have auto posting rules, but don't
want the latter applied to the former). I guess it's better to keep
things as they were for now: if you need auto postings on your
forecast txns you must use two flags, --forecast --auto.
2023-04-30 08:08:26 -10:00
Simon Michael
7f713f6a44 imp: Generated/modified txns/postings are now tagged only with --verbose-tags 2023-04-29 18:25:11 -10:00
Simon Michael
ca42b0aaca imp: cli: clean up some flags' help and sync docs 2023-04-29 18:11:53 -10:00
Simon Michael
2b5194238b imp: generate auto postings on forecast transactions by default 2023-04-29 16:00:14 -10:00
Simon Michael
fe6df964b4 ;doc: bal: try to improve description of budget report differences 2023-04-25 12:39:28 -10:00
Simon Michael
1be06c87c4 feat: bal: A new --count report type counts postings instead of amounts. 2023-04-20 14:36:41 -10:00
Simon Michael
40d10bc8c5 imp: cli: commands list: help for hledger-bar script 2023-04-20 12:58:30 -10:00
Simon Michael
c2288f8143 ;doc: update command help 2023-04-07 09:52:31 -10:00
Simon Michael
9c4b5a26fa imp: ui, web: use a pager to show command line help, like cli 2023-04-06 15:36:08 -10:00
Simon Michael
3e3c3c8355 imp: help: doc: warn about old info on mac (fix #1770) 2023-04-06 15:36:00 -10:00
Simon Michael
f0157625cb ;doc: close: fix typo 2023-04-06 12:18:00 -10:00
Simon Michael
1de8600067 imp: cli: try to ensure less (and its more mode) show ANSI (fix #2015)
If you use some other $PAGER, you will have to configure it to show
ANSI yourself (or disable ANSI, eg by setting NO_COLOR=1).
2023-04-06 11:13:00 -10:00
Simon Michael
94e5aa3dfa ;doc: update command help 2023-04-06 11:12:35 -10:00
Simon Michael
ba0bb5eb4a imp: close: restore legacy flags --closing/--opening/--close-to/--open-from (#2020)
They're cruft, but hidden and low cost and remove one more user hassle.
2023-04-06 11:12:35 -10:00
Simon Michael
c151d57069 imp: close: restore equity command alias; improve help/doc (#2020) 2023-04-06 11:12:35 -10:00
Simon Michael
1d83e14392 imp: close: more cleanup; add --close; always default to ALE (#2020) 2023-04-06 11:12:35 -10:00
Simon Michael
7695e409bf imp: close: tweak doc more (#2020) 2023-04-06 11:12:35 -10:00
Simon Michael
3660118575 imp: close: reorder/clean options more (#2020) 2023-04-06 11:12:35 -10:00
Simon Michael
19ea31dd61 fix: close: restore --open-acct option (#2020) 2023-04-06 11:12:35 -10:00
Simon Michael
3acd0a33df imp: close: reorder flags, rewrite help/doc (#2020) 2023-04-06 11:12:35 -10:00
Simon Michael
e8cf09f477 imp: acc: reorder/clean up flags 2023-03-30 10:58:46 -10:00
Simon Michael
c03d6b1123 imp: print: --match makes better choices
Previously, similarity completely outweighed recency, so a
slightly-more-similar transaction would always be selected no matter
how old it was. Now similarity and recency are more balanced,
and it should produce the desired transaction more often.
There is also new debug output (at debug level 1) for
troubleshooting.
2023-03-27 15:21:42 -10:00
Chris Lemaire
cddbae6467 queries: Prefix boolean queries with expr:
Boolean queries are now prefixed with an 'expr:' prefix, making them
completely separable from old queries and making the addition of them a
little more migration proof.

The tests are updated accordingly, changes made to the tests previously
are removed and extra cautious documentation is also removed.
2023-03-27 10:29:26 -10:00
Chris Lemaire
35db1cae4f queries: Add generalised boolean queries
This commit changes some of the functions in the Query module and
changes the overall way to parse queries. Instead of using the words''
split function, this commit starts to fully parse the query, as it's
seen as a type of expression.

AND, OR, NOT, and space operators can be used. The space operator
simulates the behaviour from before, leaving a minimal amount of tests
that need to be adjusted to comply to the new behaviour.
2023-03-27 10:29:26 -10:00
Simon Michael
69a8834803 dev: demo: notes 2023-03-18 20:49:12 -10:00
Simon Michael
062559cbd5 imp: demo: nicer output, show clearer start/stop indicators, don't show "exit" 2023-03-18 20:06:24 -10:00
Simon Michael
33876905f1 dev: lib: Hledger.Cli.Script: cleanup 2023-03-18 20:02:22 -10:00
Simon Michael
be8e64e498 imp: lib: export more terminal size, ANSI style/color helpers
Hledger.Utils.IO (and therefore Hledger and Hledger.Cli.Script) added:

    getTerminalHeightWidth
    getTerminalHeight
    getTerminalWidth
    Color(..)
    ColorIntensity(..)
    bold'
    faint'
    black'
    red'
    green'
    yellow'
    blue'
    magenta'
    cyan'
    white'
    brightBlack'
    brightRed'
    brightGreen'
    brightYellow'
    brightBlue'
    brightMagenta'
    brightCyan'
    brightWhite'
    rgb'
2023-03-18 19:59:00 -10:00
Simon Michael
8ec59eafac imp: demo: Getting help 2023-03-18 01:33:34 -10:00
Simon Michael
0520ef03f6 ;imp: demo: titles cleanup 2023-03-18 01:32:40 -10:00
Simon Michael
7632321b3c ;imp: cli: commands list cleanups 2023-03-18 01:14:31 -10:00
Simon Michael
6588020e64 ;doc: update CLI help text files 2023-03-17 00:53:57 -10:00
Simon Michael
8b2efe3c33 ;imp: demo: help updates 2023-03-17 00:53:30 -10:00
Simon Michael
bbb58c3804 imp: demo: Watching the built-in demos (demo) 2023-03-17 00:09:24 -10:00
Simon Michael
b9273a4585 imp: cli: move OTHER last in commands list 2023-03-16 23:20:14 -10:00
Simon Michael
98865d6025 imp: demo: split print / balance demos 2023-03-16 23:20:14 -10:00
Simon Michael
6777182c70 imp: demo: output cleanups 2023-03-16 23:20:14 -10:00
Simon Michael
2d496609bc imp: demo: hide the file names 2023-03-16 23:20:14 -10:00
Simon Michael
7e422cb12a ;doc: update CLI help text files 2023-03-16 21:58:39 -10:00
Simon Michael
38fd51b97c feat: embed some asciinema demos, and a demo command to play them 2023-03-16 21:58:38 -10:00
Simon Michael
70ef3e816c fix: stats: fix a regression in date display since 1.28 (#2012) 2023-03-16 14:52:37 -10:00
Simon Michael
62bb93af9c imp: lib: Hledger.Cli.Script: more re-exports
added:
Control.Applicative
Control.Concurrent
Data.Char
Data.Functor
System.IO
System.IO.Error
2023-03-16 14:36:29 -10:00
Simon Michael
d012384d57 ;dev: cli: also build with GHC 9.6.1 2023-03-14 10:49:58 -10:00
Yehoshua Pesach Wallach
7ddcf3b9e1 fix: doc: remove duplicate in hledger close docs 2023-03-13 09:23:18 -10:00