;update CLI usage texts

This commit is contained in:
Simon Michael 2020-11-30 08:41:21 -08:00
parent a5adc14aaa
commit 679373c835

View File

@ -1,47 +1,68 @@
check check
Check for various kinds of errors in your data. Check for various kinds of errors in your data. experimental
_FLAGS _FLAGS
hledger provides a number of built-in error checks to help prevent hledger provides a number of built-in error checks to help prevent
problems in your data. Some, but not all, of these are run automatically problems in your data. Some of these are run automatically; or, you can
before all commands. You can also use this check command to run any of use this check command to run them on demand, with no output and a zero
the available tests. They are named, and run, as follows: exit code if all is well. Some examples:
hledger check runs the basic checks, like all other commands, but with hledger check # basic checks
no output unless there is a problem. These are: hledger check -s # basic + strict checks
hledger check ordereddates uniqueleafnames # basic + specified checks
Here are the checks currently available:
Basic checks
These are always run by this command and other commands:
- parseable - data files are well-formed and can be successfully - parseable - data files are well-formed and can be successfully
parsed parsed
- autobalanced - all transactions are balanced, inferring missing - autobalanced - all transactions are balanced, inferring missing
amounts where necessary, and possibly converting commodities using amounts where necessary, and possibly converting commodities using
transaction prices or automatically-inferred transaction prices transaction prices or automatically-inferred transaction prices
- assertions - all balance assertions are passing (except with
-I/--ignore-assertions)
hledger check --strict also runs the additional "strict mode" checks, - assertions - all balance assertions in the journal are passing.
which are: (This check can be disabled with -I/--ignore-assertions.)
Strict checks
These are always run by this and other commands when -s/--strict is used
(strict mode):
- accounts - all account names used by transactions have been declared - accounts - all account names used by transactions have been declared
- commodities - all commodity symbols used have been declared - commodities - all commodity symbols used have been declared
hledger check CHECK1 CHECK2 ... runs all of the named checks, in turn. Other checks
This may be useful when neither the default nor strict checks are
exactly what you want, or when you want to focus on a single check of
interest. The arguments are standard lowercase names for the checks.
Currently only these checks can be run in this way:
- dates - transactions are ordered by date (similar to the old These checks can be run by specifying their names as arguments to the
check command:
- ordereddates - transactions are ordered by date (similar to the old
check-dates command) check-dates command)
- leafnames - all account leaf names are unique ((similar to the old
check-dupes command)
See also: - uniqueleafnames - all account leaf names are unique (similar to the
old check-dupes command)
Some checks are shipped as addon scripts for now (cf This command would run all of the checks above:
https://github.com/simonmichael/hledger/tree/master/bin, and Cookbook ->
Scripting):
- tagfiles - all tag values containing / (a forward slash) exist as $ hledger check -s ordereddates uniqueleafnames
file paths
- fancyassertions - more complex balance assertions are passing Addon checks
Some checks are not yet integrated with this command, but are available
as [addon commands] in
https://github.com/simonmichael/hledger/tree/master/bin:
- hledger-check-tagfiles - all tag values containing / (a forward
slash) exist as file paths
- hledger-check-fancyassertions - more complex balance assertions are
passing
You could make your own similar scripts to perform custom checks;
Cookbook -> Scripting may be helpful.