checkdates: docs

This commit is contained in:
Simon Michael 2017-09-12 18:24:22 -07:00
parent 3dc8dc428a
commit b4d70731e8
7 changed files with 220 additions and 203 deletions

View File

@ -23,7 +23,7 @@ import Text.Printf
-- checkdatesmode :: Mode RawOpts -- checkdatesmode :: Mode RawOpts
checkdatesmode = hledgerCommandMode checkdatesmode = hledgerCommandMode
[here| check-dates [here| check-dates
Check that transactions' dates are monotonically increasing. Check that transactions are sorted by increasing date.
With --date2, checks secondary dates instead. With --date2, checks secondary dates instead.
With --strict, dates must also be unique. With --strict, dates must also be unique.
With a query, only matched transactions' dates are checked. With a query, only matched transactions' dates are checked.

View File

@ -89,11 +89,6 @@ is an old pie chart generator, in need of some love.
[hledger-check.hs](https://github.com/simonmichael/hledger/blob/master/bin/hledger-check.hs) [hledger-check.hs](https://github.com/simonmichael/hledger/blob/master/bin/hledger-check.hs)
checks more powerful account balance assertions. checks more powerful account balance assertions.
### check-dates
[hledger-check-dates.hs](https://github.com/simonmichael/hledger/blob/master/bin/hledger-check-dates.hs#L15)
checks that journal entries are ordered by date.
### check-dupes ### check-dupes
[hledger-check-dupes.hs](https://github.com/simonmichael/hledger/blob/master/bin/hledger-check-dupes.hs#L21) [hledger-check-dupes.hs](https://github.com/simonmichael/hledger/blob/master/bin/hledger-check-dupes.hs#L21)

View File

@ -12,6 +12,10 @@ incomestatement`). You can also write any unambiguous prefix of a
command name (`hledger inc`), or one of the standard short aliases command name (`hledger inc`), or one of the standard short aliases
displayed in the command list (`hledger is`). displayed in the command list (`hledger is`).
Here are all the builtin commands in alphabetical order.
See also `hledger` for a more organised command list,
and `hledger CMD -h` for detailed command help.
<!-- <!--
--- ---
comment: comment:
@ -337,6 +341,10 @@ Normally cashflow shows changes in assets per period, though
as with [multicolumn balance reports](#multicolumn-balance-reports) as with [multicolumn balance reports](#multicolumn-balance-reports)
you can alter the report mode with `--change`/`--cumulative`/`--historical`. you can alter the report mode with `--change`/`--cumulative`/`--historical`.
## check-dates
Check that transactions are sorted by increasing date.
With a query, only matched transactions' dates are checked.
## help ## help
Show any of the hledger manuals. Show any of the hledger manuals.

View File

@ -1089,6 +1089,10 @@ Run a subcommand by writing its name as first argument (eg
You can also write any unambiguous prefix of a command name You can also write any unambiguous prefix of a command name
(\f[C]hledger\ inc\f[]), or one of the standard short aliases displayed (\f[C]hledger\ inc\f[]), or one of the standard short aliases displayed
in the command list (\f[C]hledger\ is\f[]). in the command list (\f[C]hledger\ is\f[]).
.PP
Here are all the builtin commands in alphabetical order.
See also \f[C]hledger\f[] for a more organised command list, and
\f[C]hledger\ CMD\ \-h\f[] for detailed command help.
.SS accounts .SS accounts
.PP .PP
Show account names. Show account names.
@ -1891,6 +1895,10 @@ report period.
Normally cashflow shows changes in assets per period, though as with Normally cashflow shows changes in assets per period, though as with
multicolumn balance reports you can alter the report mode with multicolumn balance reports you can alter the report mode with
\f[C]\-\-change\f[]/\f[C]\-\-cumulative\f[]/\f[C]\-\-historical\f[]. \f[C]\-\-change\f[]/\f[C]\-\-cumulative\f[]/\f[C]\-\-historical\f[].
.SS check\-dates
.PP
Check that transactions are sorted by increasing date.
With a query, only matched transactions\[aq] dates are checked.
.SS help .SS help
.PP .PP
Show any of the hledger manuals. Show any of the hledger manuals.
@ -2452,10 +2460,6 @@ hledger\-chart.hs is an old pie chart generator, in need of some love.
.SS check .SS check
.PP .PP
hledger\-check.hs checks more powerful account balance assertions. hledger\-check.hs checks more powerful account balance assertions.
.SS check\-dates
.PP
hledger\-check\-dates.hs checks that journal entries are ordered by
date.
.SS check\-dupes .SS check\-dupes
.PP .PP
hledger\-check\-dupes.hs checks for account names sharing the same leaf hledger\-check\-dupes.hs checks for account names sharing the same leaf

View File

@ -783,6 +783,10 @@ be listed as subcommands.
incomestatement'). You can also write any unambiguous prefix of a incomestatement'). You can also write any unambiguous prefix of a
command name ('hledger inc'), or one of the standard short aliases command name ('hledger inc'), or one of the standard short aliases
displayed in the command list ('hledger is'). displayed in the command list ('hledger is').
Here are all the builtin commands in alphabetical order. See also
'hledger' for a more organised command list, and 'hledger CMD -h' for
detailed command help.
* Menu: * Menu:
* accounts:: * accounts::
@ -792,6 +796,7 @@ displayed in the command list ('hledger is').
* balancesheet:: * balancesheet::
* balancesheetequity:: * balancesheetequity::
* cashflow:: * cashflow::
* check-dates::
* help:: * help::
* incomestatement:: * incomestatement::
* print:: * print::
@ -1410,7 +1415,7 @@ Total:
0 0
 
File: hledger.1.info, Node: cashflow, Next: help, Prev: balancesheetequity, Up: COMMANDS File: hledger.1.info, Node: cashflow, Next: check-dates, Prev: balancesheetequity, Up: COMMANDS
4.7 cashflow 4.7 cashflow
============ ============
@ -1480,9 +1485,18 @@ period, though as with multicolumn balance reports you can alter the
report mode with '--change'/'--cumulative'/'--historical'. report mode with '--change'/'--cumulative'/'--historical'.
 
File: hledger.1.info, Node: help, Next: incomestatement, Prev: cashflow, Up: COMMANDS File: hledger.1.info, Node: check-dates, Next: help, Prev: cashflow, Up: COMMANDS
4.8 help 4.8 check-dates
===============
Check that transactions are sorted by increasing date. With a query,
only matched transactions' dates are checked.

File: hledger.1.info, Node: help, Next: incomestatement, Prev: check-dates, Up: COMMANDS
4.9 help
======== ========
Show any of the hledger manuals. Show any of the hledger manuals.
@ -1519,8 +1533,8 @@ DESCRIPTION
 
File: hledger.1.info, Node: incomestatement, Next: print, Prev: help, Up: COMMANDS File: hledger.1.info, Node: incomestatement, Next: print, Prev: help, Up: COMMANDS
4.9 incomestatement 4.10 incomestatement
=================== ====================
Show an income statement. Alias: is. Show an income statement. Alias: is.
@ -1595,7 +1609,7 @@ report mode with '--change'/'--cumulative'/'--historical'.
 
File: hledger.1.info, Node: print, Next: register, Prev: incomestatement, Up: COMMANDS File: hledger.1.info, Node: print, Next: register, Prev: incomestatement, Up: COMMANDS
4.10 print 4.11 print
========== ==========
Show transactions from the journal. Show transactions from the journal.
@ -1689,7 +1703,7 @@ $ hledger print -Ocsv
 
File: hledger.1.info, Node: register, Next: stats, Prev: print, Up: COMMANDS File: hledger.1.info, Node: register, Next: stats, Prev: print, Up: COMMANDS
4.11 register 4.12 register
============= =============
Show postings and their running total. Alias: reg. Show postings and their running total. Alias: reg.
@ -1794,7 +1808,7 @@ length and comparable to the others in the report.
 
File: hledger.1.info, Node: Custom register output, Up: register File: hledger.1.info, Node: Custom register output, Up: register
4.11.1 Custom register output 4.12.1 Custom register output
----------------------------- -----------------------------
register uses the full terminal width by default, except on windows. register uses the full terminal width by default, except on windows.
@ -1826,7 +1840,7 @@ output.
 
File: hledger.1.info, Node: stats, Next: test, Prev: register, Up: COMMANDS File: hledger.1.info, Node: stats, Next: test, Prev: register, Up: COMMANDS
4.12 stats 4.13 stats
========== ==========
Show some journal statistics. Show some journal statistics.
@ -1858,7 +1872,7 @@ output destination.
 
File: hledger.1.info, Node: test, Prev: stats, Up: COMMANDS File: hledger.1.info, Node: test, Prev: stats, Up: COMMANDS
4.13 test 4.14 test
========= =========
Run built-in unit tests. Run built-in unit tests.
@ -2013,7 +2027,6 @@ start making your own!
* budget:: * budget::
* chart:: * chart::
* check:: * check::
* check-dates::
* check-dupes:: * check-dupes::
* equity:: * equity::
* prices:: * prices::
@ -2050,7 +2063,7 @@ File: hledger.1.info, Node: chart, Next: check, Prev: budget, Up: Experiment
hledger-chart.hs is an old pie chart generator, in need of some love. hledger-chart.hs is an old pie chart generator, in need of some love.
 
File: hledger.1.info, Node: check, Next: check-dates, Prev: chart, Up: Experimental add-ons File: hledger.1.info, Node: check, Next: check-dupes, Prev: chart, Up: Experimental add-ons
5.3.4 check 5.3.4 check
----------- -----------
@ -2058,17 +2071,9 @@ File: hledger.1.info, Node: check, Next: check-dates, Prev: chart, Up: Exper
hledger-check.hs checks more powerful account balance assertions. hledger-check.hs checks more powerful account balance assertions.
 
File: hledger.1.info, Node: check-dates, Next: check-dupes, Prev: check, Up: Experimental add-ons File: hledger.1.info, Node: check-dupes, Next: equity, Prev: check, Up: Experimental add-ons
5.3.5 check-dates 5.3.5 check-dupes
-----------------
hledger-check-dates.hs checks that journal entries are ordered by date.

File: hledger.1.info, Node: check-dupes, Next: equity, Prev: check-dates, Up: Experimental add-ons
5.3.6 check-dupes
----------------- -----------------
hledger-check-dupes.hs checks for account names sharing the same leaf hledger-check-dupes.hs checks for account names sharing the same leaf
@ -2077,7 +2082,7 @@ name.
 
File: hledger.1.info, Node: equity, Next: prices, Prev: check-dupes, Up: Experimental add-ons File: hledger.1.info, Node: equity, Next: prices, Prev: check-dupes, Up: Experimental add-ons
5.3.7 equity 5.3.6 equity
------------ ------------
hledger-equity.hs prints balance-resetting transactions, useful for hledger-equity.hs prints balance-resetting transactions, useful for
@ -2086,7 +2091,7 @@ bringing account balances across file boundaries.
 
File: hledger.1.info, Node: prices, Next: print-unique, Prev: equity, Up: Experimental add-ons File: hledger.1.info, Node: prices, Next: print-unique, Prev: equity, Up: Experimental add-ons
5.3.8 prices 5.3.7 prices
------------ ------------
hledger-prices.hs prints all prices from the journal. hledger-prices.hs prints all prices from the journal.
@ -2094,7 +2099,7 @@ hledger-prices.hs prints all prices from the journal.
 
File: hledger.1.info, Node: print-unique, Next: register-match, Prev: prices, Up: Experimental add-ons File: hledger.1.info, Node: print-unique, Next: register-match, Prev: prices, Up: Experimental add-ons
5.3.9 print-unique 5.3.8 print-unique
------------------ ------------------
hledger-print-unique.hs prints transactions which do not reuse an hledger-print-unique.hs prints transactions which do not reuse an
@ -2103,8 +2108,8 @@ already-seen description.
 
File: hledger.1.info, Node: register-match, Next: rewrite, Prev: print-unique, Up: Experimental add-ons File: hledger.1.info, Node: register-match, Next: rewrite, Prev: print-unique, Up: Experimental add-ons
5.3.10 register-match 5.3.9 register-match
--------------------- --------------------
hledger-register-match.hs helps ledger-autosync detect already-seen hledger-register-match.hs helps ledger-autosync detect already-seen
transactions when importing. transactions when importing.
@ -2112,7 +2117,7 @@ transactions when importing.
 
File: hledger.1.info, Node: rewrite, Next: tags, Prev: register-match, Up: Experimental add-ons File: hledger.1.info, Node: rewrite, Next: tags, Prev: register-match, Up: Experimental add-ons
5.3.11 rewrite 5.3.10 rewrite
-------------- --------------
hledger-rewrite.hs Adds one or more custom postings to matched hledger-rewrite.hs Adds one or more custom postings to matched
@ -2121,7 +2126,7 @@ transactions.
 
File: hledger.1.info, Node: tags, Prev: rewrite, Up: Experimental add-ons File: hledger.1.info, Node: tags, Prev: rewrite, Up: Experimental add-ons
5.3.12 tags 5.3.11 tags
----------- -----------
hledger-tags.hs Lists tag names in use. hledger-tags.hs Lists tag names in use.
@ -2165,93 +2170,93 @@ Node: QUERIES21498
Ref: #queries21602 Ref: #queries21602
Node: COMMANDS25569 Node: COMMANDS25569
Ref: #commands25683 Ref: #commands25683
Node: accounts26362 Node: accounts26542
Ref: #accounts26462 Ref: #accounts26642
Node: activity27444 Node: activity27624
Ref: #activity27556 Ref: #activity27736
Node: add27915 Node: add28095
Ref: #add28016 Ref: #add28196
Node: balance30674 Node: balance30854
Ref: #balance30787 Ref: #balance30967
Node: Flat mode33802 Node: Flat mode33982
Ref: #flat-mode33929 Ref: #flat-mode34109
Node: Depth limited balance reports34349 Node: Depth limited balance reports34529
Ref: #depth-limited-balance-reports34552 Ref: #depth-limited-balance-reports34732
Node: Multicolumn balance reports34972 Node: Multicolumn balance reports35152
Ref: #multicolumn-balance-reports35183 Ref: #multicolumn-balance-reports35363
Node: Custom balance output39831 Node: Custom balance output40011
Ref: #custom-balance-output40015 Ref: #custom-balance-output40195
Node: Colour support42108 Node: Colour support42288
Ref: #colour-support42269 Ref: #colour-support42449
Node: Output destination42442 Node: Output destination42622
Ref: #output-destination42600 Ref: #output-destination42780
Node: CSV output42870 Node: CSV output43050
Ref: #csv-output42989 Ref: #csv-output43169
Node: balancesheet43386 Node: balancesheet43566
Ref: #balancesheet43524 Ref: #balancesheet43704
Node: balancesheetequity45431 Node: balancesheetequity45611
Ref: #balancesheetequity45582 Ref: #balancesheetequity45762
Node: cashflow46371 Node: cashflow46551
Ref: #cashflow46494 Ref: #cashflow46681
Node: help48345 Node: check-dates48532
Ref: #help48457 Ref: #check-dates48654
Node: incomestatement49531 Node: help48771
Ref: #incomestatement49662 Ref: #help48886
Node: print51554 Node: incomestatement49960
Ref: #print51671 Ref: #incomestatement50093
Node: register55427 Node: print51985
Ref: #register55540 Ref: #print52102
Node: Custom register output60036 Node: register55858
Ref: #custom-register-output60167 Ref: #register55971
Node: stats61464 Node: Custom register output60467
Ref: #stats61570 Ref: #custom-register-output60598
Node: test62451 Node: stats61895
Ref: #test62538 Ref: #stats62001
Node: ADD-ON COMMANDS62906 Node: test62882
Ref: #add-on-commands63018 Ref: #test62969
Node: Official add-ons64305 Node: ADD-ON COMMANDS63337
Ref: #official-add-ons64447 Ref: #add-on-commands63449
Node: api64534 Node: Official add-ons64736
Ref: #api64625 Ref: #official-add-ons64878
Node: ui64677 Node: api64965
Ref: #ui64778 Ref: #api65056
Node: web64836 Node: ui65108
Ref: #web64927 Ref: #ui65209
Node: Third party add-ons64973 Node: web65267
Ref: #third-party-add-ons65150 Ref: #web65358
Node: diff65285 Node: Third party add-ons65404
Ref: #diff65384 Ref: #third-party-add-ons65581
Node: iadd65483 Node: diff65716
Ref: #iadd65599 Ref: #diff65815
Node: interest65682 Node: iadd65914
Ref: #interest65805 Ref: #iadd66030
Node: irr65900 Node: interest66113
Ref: #irr66000 Ref: #interest66236
Node: Experimental add-ons66078 Node: irr66331
Ref: #experimental-add-ons66232 Ref: #irr66431
Node: autosync66634 Node: Experimental add-ons66509
Ref: #autosync66748 Ref: #experimental-add-ons66663
Node: budget66987 Node: autosync67049
Ref: #budget67111 Ref: #autosync67163
Node: chart67177 Node: budget67402
Ref: #chart67296 Ref: #budget67526
Node: check67367 Node: chart67592
Ref: #check67491 Ref: #chart67711
Node: check-dates67558 Node: check67782
Ref: #check-dates67700 Ref: #check67906
Node: check-dupes67773 Node: check-dupes67973
Ref: #check-dupes67916 Ref: #check-dupes68110
Node: equity67993 Node: equity68187
Ref: #equity68121 Ref: #equity68315
Node: prices68240 Node: prices68434
Ref: #prices68369 Ref: #prices68563
Node: print-unique68424 Node: print-unique68618
Ref: #print-unique68573 Ref: #print-unique68767
Node: register-match68666 Node: register-match68860
Ref: #register-match68822 Ref: #register-match69014
Node: rewrite68920 Node: rewrite69112
Ref: #rewrite69054 Ref: #rewrite69246
Node: tags69132 Node: tags69324
Ref: #tags69237 Ref: #tags69429
 
End Tag Table End Tag Table

View File

@ -2,7 +2,7 @@
% _author_ % _author_
% _monthyear_ % _monthyear_
m4_dnl This man page is currently broken into smaller files as follows: m4_dnl This man page is composed from multiple files as follows:
m4_dnl m4_dnl
m4_dnl hledger.1.m4.md m4_dnl hledger.1.m4.md
m4_dnl examples.m4.md m4_dnl examples.m4.md

View File

@ -721,6 +721,10 @@ COMMANDS
a command name (hledger inc), or one of the standard short aliases dis- a command name (hledger inc), or one of the standard short aliases dis-
played in the command list (hledger is). played in the command list (hledger is).
Here are all the builtin commands in alphabetical order. See also
hledger for a more organised command list, and hledger CMD -h for
detailed command help.
accounts accounts
Show account names. Show account names.
@ -1325,16 +1329,20 @@ COMMANDS
though as with multicolumn balance reports you can alter the report though as with multicolumn balance reports you can alter the report
mode with --change/--cumulative/--historical. mode with --change/--cumulative/--historical.
check-dates
Check that transactions are sorted by increasing date. With a query,
only matched transactions' dates are checked.
help help
Show any of the hledger manuals. Show any of the hledger manuals.
The help command displays any of the main hledger manuals, in one of The help command displays any of the main hledger manuals, in one of
several ways. Run it with no argument to list the manuals, or provide several ways. Run it with no argument to list the manuals, or provide
a full or partial manual name to select one. a full or partial manual name to select one.
hledger manuals are available in several formats. hledger help will hledger manuals are available in several formats. hledger help will
use the first of these display methods that it finds: info, man, use the first of these display methods that it finds: info, man,
$PAGER, less, stdout (or when non-interactive, just stdout). You can $PAGER, less, stdout (or when non-interactive, just stdout). You can
force a particular viewer with the --info, --man, --pager, --cat flags. force a particular viewer with the --info, --man, --pager, --cat flags.
$ hledger help $ hledger help
@ -1364,7 +1372,7 @@ COMMANDS
show balance change in each period (default) show balance change in each period (default)
--cumulative --cumulative
show balance change accumulated across periods (in multicolumn show balance change accumulated across periods (in multicolumn
reports), instead of changes during periods reports), instead of changes during periods
-H --historical -H --historical
@ -1395,8 +1403,8 @@ COMMANDS
--format=LINEFORMAT --format=LINEFORMAT
in single-column balance reports: use this custom line format in single-column balance reports: use this custom line format
This command displays a simple income statement. It currently assumes This command displays a simple income statement. It currently assumes
that you have top-level accounts named income (or revenue) and expense that you have top-level accounts named income (or revenue) and expense
(plural forms also allowed.) (plural forms also allowed.)
$ hledger incomestatement $ hledger incomestatement
@ -1421,8 +1429,8 @@ COMMANDS
0 0
With a reporting interval, multiple columns will be shown, one for each With a reporting interval, multiple columns will be shown, one for each
report period. Normally incomestatement shows revenues/expenses per report period. Normally incomestatement shows revenues/expenses per
period, though as with multicolumn balance reports you can alter the period, though as with multicolumn balance reports you can alter the
report mode with --change/--cumulative/--historical. report mode with --change/--cumulative/--historical.
print print
@ -1432,14 +1440,14 @@ COMMANDS
show all amounts explicitly show all amounts explicitly
-m STR --match=STR -m STR --match=STR
show the transaction whose description is most similar to STR, show the transaction whose description is most similar to STR,
and is most recent and is most recent
-O FMT --output-format=FMT -O FMT --output-format=FMT
select the output format. Supported formats: txt, csv. select the output format. Supported formats: txt, csv.
-o FILE --output-file=FILE -o FILE --output-file=FILE
write output to FILE. A file extension matching one of the write output to FILE. A file extension matching one of the
above formats selects that format. above formats selects that format.
$ hledger print $ hledger print
@ -1467,23 +1475,23 @@ COMMANDS
The print command displays full journal entries (transactions) from the The print command displays full journal entries (transactions) from the
journal file, tidily formatted. journal file, tidily formatted.
As of hledger 1.2, print's output is always a valid hledger journal. As of hledger 1.2, print's output is always a valid hledger journal.
However it may not preserve all original content, eg it does not print However it may not preserve all original content, eg it does not print
directives or inter-transaction comments. directives or inter-transaction comments.
Normally, transactions' implicit/explicit amount style is preserved: Normally, transactions' implicit/explicit amount style is preserved:
when an amount is omitted in the journal, it will be omitted in the when an amount is omitted in the journal, it will be omitted in the
output. You can use the -x/--explicit flag to make all amounts output. You can use the -x/--explicit flag to make all amounts
explicit, which can be useful for troubleshooting or for making your explicit, which can be useful for troubleshooting or for making your
journal more readable and robust against data entry errors. Note, in journal more readable and robust against data entry errors. Note, in
this mode postings with a multi-commodity amount (possible with an this mode postings with a multi-commodity amount (possible with an
implicit amount in a multi-commodity transaction) will be split into implicit amount in a multi-commodity transaction) will be split into
multiple single-commodity postings, for valid journal output. multiple single-commodity postings, for valid journal output.
With -B/--cost, amounts with transaction prices are converted to cost With -B/--cost, amounts with transaction prices are converted to cost
(using the transaction price). (using the transaction price).
The print command also supports output destination and CSV output. The print command also supports output destination and CSV output.
Here's an example of print's CSV output: Here's an example of print's CSV output:
$ hledger print -Ocsv $ hledger print -Ocsv
@ -1500,20 +1508,20 @@ COMMANDS
"5","2008/12/31","","*","","pay off","","liabilities:debts","1","$","","1","","" "5","2008/12/31","","*","","pay off","","liabilities:debts","1","$","","1","",""
"5","2008/12/31","","*","","pay off","","assets:bank:checking","-1","$","1","","","" "5","2008/12/31","","*","","pay off","","assets:bank:checking","-1","$","1","","",""
o There is one CSV record per posting, with the parent transaction's o There is one CSV record per posting, with the parent transaction's
fields repeated. fields repeated.
o The "txnidx" (transaction index) field shows which postings belong to o The "txnidx" (transaction index) field shows which postings belong to
the same transaction. (This number might change if transactions are the same transaction. (This number might change if transactions are
reordered within the file, files are parsed/included in a different reordered within the file, files are parsed/included in a different
order, etc.) order, etc.)
o The amount is separated into "commodity" (the symbol) and "amount" o The amount is separated into "commodity" (the symbol) and "amount"
(numeric quantity) fields. (numeric quantity) fields.
o The numeric amount is repeated in either the "credit" or "debit" col- o The numeric amount is repeated in either the "credit" or "debit" col-
umn, for convenience. (Those names are not accurate in the account- umn, for convenience. (Those names are not accurate in the account-
ing sense; it just puts negative amounts under credit and zero or ing sense; it just puts negative amounts under credit and zero or
greater amounts under debit.) greater amounts under debit.)
register register
@ -1523,7 +1531,7 @@ COMMANDS
show running total from report start date (default) show running total from report start date (default)
-H --historical -H --historical
show historical running total/balance (includes postings before show historical running total/balance (includes postings before
report start date) report start date)
-A --average -A --average
@ -1534,18 +1542,18 @@ COMMANDS
show postings' siblings instead show postings' siblings instead
-w N --width=N -w N --width=N
set output width (default: terminal width or COLUMNS. -wN,M set output width (default: terminal width or COLUMNS. -wN,M
sets description width as well) sets description width as well)
-O FMT --output-format=FMT -O FMT --output-format=FMT
select the output format. Supported formats: txt, csv. select the output format. Supported formats: txt, csv.
-o FILE --output-file=FILE -o FILE --output-file=FILE
write output to FILE. A file extension matching one of the write output to FILE. A file extension matching one of the
above formats selects that format. above formats selects that format.
The register command displays postings, one per line, and their running The register command displays postings, one per line, and their running
total. This is typically used with a query selecting a particular total. This is typically used with a query selecting a particular
account, to see that account's activity: account, to see that account's activity:
$ hledger register checking $ hledger register checking
@ -1554,8 +1562,8 @@ COMMANDS
2008/06/02 save assets:bank:checking $-1 $1 2008/06/02 save assets:bank:checking $-1 $1
2008/12/31 pay off assets:bank:checking $-1 0 2008/12/31 pay off assets:bank:checking $-1 0
The --historical/-H flag adds the balance from any undisplayed prior The --historical/-H flag adds the balance from any undisplayed prior
postings to the running total. This is useful when you want to see postings to the running total. This is useful when you want to see
only recent activity, with a historically accurate running balance: only recent activity, with a historically accurate running balance:
$ hledger register checking -b 2008/6 --historical $ hledger register checking -b 2008/6 --historical
@ -1565,23 +1573,23 @@ COMMANDS
The --depth option limits the amount of sub-account detail displayed. The --depth option limits the amount of sub-account detail displayed.
The --average/-A flag shows the running average posting amount instead The --average/-A flag shows the running average posting amount instead
of the running total (so, the final number displayed is the average for of the running total (so, the final number displayed is the average for
the whole report period). This flag implies --empty (see below). It the whole report period). This flag implies --empty (see below). It
is affected by --historical. It works best when showing just one is affected by --historical. It works best when showing just one
account and one commodity. account and one commodity.
The --related/-r flag shows the other postings in the transactions of The --related/-r flag shows the other postings in the transactions of
the postings which would normally be shown. the postings which would normally be shown.
With a reporting interval, register shows summary postings, one per With a reporting interval, register shows summary postings, one per
interval, aggregating the postings to each account: interval, aggregating the postings to each account:
$ hledger register --monthly income $ hledger register --monthly income
2008/01 income:salary $-1 $-1 2008/01 income:salary $-1 $-1
2008/06 income:gifts $-1 $-2 2008/06 income:gifts $-1 $-2
Periods with no activity, and summary postings with a zero amount, are Periods with no activity, and summary postings with a zero amount, are
not shown by default; use the --empty/-E flag to see them: not shown by default; use the --empty/-E flag to see them:
$ hledger register --monthly income -E $ hledger register --monthly income -E
@ -1598,7 +1606,7 @@ COMMANDS
2008/11 0 $-2 2008/11 0 $-2
2008/12 0 $-2 2008/12 0 $-2
Often, you'll want to see just one line per interval. The --depth Often, you'll want to see just one line per interval. The --depth
option helps with this, causing subaccounts to be aggregated: option helps with this, causing subaccounts to be aggregated:
$ hledger register --monthly assets --depth 1h $ hledger register --monthly assets --depth 1h
@ -1606,19 +1614,19 @@ COMMANDS
2008/06 assets $-1 0 2008/06 assets $-1 0
2008/12 assets $-1 $-1 2008/12 assets $-1 $-1
Note when using report intervals, if you specify start/end dates these Note when using report intervals, if you specify start/end dates these
will be adjusted outward if necessary to contain a whole number of will be adjusted outward if necessary to contain a whole number of
intervals. This ensures that the first and last intervals are full intervals. This ensures that the first and last intervals are full
length and comparable to the others in the report. length and comparable to the others in the report.
Custom register output Custom register output
register uses the full terminal width by default, except on windows. register uses the full terminal width by default, except on windows.
You can override this by setting the COLUMNS environment variable (not You can override this by setting the COLUMNS environment variable (not
a bash shell variable) or by using the --width/-w option. a bash shell variable) or by using the --width/-w option.
The description and account columns normally share the space equally The description and account columns normally share the space equally
(about half of (width - 40) each). You can adjust this by adding a (about half of (width - 40) each). You can adjust this by adding a
description width as part of --width's argument, comma-separated: description width as part of --width's argument, comma-separated:
--width W,D . Here's a diagram: --width W,D . Here's a diagram:
<--------------------------------- width (W) ----------------------------------> <--------------------------------- width (W) ---------------------------------->
@ -1634,14 +1642,14 @@ COMMANDS
$ hledger reg -w 100,40 # set overall width 100, description width 40 $ hledger reg -w 100,40 # set overall width 100, description width 40
$ hledger reg -w $COLUMNS,40 # use terminal width, and set description width $ hledger reg -w $COLUMNS,40 # use terminal width, and set description width
The register command also supports the -o/--output-file and -O/--out- The register command also supports the -o/--output-file and -O/--out-
put-format options for controlling output destination and CSV output. put-format options for controlling output destination and CSV output.
stats stats
Show some journal statistics. Show some journal statistics.
-o FILE --output-file=FILE -o FILE --output-file=FILE
write output to FILE. A file extension matching one of the write output to FILE. A file extension matching one of the
above formats selects that format. above formats selects that format.
$ hledger stats $ hledger stats
@ -1656,8 +1664,8 @@ COMMANDS
Accounts : 8 (depth 3) Accounts : 8 (depth 3)
Commodities : 1 ($) Commodities : 1 ($)
The stats command displays summary information for the whole journal, The stats command displays summary information for the whole journal,
or a matched part of it. With a reporting interval, it shows a report or a matched part of it. With a reporting interval, it shows a report
for each report period. for each report period.
The stats command also supports -o/--output-file for controlling output The stats command also supports -o/--output-file for controlling output
@ -1669,34 +1677,34 @@ COMMANDS
$ hledger test $ hledger test
Cases: 74 Tried: 74 Errors: 0 Failures: 0 Cases: 74 Tried: 74 Errors: 0 Failures: 0
This command runs hledger's built-in unit tests and displays a quick This command runs hledger's built-in unit tests and displays a quick
report. With a regular expression argument, it selects only tests with report. With a regular expression argument, it selects only tests with
matching names. It's mainly used in development, but it's also nice to matching names. It's mainly used in development, but it's also nice to
be able to check your hledger executable for smoke at any time. be able to check your hledger executable for smoke at any time.
ADD-ON COMMANDS ADD-ON COMMANDS
hledger also searches for external add-on commands, and will include hledger also searches for external add-on commands, and will include
these in the commands list. These are programs or scripts in your PATH these in the commands list. These are programs or scripts in your PATH
whose name starts with hledger- and ends with a recognised file exten- whose name starts with hledger- and ends with a recognised file exten-
sion (currently: no extension, bat,com,exe, hs,lhs,pl,py,rb,rkt,sh). sion (currently: no extension, bat,com,exe, hs,lhs,pl,py,rb,rkt,sh).
Add-ons can be invoked like any hledger command, but there are a few Add-ons can be invoked like any hledger command, but there are a few
things to be aware of. Eg if the hledger-web add-on is installed, things to be aware of. Eg if the hledger-web add-on is installed,
o hledger -h web shows hledger's help, while hledger web -h shows o hledger -h web shows hledger's help, while hledger web -h shows
hledger-web's help. hledger-web's help.
o Flags specific to the add-on must have a preceding -- to hide them o Flags specific to the add-on must have a preceding -- to hide them
from hledger. So hledger web --serve --port 9000 will be rejected; from hledger. So hledger web --serve --port 9000 will be rejected;
you must use hledger web -- --serve --port 9000. you must use hledger web -- --serve --port 9000.
o You can always run add-ons directly if preferred: o You can always run add-ons directly if preferred:
hledger-web --serve --port 9000. hledger-web --serve --port 9000.
Add-ons are a relatively easy way to add local features or experiment Add-ons are a relatively easy way to add local features or experiment
with new ideas. They can be written in any language, but haskell with new ideas. They can be written in any language, but haskell
scripts have a big advantage: they can use the same hledger (and scripts have a big advantage: they can use the same hledger (and
haskell) library functions that built-in commands do, for command-line haskell) library functions that built-in commands do, for command-line
options, journal parsing, reporting, etc. options, journal parsing, reporting, etc.
Here are some hledger add-ons available: Here are some hledger add-ons available:
@ -1714,7 +1722,7 @@ ADD-ON COMMANDS
hledger-web provides a simple web interface. hledger-web provides a simple web interface.
Third party add-ons Third party add-ons
These are maintained separately, and usually updated shortly after a These are maintained separately, and usually updated shortly after a
hledger release. hledger release.
diff diff
@ -1722,7 +1730,7 @@ ADD-ON COMMANDS
journal file and another. journal file and another.
iadd iadd
hledger-iadd is a curses-style, more interactive replacement for the hledger-iadd is a curses-style, more interactive replacement for the
add command. add command.
interest interest
@ -1730,19 +1738,19 @@ ADD-ON COMMANDS
ing to various schemes. ing to various schemes.
irr irr
hledger-irr calculates the internal rate of return of an investment hledger-irr calculates the internal rate of return of an investment
account. account.
Experimental add-ons Experimental add-ons
These are available in source form in the hledger repo's bin/ direc- These are available in source form in the hledger repo's bin/ direc-
tory; installing them is pretty easy. They may be less mature and doc- tory; installing them is pretty easy. They may be less mature and doc-
umented than built-in commands. Reading and tweaking these is a good umented than built-in commands. Reading and tweaking these is a good
way to start making your own! way to start making your own!
autosync autosync
hledger-autosync is a symbolic link for easily running ledger-autosync, hledger-autosync is a symbolic link for easily running ledger-autosync,
if installed. ledger-autosync does deduplicating conversion of OFX if installed. ledger-autosync does deduplicating conversion of OFX
data and some CSV formats, and can also download the data if your bank data and some CSV formats, and can also download the data if your bank
offers OFX Direct Connect. offers OFX Direct Connect.
budget budget
@ -1754,9 +1762,6 @@ ADD-ON COMMANDS
check check
hledger-check.hs checks more powerful account balance assertions. hledger-check.hs checks more powerful account balance assertions.
check-dates
hledger-check-dates.hs checks that journal entries are ordered by date.
check-dupes check-dupes
hledger-check-dupes.hs checks for account names sharing the same leaf hledger-check-dupes.hs checks for account names sharing the same leaf
name. name.