Commit Graph

13769 Commits

Author SHA1 Message Date
Simon Michael
4a5b0d46b5 imp: setup v2, simpler implementation and shorter output
This one tests only with the currently running hledger, and requires being installed in PATH to show full info.
2025-04-25 11:53:57 -10:00
Simon Michael
78baaee6c5 lib: more version helpers, rename to HledgerBinaryInfo, silence warnings 2025-04-25 09:36:38 -10:00
Simon Michael
b0959cb23d lib:Hledger.Utils.IO: document some file reading utilities 2025-04-25 09:21:11 -10:00
Simon Michael
45d5fd7963 imp: show a clearer error message on unicode en/decoding failures [#73]
A very long-awaited improvement: for unicode exceptions, and I/O
exceptions which look like they were caused by a unicode error
(usually text decoding failure), our error message now includes
an explanation and advice on what to do.

Currently this uses the GHC.IO.Encoding API, which is not ideal:
"The API of this module is unstable and not meant to be consumed by
the general public. If you absolutely must depend on it, make sure to
use a tight upper bound, e.g., base < 4.X rather than base < 5,
because the interface can change rapidly without much warning."

Also it relies on scanning for patterns in GHC's various
unicode-related error messages, which may not be complete and could
change in future. To do: try the encoding package's IO helpers,
perhaps they give more specific exceptions.
2025-04-25 08:57:07 -10:00
Simon Michael
06cd0f9472 lib: exitOnExceptions -> exitOnError 2025-04-25 08:32:47 -10:00
Simon Michael
d1e4d00b8d lib: Cli,UI,WebOptions: export binaryinfo 2025-04-25 08:26:14 -10:00
Simon Michael
d3af9f0217 ;doc:check: edits 2025-04-24 11:27:28 -10:00
Simon Michael
d37000726d ;doc:check: edits 2025-04-24 11:13:29 -10:00
Simon Michael
650901901f ;doc:check: edits 2025-04-24 10:53:44 -10:00
Simon Michael
fea127fcb5 ;doc: note check-related bug in rawOptsToInputOpts [#2377] 2025-04-24 10:44:34 -10:00
Simon Michael
0d6023b812 ;doc:balance: edits 2025-04-24 09:59:27 -10:00
Simon Michael
78dfe72a92 ;tools: just nightlybin: force push 2025-04-23 22:50:34 -10:00
Simon Michael
8705b935de imp:setup: output tweaks 2025-04-23 22:50:19 -10:00
Simon Michael
b295cce796 ;doc: cleanup 2025-04-23 21:43:45 -10:00
Simon Michael
eec803f19b imp:setup: more setup tests; improve logic, output 2025-04-23 21:43:30 -10:00
Simon Michael
03589e294b lib: make getConf total; add getConf' 2025-04-23 21:43:30 -10:00
Simon Michael
036be45c50 lib: make parseYN(A) total; export findPager 2025-04-23 21:43:30 -10:00
Simon Michael
4788bd9e41 lib: journalCommoditiesUsed 2025-04-23 21:43:30 -10:00
Simon Michael
6cf40a76d1 lib: parseHledgerVersion: also save the package version as text 2025-04-23 11:00:49 -10:00
Simon Michael
cd6288a8eb imp:setup: output tweaks 2025-04-22 19:12:16 -10:00
Simon Michael
b0b081f20d imp:setup: check account type declarations
Begin analysing account type declarations (finally).
Setting up account types when getting started is just a bit too complicated
to be easily understood or easily documented.
Making that easy is one of the goals for the setup command.
2025-04-22 19:02:05 -10:00
Simon Michael
255e79c550 lib: Hledger.Read: more ways to read the default journal
defaultJournalWith, defaultJournalSafely, defaultJournalSafelyWith
2025-04-22 18:50:42 -10:00
Simon Michael
f39b34184e lib: and setup: robust parsing of hledger --version output 2025-04-22 17:02:44 -10:00
Simon Michael
a13b7d2a82 lib: Hledger.Data.Dates.parsedate: also accept YYYYMMDD format; document
- Added support for unseparated dates, for convenience in ghci and for parseHledgerVersion
- Noted two user-facing uses: --value's argument, and import's .latest files.
  YYYYMMDD dates will now also work there. Left this undocumented.
- Noted this is now more permissive, parsing many integers successfully; not expecting problems.
2025-04-22 16:59:57 -10:00
Simon Michael
98b40b2b0e ;dev: fix a warning 2025-04-22 12:26:55 -10:00
Simon Michael
32f2ef9b15 ;doc:queries: fix the explanation of boolean queries and space-separated terms 2025-04-22 12:15:03 -10:00
Simon Michael
b7509030c5 lib: Hledger.Data.Dates: parsedateM -> parsedate
M makes me think of monad and is awkward to type for this common helper; Maybe is expected for a parser.
2025-04-22 10:40:41 -10:00
Simon Michael
2288f5193d fix:setup: refactor, fix a case not returning installed version 2025-04-22 09:06:27 -10:00
Simon Michael
6b5be96d27 imp:setup: improve config file tests, run only when supported 2025-04-22 08:53:43 -10:00
Simon Michael
3e8f3a4506 ;doc:cli:changelog: consistent release headings
just rels now shows more release dates
2025-04-21 18:16:08 -10:00
Simon Michael
4529a8c4a1 imp: setup: smarter logic, more robustness
- Test the hledger in PATH, not the one running
- Handle old hledger versions as well as recent ones
- Handle errors, remove early terminations
2025-04-21 15:31:23 -10:00
Simon Michael
5334e7924b lib: Hledger.Cli.Version: rename PackageVersionString, more helpers 2025-04-21 15:14:12 -10:00
Simon Michael
50a85fc5ca dev: setup: cleanup 2025-04-20 16:13:28 -10:00
Simon Michael
8edef3345e feat: setup command, checks hledger installation (Merge branch 'sm-setup')
Not yet finished, but it's useful and usable so far.
2025-04-20 10:54:26 -10:00
Simon Michael
f0ff2aa34e imp: setup: show full --version output 2025-04-20 10:52:50 -10:00
Simon Michael
c3c91448a7 imp: setup: output tweaks 2025-04-20 10:52:50 -10:00
Simon Michael
a18a4c612d imp: setup: get version from hledger.org, hackage is down 2025-04-20 10:52:50 -10:00
Simon Michael
580bc0a8f8 dev: setup: refactor output helpers 2025-04-20 10:52:50 -10:00
Simon Michael
8b48fc41bc imp: setup: version check: improve error output when unknown 2025-04-20 10:52:50 -10:00
Simon Michael
97e2e8572f imp: setup: version check: add a timeout, improve error output 2025-04-20 10:52:50 -10:00
Simon Michael
15173eeeb0 imp: setup: test default file setup 2025-04-20 10:52:50 -10:00
Simon Michael
f37a4a7dcb lib: refactor, export getHomeSafe 2025-04-20 10:52:50 -10:00
Simon Michael
4881a0deaa ;doc:setup 2025-04-20 10:52:50 -10:00
Simon Michael
75cd521ed7 imp:setup: drop unused options 2025-04-20 10:52:50 -10:00
Simon Michael
2ef7434f47 imp:setup: check files setup (WIP) 2025-04-20 10:52:50 -10:00
Simon Michael
d408f00b42 imp:setup: use HEAD instead of GET to check current version 2025-04-20 10:52:50 -10:00
Simon Michael
98da9709fc imp:setup: config file tests; tidier more portable color-aware output 2025-04-20 10:52:50 -10:00
Simon Michael
bb7510194e imp: setup: setup ignores the config file itself, for robustness 2025-04-20 10:52:50 -10:00
Simon Michael
daf550bbb0 imp: Hledger.Cli.Conf: refactor, expose more info about config files 2025-04-20 10:52:50 -10:00
Simon Michael
320d197735 imp:setup: more hledger setup tests 2025-04-20 10:52:50 -10:00