update embedded manuals

This commit is contained in:
Simon Michael 2017-10-31 12:38:37 -07:00
parent a3fa09b604
commit 676eb6e1a2
14 changed files with 547 additions and 558 deletions

View File

@ -1,4 +1,4 @@
This is hledger-api.1.info, produced by makeinfo version 6.0 from stdin.
This is hledger-api.1.info, produced by makeinfo version 6.1 from stdin.

File: hledger-api.1.info, Node: Top, Next: OPTIONS, Up: (dir)

View File

@ -1,4 +1,4 @@
This is hledger_csv.5.info, produced by makeinfo version 6.0 from stdin.
This is hledger_csv.5.info, produced by makeinfo version 6.1 from stdin.

File: hledger_csv.5.info, Node: Top, Next: CSV RULES, Up: (dir)

View File

@ -126,59 +126,59 @@ CSV RULES
newest-first
newest-first
Consider adding this rule if all of the following are true: you might
be processing just one day of data, your CSV records are in reverse
chronological order (newest first), and you care about preserving the
order of same-day transactions. It usually isn't needed, because
hledger autodetects the CSV order, but when all CSV records have the
Consider adding this rule if all of the following are true: you might
be processing just one day of data, your CSV records are in reverse
chronological order (newest first), and you care about preserving the
order of same-day transactions. It usually isn't needed, because
hledger autodetects the CSV order, but when all CSV records have the
same date it will assume they are oldest first.
CSV TIPS
CSV ordering
The generated journal entries will be sorted by date. The order of
same-day entries will be preserved (except in the special case where
The generated journal entries will be sorted by date. The order of
same-day entries will be preserved (except in the special case where
you might need newest-first, see above).
CSV accounts
Each journal entry will have two postings, to account1 and account2
Each journal entry will have two postings, to account1 and account2
respectively. It's not yet possible to generate entries with more than
two postings. It's conventional and recommended to use account1 for
two postings. It's conventional and recommended to use account1 for
the account whose CSV we are reading.
CSV amounts
The amount field sets the amount of the account1 posting.
If the CSV has debit/credit amounts in separate fields, assign to the
amount-in and amount-out pseudo fields instead. (Whichever one has a
If the CSV has debit/credit amounts in separate fields, assign to the
amount-in and amount-out pseudo fields instead. (Whichever one has a
value will be used, with appropriate sign. If both contain a value, it
may not work so well.)
If an amount value is parenthesised, it will be de-parenthesised and
If an amount value is parenthesised, it will be de-parenthesised and
sign-flipped.
If an amount value begins with a double minus sign, those will cancel
If an amount value begins with a double minus sign, those will cancel
out and be removed.
If the CSV has the currency symbol in a separate field, assign that to
the currency pseudo field to have it prepended to the amount. Or, you
can use a field assignment to amount that interpolates both CSV fields
If the CSV has the currency symbol in a separate field, assign that to
the currency pseudo field to have it prepended to the amount. Or, you
can use a field assignment to amount that interpolates both CSV fields
(giving more control, eg to put the currency symbol on the right).
CSV balance assertions
If the CSV includes a running balance, you can assign that to the bal-
ance pseudo field; whenever the running balance value is non-empty, it
If the CSV includes a running balance, you can assign that to the bal-
ance pseudo field; whenever the running balance value is non-empty, it
will be asserted as the balance after the account1 posting.
Reading multiple CSV files
You can read multiple CSV files at once using multiple -f arguments on
the command line, and hledger will look for a correspondingly-named
You can read multiple CSV files at once using multiple -f arguments on
the command line, and hledger will look for a correspondingly-named
rules file for each. Note if you use the --rules-file option, this one
rules file will be used for all the CSV files being read.
REPORTING BUGS
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
or hledger mail list)
@ -192,7 +192,7 @@ COPYRIGHT
SEE ALSO
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time-
dot(5), ledger(1)

View File

@ -1,4 +1,4 @@
This is hledger_journal.5.info, produced by makeinfo version 6.0 from
This is hledger_journal.5.info, produced by makeinfo version 6.1 from
stdin.


View File

@ -7,23 +7,23 @@ NAME
Journal - hledger's default file format, representing a General Journal
DESCRIPTION
hledger's usual data source is a plain text file containing journal
entries in hledger journal format. This file represents a standard
accounting general journal. I use file names ending in .journal, but
hledger's usual data source is a plain text file containing journal
entries in hledger journal format. This file represents a standard
accounting general journal. I use file names ending in .journal, but
that's not required. The journal file contains a number of transaction
entries, each describing a transfer of money (or any commodity) between
two or more named accounts, in a simple format readable by both hledger
and humans.
hledger's journal format is a compatible subset, mostly, of ledger's
journal format, so hledger can work with compatible ledger journal
files as well. It's safe, and encouraged, to run both hledger and
hledger's journal format is a compatible subset, mostly, of ledger's
journal format, so hledger can work with compatible ledger journal
files as well. It's safe, and encouraged, to run both hledger and
ledger on the same journal file, eg to validate the results you're get-
ting.
You can use hledger without learning any more about this file; just use
the add or web commands to create and update it. Many users, though,
also edit the journal file directly with a text editor, perhaps
the add or web commands to create and update it. Many users, though,
also edit the journal file directly with a text editor, perhaps
assisted by the helper modes for emacs or vim.
Here's an example:
@ -57,73 +57,73 @@ DESCRIPTION
FILE FORMAT
Transactions
Transactions are movements of some quantity of commodities between
named accounts. Each transaction is represented by a journal entry
beginning with a simple date in column 0. This can be followed by any
Transactions are movements of some quantity of commodities between
named accounts. Each transaction is represented by a journal entry
beginning with a simple date in column 0. This can be followed by any
of the following, separated by spaces:
o (optional) a status character (empty, !, or *)
o (optional) a transaction code (any short number or text, enclosed in
o (optional) a transaction code (any short number or text, enclosed in
parentheses)
o (optional) a transaction description (any remaining text until end of
line or a semicolon)
o (optional) a transaction comment (any remaining text following a
o (optional) a transaction comment (any remaining text following a
semicolon until end of line)
Then comes zero or more (but usually at least 2) indented lines repre-
Then comes zero or more (but usually at least 2) indented lines repre-
senting...
Postings
A posting is an addition of some amount to, or removal of some amount
from, an account. Each posting line begins with at least one space or
A posting is an addition of some amount to, or removal of some amount
from, an account. Each posting line begins with at least one space or
tab (2 or 4 spaces is common), followed by:
o (optional) a status character (empty, !, or *), followed by a space
o (required) an account name (any text, optionally containing single
o (required) an account name (any text, optionally containing single
spaces, until end of line or a double space)
o (optional) two or more spaces or tabs followed by an amount.
Positive amounts are being added to the account, negative amounts are
Positive amounts are being added to the account, negative amounts are
being removed.
The amounts within a transaction must always sum up to zero. As a con-
venience, one amount may be left blank; it will be inferred so as to
venience, one amount may be left blank; it will be inferred so as to
balance the transaction.
Be sure to note the unusual two-space delimiter between account name
and amount. This makes it easy to write account names containing spa-
ces. But if you accidentally leave only one space (or tab) before the
Be sure to note the unusual two-space delimiter between account name
and amount. This makes it easy to write account names containing spa-
ces. But if you accidentally leave only one space (or tab) before the
amount, the amount will be considered part of the account name.
Dates
Simple dates
Within a journal file, transaction dates use Y/M/D (or Y-M-D or Y.M.D)
Leading zeros are optional. The year may be omitted, in which case it
will be inferred from the context - the current transaction, the
default year set with a default year directive, or the current date
when the command is run. Some examples: 2010/01/31, 1/31, 2010-01-31,
Within a journal file, transaction dates use Y/M/D (or Y-M-D or Y.M.D)
Leading zeros are optional. The year may be omitted, in which case it
will be inferred from the context - the current transaction, the
default year set with a default year directive, or the current date
when the command is run. Some examples: 2010/01/31, 1/31, 2010-01-31,
2010.1.31.
Secondary dates
Real-life transactions sometimes involve more than one date - eg the
Real-life transactions sometimes involve more than one date - eg the
date you write a cheque, and the date it clears in your bank. When you
want to model this, eg for more accurate balances, you can specify
individual posting dates, which I recommend. Or, you can use the sec-
ondary dates (aka auxiliary/effective dates) feature, supported for
want to model this, eg for more accurate balances, you can specify
individual posting dates, which I recommend. Or, you can use the sec-
ondary dates (aka auxiliary/effective dates) feature, supported for
compatibility with Ledger.
A secondary date can be written after the primary date, separated by an
equals sign. The primary date, on the left, is used by default; the
secondary date, on the right, is used when the --date2 flag is speci-
equals sign. The primary date, on the left, is used by default; the
secondary date, on the right, is used when the --date2 flag is speci-
fied (--aux-date or --effective also work).
The meaning of secondary dates is up to you, but it's best to follow a
consistent rule. Eg write the bank's clearing date as primary, and
The meaning of secondary dates is up to you, but it's best to follow a
consistent rule. Eg write the bank's clearing date as primary, and
when needed, the date the transaction was initiated as secondary.
Here's an example. Note that a secondary date will use the year of the
@ -139,18 +139,18 @@ FILE FORMAT
$ hledger register checking --date2
2010/02/19 movie ticket assets:checking $-10 $-10
Secondary dates require some effort; you must use them consistently in
Secondary dates require some effort; you must use them consistently in
your journal entries and remember whether to use or not use the --date2
flag for your reports. They are included in hledger for Ledger compat-
ibility, but posting dates are a more powerful and less confusing
ibility, but posting dates are a more powerful and less confusing
alternative.
Posting dates
You can give individual postings a different date from their parent
transaction, by adding a posting comment containing a tag (see below)
You can give individual postings a different date from their parent
transaction, by adding a posting comment containing a tag (see below)
like date:DATE. This is probably the best way to control posting dates
precisely. Eg in this example the expense should appear in May
reports, and the deduction from checking should be reported on 6/1 for
precisely. Eg in this example the expense should appear in May
reports, and the deduction from checking should be reported on 6/1 for
easy bank reconciliation:
2015/5/30
@ -163,82 +163,80 @@ FILE FORMAT
$ hledger -f t.j register checking
2015/06/01 assets:checking $-10 $-10
DATE should be a simple date; if the year is not specified it will use
the year of the transaction's date. You can set the secondary date
similarly, with date2:DATE2. The date: or date2: tags must have a
valid simple date value if they are present, eg a date: tag with no
DATE should be a simple date; if the year is not specified it will use
the year of the transaction's date. You can set the secondary date
similarly, with date2:DATE2. The date: or date2: tags must have a
valid simple date value if they are present, eg a date: tag with no
value is not allowed.
Ledger's earlier, more compact bracketed date syntax is also supported:
[DATE], [DATE=DATE2] or [=DATE2]. hledger will attempt to parse any
[DATE], [DATE=DATE2] or [=DATE2]. hledger will attempt to parse any
square-bracketed sequence of the 0123456789/-.= characters in this way.
With this syntax, DATE infers its year from the transaction and DATE2
With this syntax, DATE infers its year from the transaction and DATE2
infers its year from DATE.
Status
Transactions, or individual postings within a transaction, can have a
status mark, which is a single character before the transaction
description or posting account name, separated from it by a space,
Transactions, or individual postings within a transaction, can have a
status mark, which is a single character before the transaction
description or posting account name, separated from it by a space,
indicating one of three statuses:
mark status
------------------
unmarked
! pending
* cleared
When reporting, you can filter by status with the -U/--unmarked,
-P/--pending, and -C/--cleared flags; or the status:, status:!, and
When reporting, you can filter by status with the -U/--unmarked,
-P/--pending, and -C/--cleared flags; or the status:, status:!, and
status:* queries; or the U, P, C keys in hledger-ui.
Note, in Ledger and in older versions of hledger, the "unmarked" state
is called "uncleared". As of hledger 1.3 we have renamed it to
Note, in Ledger and in older versions of hledger, the "unmarked" state
is called "uncleared". As of hledger 1.3 we have renamed it to
unmarked for clarity.
To replicate Ledger and old hledger's behaviour of also matching pend-
To replicate Ledger and old hledger's behaviour of also matching pend-
ing, combine -U and -P.
Status marks are optional, but can be helpful eg for reconciling with
Status marks are optional, but can be helpful eg for reconciling with
real-world accounts. Some editor modes provide highlighting and short-
cuts for working with status. Eg in Emacs ledger-mode, you can toggle
cuts for working with status. Eg in Emacs ledger-mode, you can toggle
transaction status with C-c C-e, or posting status with C-c C-c.
What "uncleared", "pending", and "cleared" actually mean is up to you.
What "uncleared", "pending", and "cleared" actually mean is up to you.
Here's one suggestion:
status meaning
--------------------------------------------------------------------------
uncleared recorded but not yet reconciled; needs review
pending tentatively reconciled (if needed, eg during a big recon-
pending tentatively reconciled (if needed, eg during a big recon-
ciliation)
cleared complete, reconciled as far as possible, and considered
cleared complete, reconciled as far as possible, and considered
correct
With this scheme, you would use -PC to see the current balance at your
bank, -U to see things which will probably hit your bank soon (like
With this scheme, you would use -PC to see the current balance at your
bank, -U to see things which will probably hit your bank soon (like
uncashed checks), and no flags to see the most up-to-date state of your
finances.
Description
A transaction's description is the rest of the line following the date
and status mark (or until a comment begins). Sometimes called the
A transaction's description is the rest of the line following the date
and status mark (or until a comment begins). Sometimes called the
"narration" in traditional bookkeeping, it can be used for whatever you
wish, or left blank. Transaction descriptions can be queried, unlike
wish, or left blank. Transaction descriptions can be queried, unlike
comments.
Payee and note
You can optionally include a | (pipe) character in a description to
subdivide it into a payee/payer name on the left and additional notes
on the right. This may be worthwhile if you need to do more precise
You can optionally include a | (pipe) character in a description to
subdivide it into a payee/payer name on the left and additional notes
on the right. This may be worthwhile if you need to do more precise
querying and pivoting by payee.
Account names
Account names typically have several parts separated by a full colon,
from which hledger derives a hierarchical chart of accounts. They can
be anything you like, but in finance there are traditionally five
top-level accounts: assets, liabilities, income, expenses, and equity.
Account names typically have several parts separated by a full colon,
from which hledger derives a hierarchical chart of accounts. They can
be anything you like, but in finance there are traditionally five
top-level accounts: assets, liabilities, income, expenses, and equity.
Account names may contain single spaces, eg: assets:accounts receiv-
able. Because of this, they must always be followed by two or more
@ -285,31 +283,31 @@ FILE FORMAT
o if there is a commodity directive specifying the format, that is used
o otherwise the format is inferred from the first posting amount in
that commodity in the journal, and the precision (number of decimal
o otherwise the format is inferred from the first posting amount in
that commodity in the journal, and the precision (number of decimal
places) will be the maximum from all posting amounts in that commmod-
ity
o or if there are no such amounts in the journal, a default format is
o or if there are no such amounts in the journal, a default format is
used (like $1000.00).
Price amounts and amounts in D directives usually don't affect amount
format inference, but in some situations they can do so indirectly.
(Eg when D's default commodity is applied to a commodity-less amount,
Price amounts and amounts in D directives usually don't affect amount
format inference, but in some situations they can do so indirectly.
(Eg when D's default commodity is applied to a commodity-less amount,
or when an amountless posting is balanced using a price's commodity, or
when -V is used.) If you find this causing problems, set the desired
when -V is used.) If you find this causing problems, set the desired
format with a commodity directive.
Virtual Postings
When you parenthesise the account name in a posting, we call that a
When you parenthesise the account name in a posting, we call that a
virtual posting, which means:
o it is ignored when checking that the transaction is balanced
o it is excluded from reports when the --real/-R flag is used, or the
o it is excluded from reports when the --real/-R flag is used, or the
real:1 query.
You could use this, eg, to set an account's opening balance without
You could use this, eg, to set an account's opening balance without
needing to use the equity:opening balances account:
1/1 special unbalanced posting to set initial balance
@ -317,8 +315,8 @@ FILE FORMAT
When the account name is bracketed, we call it a balanced virtual post-
ing. This is like an ordinary virtual posting except the balanced vir-
tual postings in a transaction must balance to 0, like the real post-
ings (but separately from them). Balanced virtual postings are also
tual postings in a transaction must balance to 0, like the real post-
ings (but separately from them). Balanced virtual postings are also
excluded by --real/-R or real:1.
1/1 buy food with cash, and update some budget-tracking subaccounts elsewhere
@ -328,13 +326,13 @@ FILE FORMAT
[assets:checking:budget:food] $-10
Virtual postings have some legitimate uses, but those are few. You can
usually find an equivalent journal entry using real postings, which is
usually find an equivalent journal entry using real postings, which is
more correct and provides better error checking.
Balance Assertions
hledger supports Ledger-style balance assertions in journal files.
These look like =EXPECTEDBALANCE following a posting's amount. Eg in
this example we assert the expected dollar balance in accounts a and b
hledger supports Ledger-style balance assertions in journal files.
These look like =EXPECTEDBALANCE following a posting's amount. Eg in
this example we assert the expected dollar balance in accounts a and b
after each posting:
2013/1/1
@ -346,31 +344,31 @@ FILE FORMAT
b $-1 =$-2
After reading a journal file, hledger will check all balance assertions
and report an error if any of them fail. Balance assertions can pro-
tect you from, eg, inadvertently disrupting reconciled balances while
cleaning up old entries. You can disable them temporarily with the
--ignore-assertions flag, which can be useful for troubleshooting or
and report an error if any of them fail. Balance assertions can pro-
tect you from, eg, inadvertently disrupting reconciled balances while
cleaning up old entries. You can disable them temporarily with the
--ignore-assertions flag, which can be useful for troubleshooting or
for reading Ledger files.
Assertions and ordering
hledger sorts an account's postings and assertions first by date and
then (for postings on the same day) by parse order. Note this is dif-
hledger sorts an account's postings and assertions first by date and
then (for postings on the same day) by parse order. Note this is dif-
ferent from Ledger, which sorts assertions only by parse order. (Also,
Ledger assertions do not see the accumulated effect of repeated post-
Ledger assertions do not see the accumulated effect of repeated post-
ings to the same account within a transaction.)
So, hledger balance assertions keep working if you reorder differ-
ently-dated transactions within the journal. But if you reorder
So, hledger balance assertions keep working if you reorder differ-
ently-dated transactions within the journal. But if you reorder
same-dated transactions or postings, assertions might break and require
updating. This order dependence does bring an advantage: precise con-
updating. This order dependence does bring an advantage: precise con-
trol over the order of postings and assertions within a day, so you can
assert intra-day balances.
Assertions and included files
With included files, things are a little more complicated. Including
preserves the ordering of postings and assertions. If you have multi-
ple postings to an account on the same day, split across different
files, and you also want to assert the account's balance on the same
With included files, things are a little more complicated. Including
preserves the ordering of postings and assertions. If you have multi-
ple postings to an account on the same day, split across different
files, and you also want to assert the account's balance on the same
day, you'll have to put the assertion in the right file.
Assertions and multiple -f options
@ -378,21 +376,21 @@ FILE FORMAT
-f options. Use include or concatenate the files instead.
Assertions and commodities
The asserted balance must be a simple single-commodity amount, and in
fact the assertion checks only this commodity's balance within the
(possibly multi-commodity) account balance. We could call this a par-
tial balance assertion. This is compatible with Ledger, and makes it
The asserted balance must be a simple single-commodity amount, and in
fact the assertion checks only this commodity's balance within the
(possibly multi-commodity) account balance. We could call this a par-
tial balance assertion. This is compatible with Ledger, and makes it
possible to make assertions about accounts containing multiple commodi-
ties.
To assert each commodity's balance in such a multi-commodity account,
you can add multiple postings (with amount 0 if necessary). But note
that no matter how many assertions you add, you can't be sure the
To assert each commodity's balance in such a multi-commodity account,
you can add multiple postings (with amount 0 if necessary). But note
that no matter how many assertions you add, you can't be sure the
account does not contain some unexpected commodity. (We'll add support
for this kind of total balance assertion if there's demand.)
Assertions and subaccounts
Balance assertions do not count the balance from subaccounts; they
Balance assertions do not count the balance from subaccounts; they
check the posted account's exclusive balance. For example:
1/1
@ -400,7 +398,7 @@ FILE FORMAT
checking 1 = 1 ; post to the parent account, its exclusive balance is now 1
equity
The balance report's flat mode shows these exclusive balances more
The balance report's flat mode shows these exclusive balances more
clearly:
$ hledger bal checking --flat
@ -414,10 +412,10 @@ FILE FORMAT
tual. They are not affected by the --real/-R flag or real: query.
Balance Assignments
Ledger-style balance assignments are also supported. These are like
balance assertions, but with no posting amount on the left side of the
equals sign; instead it is calculated automatically so as to satisfy
the assertion. This can be a convenience during data entry, eg when
Ledger-style balance assignments are also supported. These are like
balance assertions, but with no posting amount on the left side of the
equals sign; instead it is calculated automatically so as to satisfy
the assertion. This can be a convenience during data entry, eg when
setting opening balances:
; starting a new journal, set asset account balances
@ -435,8 +433,8 @@ FILE FORMAT
expenses:misc
The calculated amount depends on the account's balance in the commodity
at that point (which depends on the previously-dated postings of the
commodity to that account since the last balance assertion or assign-
at that point (which depends on the previously-dated postings of the
commodity to that account since the last balance assertion or assign-
ment). Note that using balance assignments makes your journal a little
less explicit; to know the exact amount posted, you have to run hledger
or do the calculations yourself, instead of just reading it.
@ -444,12 +442,12 @@ FILE FORMAT
Prices
Transaction prices
Within a transaction, you can note an amount's price in another commod-
ity. This can be used to document the cost (in a purchase) or selling
price (in a sale). For example, transaction prices are useful to
ity. This can be used to document the cost (in a purchase) or selling
price (in a sale). For example, transaction prices are useful to
record purchases of a foreign currency.
Transaction prices are fixed, and do not change over time. (Ledger
users: Ledger uses a different syntax for fixed prices, {=UNITPRICE},
Transaction prices are fixed, and do not change over time. (Ledger
users: Ledger uses a different syntax for fixed prices, {=UNITPRICE},
which hledger currently ignores).
There are several ways to record a transaction price:
@ -473,9 +471,9 @@ FILE FORMAT
assets:euros 100 ; one hundred euros purchased
assets:dollars $-135 ; for $135
Amounts with transaction prices can be displayed in the transaction
Amounts with transaction prices can be displayed in the transaction
price's commodity by using the -B/--cost flag (except for #551) ("B" is
from "cost Basis"). Eg for the above, here is how -B affects the bal-
from "cost Basis"). Eg for the above, here is how -B affects the bal-
ance report:
$ hledger bal -N --flat
@ -485,8 +483,8 @@ FILE FORMAT
$-135 assets:dollars
$135 assets:euros # <- the euros' cost
Note -B is sensitive to the order of postings when a transaction price
is inferred: the inferred price will be in the commodity of the last
Note -B is sensitive to the order of postings when a transaction price
is inferred: the inferred price will be in the commodity of the last
amount. So if example 3's postings are reversed, while the transaction
is equivalent, -B shows something different:
@ -499,33 +497,33 @@ FILE FORMAT
100 assets:euros
Market prices
Market prices are not tied to a particular transaction; they represent
historical exchange rates between two commodities. (Ledger calls them
historical prices.) For example, the prices published by a stock
exchange or the foreign exchange market. hledger can use these prices
Market prices are not tied to a particular transaction; they represent
historical exchange rates between two commodities. (Ledger calls them
historical prices.) For example, the prices published by a stock
exchange or the foreign exchange market. hledger can use these prices
to show the market value of things at a given date, see market value.
To record market prices, use P directives in the main journal or in an
To record market prices, use P directives in the main journal or in an
included file. Their format is:
P DATE COMMODITYBEINGPRICED UNITPRICE
DATE is a simple date as usual. COMMODITYBEINGPRICED is the symbol of
the commodity being priced. UNITPRICE is an ordinary amount (symbol
and quantity) in a second commodity, specifying the unit price or con-
version rate for the first commodity in terms of the second, on the
DATE is a simple date as usual. COMMODITYBEINGPRICED is the symbol of
the commodity being priced. UNITPRICE is an ordinary amount (symbol
and quantity) in a second commodity, specifying the unit price or con-
version rate for the first commodity in terms of the second, on the
given date.
For example, the following directives say that one euro was worth 1.35
For example, the following directives say that one euro was worth 1.35
US dollars during 2009, and $1.40 from 2010 onward:
P 2009/1/1 $1.35
P 2010/1/1 $1.40
Comments
Lines in the journal beginning with a semicolon (;) or hash (#) or
asterisk (*) are comments, and will be ignored. (Asterisk comments
make it easy to treat your journal like an org-mode outline in emacs.)
Lines in the journal beginning with a semicolon (;) or hash (#) or
asterisk (*) are comments, and will be ignored. (Asterisk comments
make it easy to treat your journal like an org-mode outline in emacs.)
Also, anything between comment and end comment directives is a
(multi-line) comment. If there is no end comment, the comment extends
@ -625,54 +623,54 @@ FILE FORMAT
Or, you can use the --alias 'OLD=NEW' option on the command line. This
affects all entries. It's useful for trying out aliases interactively.
OLD and NEW are full account names. hledger will replace any occur-
rence of the old account name with the new one. Subaccounts are also
OLD and NEW are full account names. hledger will replace any occur-
rence of the old account name with the new one. Subaccounts are also
affected. Eg:
alias checking = assets:bank:wells fargo:checking
# rewrites "checking" to "assets:bank:wells fargo:checking", or "checking:a" to "assets:bank:wells fargo:checking:a"
Regex aliases
There is also a more powerful variant that uses a regular expression,
There is also a more powerful variant that uses a regular expression,
indicated by the forward slashes:
alias /REGEX/ = REPLACEMENT
or --alias '/REGEX/=REPLACEMENT'.
REGEX is a case-insensitive regular expression. Anywhere it matches
inside an account name, the matched part will be replaced by REPLACE-
MENT. If REGEX contains parenthesised match groups, these can be ref-
REGEX is a case-insensitive regular expression. Anywhere it matches
inside an account name, the matched part will be replaced by REPLACE-
MENT. If REGEX contains parenthesised match groups, these can be ref-
erenced by the usual numeric backreferences in REPLACEMENT. Eg:
alias /^(.+):bank:([^:]+)(.*)/ = \1:\2 \3
# rewrites "assets:bank:wells fargo:checking" to "assets:wells fargo checking"
Also note that REPLACEMENT continues to the end of line (or on command
line, to end of option argument), so it can contain trailing white-
Also note that REPLACEMENT continues to the end of line (or on command
line, to end of option argument), so it can contain trailing white-
space.
Multiple aliases
You can define as many aliases as you like using directives or com-
mand-line options. Aliases are recursive - each alias sees the result
of applying previous ones. (This is different from Ledger, where
You can define as many aliases as you like using directives or com-
mand-line options. Aliases are recursive - each alias sees the result
of applying previous ones. (This is different from Ledger, where
aliases are non-recursive by default). Aliases are applied in the fol-
lowing order:
1. alias directives, most recently seen first (recent directives take
1. alias directives, most recently seen first (recent directives take
precedence over earlier ones; directives not yet seen are ignored)
2. alias options, in the order they appear on the command line
end aliases
You can clear (forget) all currently defined aliases with the
You can clear (forget) all currently defined aliases with the
end aliases directive:
end aliases
account directive
The account directive predefines account names, as in Ledger and Bean-
count. This may be useful for your own documentation; hledger doesn't
The account directive predefines account names, as in Ledger and Bean-
count. This may be useful for your own documentation; hledger doesn't
make use of it yet.
; account ACCT
@ -687,8 +685,8 @@ FILE FORMAT
; etc.
apply account directive
You can specify a parent account which will be prepended to all
accounts within a section of the journal. Use the apply account and
You can specify a parent account which will be prepended to all
accounts within a section of the journal. Use the apply account and
end apply account directives like so:
apply account home
@ -705,7 +703,7 @@ FILE FORMAT
home:food $10
home:cash $-10
If end apply account is omitted, the effect lasts to the end of the
If end apply account is omitted, the effect lasts to the end of the
file. Included files are also affected, eg:
apply account business
@ -714,16 +712,16 @@ FILE FORMAT
apply account personal
include personal.journal
Prior to hledger 1.0, legacy account and end spellings were also sup-
Prior to hledger 1.0, legacy account and end spellings were also sup-
ported.
Multi-line comments
A line containing just comment starts a multi-line comment, and a line
A line containing just comment starts a multi-line comment, and a line
containing just end comment ends it. See comments.
commodity directive
The commodity directive predefines commodities (currently this is just
informational), and also it may define the display format for amounts
The commodity directive predefines commodities (currently this is just
informational), and also it may define the display format for amounts
in this commodity (overriding the automatically inferred format).
It may be written on a single line, like this:
@ -735,8 +733,8 @@ FILE FORMAT
; separating thousands with comma.
commodity 1,000.0000 AAAA
or on multiple lines, using the "format" subdirective. In this case
the commodity symbol appears twice and should be the same in both
or on multiple lines, using the "format" subdirective. In this case
the commodity symbol appears twice and should be the same in both
places:
; commodity SYMBOL
@ -749,10 +747,10 @@ FILE FORMAT
format INR 9,99,99,999.00
Default commodity
The D directive sets a default commodity (and display format), to be
The D directive sets a default commodity (and display format), to be
used for amounts without a commodity symbol (ie, plain numbers). (Note
this differs from Ledger's default commodity directive.) The commodity
and display format will be applied to all subsequent commodity-less
this differs from Ledger's default commodity directive.) The commodity
and display format will be applied to all subsequent commodity-less
amounts, or until the next D directive.
# commodity-less amounts should be treated as dollars
@ -764,8 +762,8 @@ FILE FORMAT
b
Default year
You can set a default year to be used for subsequent dates which don't
specify a year. This is a line beginning with Y followed by the year.
You can set a default year to be used for subsequent dates which don't
specify a year. This is a line beginning with Y followed by the year.
Eg:
Y2009 ; set default year to 2009
@ -785,27 +783,26 @@ FILE FORMAT
assets
Including other files
You can pull in the content of additional journal files by writing an
You can pull in the content of additional journal files by writing an
include directive, like this:
include path/to/file.journal
If the path does not begin with a slash, it is relative to the current
If the path does not begin with a slash, it is relative to the current
file. Glob patterns (*) are not currently supported.
The include directive can only be used in journal files. It can
The include directive can only be used in journal files. It can
include journal, timeclock or timedot files, but not CSV files.
EDITOR SUPPORT
Add-on modes exist for various text editors, to make working with jour-
nal files easier. They add colour, navigation aids and helpful com-
mands. For hledger users who edit the journal file directly (the
nal files easier. They add colour, navigation aids and helpful com-
mands. For hledger users who edit the journal file directly (the
majority), using one of these modes is quite recommended.
These were written with Ledger in mind, but also work with hledger
These were written with Ledger in mind, but also work with hledger
files:
Emacs http://www.ledger-cli.org/3.0/doc/ledger-mode.html
Vim https://github.com/ledger/ledger/wiki/Get-
ting-started
@ -815,15 +812,13 @@ EDITOR SUPPORT
Mate-2
Text Wrangler https://github.com/ledger/ledger/wiki/Edit-
ing-Ledger-files-with-TextWrangler
Visual Studio https://marketplace.visualstudio.com/items?item-
Code Name=mark-hansen.hledger-vscode
REPORTING BUGS
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
or hledger mail list)
@ -837,7 +832,7 @@ COPYRIGHT
SEE ALSO
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time-
dot(5), ledger(1)

View File

@ -1,4 +1,4 @@
This is hledger_timeclock.5.info, produced by makeinfo version 6.0 from
This is hledger_timeclock.5.info, produced by makeinfo version 6.1 from
stdin.


View File

@ -7,11 +7,11 @@ NAME
Timeclock - the time logging format of timeclock.el, as read by hledger
DESCRIPTION
hledger can read timeclock files. As with Ledger, these are (a subset
hledger can read timeclock files. As with Ledger, these are (a subset
of) timeclock.el's format, containing clock-in and clock-out entries as
in the example below. The date is a simple date. The time format is
HH:MM[:SS][+-ZZZZ]. Seconds and timezone are optional. The timezone,
if present, must be four digits and is ignored (currently the time is
in the example below. The date is a simple date. The time format is
HH:MM[:SS][+-ZZZZ]. Seconds and timezone are optional. The timezone,
if present, must be four digits and is ignored (currently the time is
always interpreted as a local time).
i 2015/03/30 09:00:00 some:account name optional description after two spaces
@ -19,9 +19,9 @@ DESCRIPTION
i 2015/03/31 22:21:45 another account
o 2015/04/01 02:00:34
hledger treats each clock-in/clock-out pair as a transaction posting
some number of hours to an account. Or if the session spans more than
one day, it is split into several transactions, one for each day. For
hledger treats each clock-in/clock-out pair as a transaction posting
some number of hours to an account. Or if the session spans more than
one day, it is split into several transactions, one for each day. For
the above time log, hledger print generates these journal entries:
$ hledger -f t.timeclock print
@ -42,7 +42,7 @@ DESCRIPTION
To generate time logs, ie to clock in and clock out, you could:
o use emacs and the built-in timeclock.el, or the extended time-
o use emacs and the built-in timeclock.el, or the extended time-
clock-x.el and perhaps the extras in ledgerutils.el
o at the command line, use these bash aliases:
@ -51,13 +51,13 @@ DESCRIPTION
alias to="echo o `date '+%Y-%m-%d %H:%M:%S'` >>$TIMELOG"
o or use the old ti and to scripts in the ledger 2.x repository. These
rely on a "timeclock" executable which I think is just the ledger 2
rely on a "timeclock" executable which I think is just the ledger 2
executable renamed.
REPORTING BUGS
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
or hledger mail list)
@ -71,7 +71,7 @@ COPYRIGHT
SEE ALSO
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time-
dot(5), ledger(1)

View File

@ -1,4 +1,4 @@
This is hledger_timedot.5.info, produced by makeinfo version 6.0 from
This is hledger_timedot.5.info, produced by makeinfo version 6.1 from
stdin.


View File

@ -1,4 +1,4 @@
This is hledger-ui.1.info, produced by makeinfo version 6.0 from stdin.
This is hledger-ui.1.info, produced by makeinfo version 6.1 from stdin.

File: hledger-ui.1.info, Node: Top, Next: OPTIONS, Up: (dir)

View File

@ -1,4 +1,4 @@
This is hledger-web.1.info, produced by makeinfo version 6.0 from stdin.
This is hledger-web.1.info, produced by makeinfo version 6.1 from stdin.

File: hledger-web.1.info, Node: Top, Next: OPTIONS, Up: (dir)

View File

@ -57,22 +57,22 @@ DESCRIPTION
With --file-url you can set a different base url for static files, eg
for better caching or cookie-less serving on high performance websites.
Note there is no built-in access control (aside from listening on
127.0.0.1 by default). So you will need to hide hledger-web behind an
authenticating proxy (such as apache or nginx) if you want to restrict
Note there is no built-in access control (aside from listening on
127.0.0.1 by default). So you will need to hide hledger-web behind an
authenticating proxy (such as apache or nginx) if you want to restrict
who can see and add entries to your journal.
Command-line options and arguments may be used to set an initial filter
on the data. This is not shown in the web UI, but it will be applied
on the data. This is not shown in the web UI, but it will be applied
in addition to any search query entered there.
With journal and timeclock files (but not CSV files, currently) the web
app detects changes made by other means and will show the new data on
the next request. If a change makes the file unparseable, hledger-web
app detects changes made by other means and will show the new data on
the next request. If a change makes the file unparseable, hledger-web
will show an error until the file has been fixed.
OPTIONS
Note: if invoking hledger-web as a hledger subcommand, write -- before
Note: if invoking hledger-web as a hledger subcommand, write -- before
options as shown above.
--serve
@ -85,14 +85,14 @@ OPTIONS
listen on this TCP port (default: 5000)
--base-url=URL
set the base url (default: http://IPADDR:PORT). You would
set the base url (default: http://IPADDR:PORT). You would
change this when sharing over the network, or integrating within
a larger website.
--file-url=URL
set the static files url (default: BASEURL/static). hledger-web
normally serves static files itself, but if you wanted to serve
them from another server for efficiency, you would set the url
normally serves static files itself, but if you wanted to serve
them from another server for efficiency, you would set the url
with this.
hledger input options:
@ -102,7 +102,7 @@ OPTIONS
$LEDGER_FILE or $HOME/.hledger.journal)
--rules-file=RULESFILE
Conversion rules file to use when reading CSV (default:
Conversion rules file to use when reading CSV (default:
FILE.rules)
--alias=OLD=NEW
@ -140,11 +140,11 @@ OPTIONS
multiperiod/multicolumn report by year
-p --period=PERIODEXP
set start date, end date, and/or reporting interval all at once
set start date, end date, and/or reporting interval all at once
(overrides the flags above)
--date2
match the secondary date instead (see command help for other
match the secondary date instead (see command help for other
effects)
-U --unmarked
@ -166,11 +166,11 @@ OPTIONS
show items with zero amount, normally hidden
-B --cost
convert amounts to their cost at transaction time (using the
convert amounts to their cost at transaction time (using the
transaction price, if any)
-V --value
convert amounts to their market value on the report end date
convert amounts to their market value on the report end date
(using the most recent applicable market price, if any)
When a reporting option appears more than once in the command line, the
@ -190,22 +190,22 @@ OPTIONS
show debug output (levels 1-9, default: 1)
A @FILE argument will be expanded to the contents of FILE, which should
contain one command line option/argument per line. (To prevent this,
contain one command line option/argument per line. (To prevent this,
insert a -- argument before.)
ENVIRONMENT
LEDGER_FILE The journal file path when not specified with -f. Default:
~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-
~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-
nal).
FILES
Reads data from one or more files in hledger journal, timeclock, time-
dot, or CSV format specified with -f, or $LEDGER_FILE, or
$HOME/.hledger.journal (on windows, perhaps
Reads data from one or more files in hledger journal, timeclock, time-
dot, or CSV format specified with -f, or $LEDGER_FILE, or
$HOME/.hledger.journal (on windows, perhaps
C:/Users/USER/.hledger.journal).
BUGS
The need to precede options with -- when invoked from hledger is awk-
The need to precede options with -- when invoked from hledger is awk-
ward.
-f- doesn't work (hledger-web can't read from stdin).
@ -219,7 +219,7 @@ BUGS
REPORTING BUGS
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
or hledger mail list)
@ -233,7 +233,7 @@ COPYRIGHT
SEE ALSO
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time-
dot(5), ledger(1)

View File

@ -319,12 +319,14 @@ Or, you can run the addon executable directly:
.PP
Most hledger commands accept arguments after the command name, which are
often a query, filtering the data in some way.
.SS Argument expansion
.SS Argument files
.PP
You can save a set of command line options/arguments in a file, one per
line, and then reuse them by writing \f[C]\@FILE\f[] in a command line.
(To prevent this expansion of \f[C]\@\f[]\-arguments, precede them with
a \f[C]\-\-\f[] argument.)
line, and then reuse them by writing \f[C]\@FILENAME\f[] in a command
line.
To prevent this expansion of \f[C]\@\f[]\-arguments, precede them with a
\f[C]\-\-\f[] argument.
For more, see Save frequently used options.
.SS Special characters
.PP
Option and argument values which contain problematic characters should

View File

@ -1,4 +1,4 @@
This is hledger.1.info, produced by makeinfo version 6.0 from stdin.
This is hledger.1.info, produced by makeinfo version 6.1 from stdin.

File: hledger.1.info, Node: Top, Next: EXAMPLES, Up: (dir)
@ -118,7 +118,7 @@ File: hledger.1.info, Node: OPTIONS, Next: QUERIES, Prev: EXAMPLES, Up: Top
* General options::
* Command options::
* Command arguments::
* Argument expansion::
* Argument files::
* Special characters::
* Input files::
* Smart dates::
@ -254,7 +254,7 @@ options after a double-hyphen, eg: 'hledger ui -- --watch'. Or, you can
run the addon executable directly: 'hledger-ui --watch'.

File: hledger.1.info, Node: Command arguments, Next: Argument expansion, Prev: Command options, Up: OPTIONS
File: hledger.1.info, Node: Command arguments, Next: Argument files, Prev: Command options, Up: OPTIONS
2.3 Command arguments
=====================
@ -263,18 +263,18 @@ Most hledger commands accept arguments after the command name, which are
often a query, filtering the data in some way.

File: hledger.1.info, Node: Argument expansion, Next: Special characters, Prev: Command arguments, Up: OPTIONS
File: hledger.1.info, Node: Argument files, Next: Special characters, Prev: Command arguments, Up: OPTIONS
2.4 Argument expansion
======================
2.4 Argument files
==================
You can save a set of command line options/arguments in a file, one per
line, and then reuse them by writing '@FILE' in a command line. (To
line, and then reuse them by writing '@FILENAME' in a command line. To
prevent this expansion of '@'-arguments, precede them with a '--'
argument.)
argument. For more, see Save frequently used options.

File: hledger.1.info, Node: Special characters, Next: Input files, Prev: Argument expansion, Up: OPTIONS
File: hledger.1.info, Node: Special characters, Next: Input files, Prev: Argument files, Up: OPTIONS
2.5 Special characters
======================
@ -2222,129 +2222,129 @@ Node: EXAMPLES1886
Ref: #examples1988
Node: OPTIONS3634
Ref: #options3738
Node: General options4042
Ref: #general-options4169
Node: Command options6488
Ref: #command-options6641
Node: Command arguments7039
Ref: #command-arguments7199
Node: Argument expansion7320
Ref: #argument-expansion7485
Node: Special characters7704
Ref: #special-characters7863
Node: Input files9282
Ref: #input-files9420
Node: Smart dates11383
Ref: #smart-dates11526
Node: Report start & end date12505
Ref: #report-start-end-date12677
Node: Report intervals13743
Ref: #report-intervals13908
Node: Period expressions14309
Ref: #period-expressions14471
Node: Depth limiting16811
Ref: #depth-limiting16957
Node: Pivoting17299
Ref: #pivoting17419
Node: Cost19095
Ref: #cost19205
Node: Market value19323
Ref: #market-value19460
Node: Regular expressions20760
Ref: #regular-expressions20898
Node: QUERIES22259
Ref: #queries22363
Node: COMMANDS26330
Ref: #commands26444
Node: accounts27427
Ref: #accounts27527
Node: activity28520
Ref: #activity28632
Node: add28991
Ref: #add29092
Node: balance31750
Ref: #balance31863
Node: Flat mode35020
Ref: #flat-mode35147
Node: Depth limited balance reports35567
Ref: #depth-limited-balance-reports35770
Node: Multicolumn balance reports36190
Ref: #multicolumn-balance-reports36401
Node: Custom balance output41049
Ref: #custom-balance-output41233
Node: Colour support43326
Ref: #colour-support43487
Node: Output destination43660
Ref: #output-destination43818
Node: CSV output44088
Ref: #csv-output44207
Node: balancesheet44604
Ref: #balancesheet44742
Node: balancesheetequity46710
Ref: #balancesheetequity46861
Node: cashflow47650
Ref: #cashflow47780
Node: check-dates49692
Ref: #check-dates49821
Node: check-dupes49938
Ref: #check-dupes50065
Node: equity50202
Ref: #equity50314
Node: help50477
Ref: #help50580
Node: import51654
Ref: #import51770
Node: incomestatement52500
Ref: #incomestatement52636
Node: prices54589
Ref: #prices54706
Node: print54749
Ref: #print54861
Node: print-unique59707
Ref: #print-unique59835
Node: register59903
Ref: #register60032
Node: Custom register output64533
Ref: #custom-register-output64664
Node: register-match65961
Ref: #register-match66097
Node: rewrite66280
Ref: #rewrite66399
Node: stats66468
Ref: #stats66573
Node: tags67454
Ref: #tags67554
Node: test67790
Ref: #test67876
Node: ADD-ON COMMANDS68244
Ref: #add-on-commands68356
Node: Official add-ons69643
Ref: #official-add-ons69785
Node: api69872
Ref: #api69963
Node: ui70015
Ref: #ui70116
Node: web70174
Ref: #web70265
Node: Third party add-ons70311
Ref: #third-party-add-ons70488
Node: diff70623
Ref: #diff70722
Node: iadd70821
Ref: #iadd70937
Node: interest71020
Ref: #interest71143
Node: irr71238
Ref: #irr71338
Node: Experimental add-ons71416
Ref: #experimental-add-ons71570
Node: autosync71861
Ref: #autosync71975
Node: budget72214
Ref: #budget72338
Node: chart72404
Ref: #chart72523
Node: check72594
Ref: #check72698
Node: General options4038
Ref: #general-options4165
Node: Command options6484
Ref: #command-options6637
Node: Command arguments7035
Ref: #command-arguments7191
Node: Argument files7312
Ref: #argument-files7465
Node: Special characters7731
Ref: #special-characters7886
Node: Input files9305
Ref: #input-files9443
Node: Smart dates11406
Ref: #smart-dates11549
Node: Report start & end date12528
Ref: #report-start-end-date12700
Node: Report intervals13766
Ref: #report-intervals13931
Node: Period expressions14332
Ref: #period-expressions14494
Node: Depth limiting16834
Ref: #depth-limiting16980
Node: Pivoting17322
Ref: #pivoting17442
Node: Cost19118
Ref: #cost19228
Node: Market value19346
Ref: #market-value19483
Node: Regular expressions20783
Ref: #regular-expressions20921
Node: QUERIES22282
Ref: #queries22386
Node: COMMANDS26353
Ref: #commands26467
Node: accounts27450
Ref: #accounts27550
Node: activity28543
Ref: #activity28655
Node: add29014
Ref: #add29115
Node: balance31773
Ref: #balance31886
Node: Flat mode35043
Ref: #flat-mode35170
Node: Depth limited balance reports35590
Ref: #depth-limited-balance-reports35793
Node: Multicolumn balance reports36213
Ref: #multicolumn-balance-reports36424
Node: Custom balance output41072
Ref: #custom-balance-output41256
Node: Colour support43349
Ref: #colour-support43510
Node: Output destination43683
Ref: #output-destination43841
Node: CSV output44111
Ref: #csv-output44230
Node: balancesheet44627
Ref: #balancesheet44765
Node: balancesheetequity46733
Ref: #balancesheetequity46884
Node: cashflow47673
Ref: #cashflow47803
Node: check-dates49715
Ref: #check-dates49844
Node: check-dupes49961
Ref: #check-dupes50088
Node: equity50225
Ref: #equity50337
Node: help50500
Ref: #help50603
Node: import51677
Ref: #import51793
Node: incomestatement52523
Ref: #incomestatement52659
Node: prices54612
Ref: #prices54729
Node: print54772
Ref: #print54884
Node: print-unique59730
Ref: #print-unique59858
Node: register59926
Ref: #register60055
Node: Custom register output64556
Ref: #custom-register-output64687
Node: register-match65984
Ref: #register-match66120
Node: rewrite66303
Ref: #rewrite66422
Node: stats66491
Ref: #stats66596
Node: tags67477
Ref: #tags67577
Node: test67813
Ref: #test67899
Node: ADD-ON COMMANDS68267
Ref: #add-on-commands68379
Node: Official add-ons69666
Ref: #official-add-ons69808
Node: api69895
Ref: #api69986
Node: ui70038
Ref: #ui70139
Node: web70197
Ref: #web70288
Node: Third party add-ons70334
Ref: #third-party-add-ons70511
Node: diff70646
Ref: #diff70745
Node: iadd70844
Ref: #iadd70960
Node: interest71043
Ref: #interest71166
Node: irr71261
Ref: #irr71361
Node: Experimental add-ons71439
Ref: #experimental-add-ons71593
Node: autosync71884
Ref: #autosync71998
Node: budget72237
Ref: #budget72361
Node: chart72427
Ref: #chart72546
Node: check72617
Ref: #check72721

End Tag Table

View File

@ -222,33 +222,34 @@ OPTIONS
Most hledger commands accept arguments after the command name, which
are often a query, filtering the data in some way.
Argument expansion
Argument files
You can save a set of command line options/arguments in a file, one per
line, and then reuse them by writing @FILE in a command line. (To pre-
vent this expansion of @-arguments, precede them with a -- argument.)
line, and then reuse them by writing @FILENAME in a command line. To
prevent this expansion of @-arguments, precede them with a -- argument.
For more, see Save frequently used options.
Special characters
Option and argument values which contain problematic characters should
be escaped with double quotes, backslashes, or (best) single quotes.
Option and argument values which contain problematic characters should
be escaped with double quotes, backslashes, or (best) single quotes.
Problematic characters means spaces, and also characters which are sig-
nificant to your command shell, such as less-than/greater-than. Eg:
nificant to your command shell, such as less-than/greater-than. Eg:
hledger register -p 'last year' "accounts receivable (receiv-
able|payable)" amt:\>100.
Characters which are significant both to the shell and in regular
expressions sometimes need to be double-escaped. These include paren-
theses, the pipe symbol and the dollar sign. Eg, to match the dollar
symbol, bash users should do: hledger balance cur:'\$' or hledger bal-
Characters which are significant both to the shell and in regular
expressions sometimes need to be double-escaped. These include paren-
theses, the pipe symbol and the dollar sign. Eg, to match the dollar
symbol, bash users should do: hledger balance cur:'\$' or hledger bal-
ance cur:\\$.
When hledger is invoking an addon executable (like hledger-ui), options
and arguments get de-escaped once more, so you might need triple-escap-
ing. Eg: hledger ui cur:'\\$' or hledger ui cur:\\\\$ in bash. (The
number of backslashes in fish shell is left as an exercise for the
ing. Eg: hledger ui cur:'\\$' or hledger ui cur:\\\\$ in bash. (The
number of backslashes in fish shell is left as an exercise for the
reader.)
Inside a file used for argument expansion, one less level of escaping
is enough. (And in this case, backslashes seem to work better than
Inside a file used for argument expansion, one less level of escaping
is enough. (And in this case, backslashes seem to work better than
quotes. Eg: cur:\$).
If in doubt, keep things simple:
@ -266,7 +267,7 @@ OPTIONS
Input files
hledger reads transactions from a data file (and the add command writes
to it). By default this file is $HOME/.hledger.journal (or on Windows,
something like C:/Users/USER/.hledger.journal). You can override this
something like C:/Users/USER/.hledger.journal). You can override this
with the $LEDGER_FILE environment variable:
$ setenv LEDGER_FILE ~/finance/2016.journal
@ -280,25 +281,24 @@ OPTIONS
$ cat some.journal | hledger -f-
Usually the data file is in hledger's journal format, but it can also
be one of several other formats, listed below. hledger detects the
format automatically based on the file extension, or if that is not
Usually the data file is in hledger's journal format, but it can also
be one of several other formats, listed below. hledger detects the
format automatically based on the file extension, or if that is not
recognised, by trying each built-in "reader" in turn:
Reader: Reads: Used for file extensions:
-----------------------------------------------------------------------------
journal hledger's journal format, also .journal .j .hledger
some Ledger journals .ledger
timeclock timeclock files (precise time .timeclock
timeclock timeclock files (precise time .timeclock
logging)
timedot timedot files (approximate time .timedot
timedot timedot files (approximate time .timedot
logging)
csv comma-separated values (data .csv
csv comma-separated values (data .csv
interchange)
If needed (eg to ensure correct error messages when a file has the
"wrong" extension), you can force a specific reader/format by prepend-
If needed (eg to ensure correct error messages when a file has the
"wrong" extension), you can force a specific reader/format by prepend-
ing it to the file path with a colon. Examples:
$ hledger -f csv:/some/csv-file.dat stats
@ -309,7 +309,7 @@ OPTIONS
o directives in one file will not affect the other files
o balance assertions will not see any account balances from previous
o balance assertions will not see any account balances from previous
files
If you need those, either use the include directive, or concatenate the
@ -317,24 +317,23 @@ OPTIONS
Smart dates
hledger's user interfaces accept a flexible "smart date" syntax (unlike
dates in the journal file). Smart dates allow some english words, can
be relative to today's date, and can have less-significant date parts
dates in the journal file). Smart dates allow some english words, can
be relative to today's date, and can have less-significant date parts
omitted (defaulting to 1).
Examples:
2009/1/1, 2009/01/01, simple dates, several sep-
2009-1-1, 2009.1.1 arators allowed
2009/1, 2009 same as above - a missing
2009/1, 2009 same as above - a missing
day or month defaults to 1
1/1, january, jan, relative dates, meaning
this year january 1 of the current
year
next year january 1 of next year
this month the 1st of the current
month
this week the most recent monday
last week the monday of the week
before this one
@ -342,29 +341,28 @@ OPTIONS
today, yesterday, tomorrow
Report start & end date
Most hledger reports show the full span of time represented by the
Most hledger reports show the full span of time represented by the
journal data, by default. So, the effective report start and end dates
will be the earliest and latest transaction or posting dates found in
will be the earliest and latest transaction or posting dates found in
the journal.
Often you will want to see a shorter time span, such as the current
month. You can specify a start and/or end date using -b/--begin,
Often you will want to see a shorter time span, such as the current
month. You can specify a start and/or end date using -b/--begin,
-e/--end, -p/--period or a date: query (described below). All of these
accept the smart date syntax. One important thing to be aware of when
specifying end dates: as in Ledger, end dates are exclusive, so you
accept the smart date syntax. One important thing to be aware of when
specifying end dates: as in Ledger, end dates are exclusive, so you
need to write the date after the last day you want to include.
Examples:
-b 2016/3/17 begin on St. Patrick's
day 2016
-e 12/1 end at the start of decem-
ber 1st of the current
year (11/30 will be the
year (11/30 will be the
last date included)
-b thismonth all transactions on or
after the 1st of the cur-
-b thismonth all transactions on or
after the 1st of the cur-
rent month
-p thismonth all transactions in the
current month
@ -376,15 +374,15 @@ OPTIONS
Report intervals
A report interval can be specified so that commands like register, bal-
ance and activity will divide their reports into multiple subperiods.
The basic intervals can be selected with one of -D/--daily,
-W/--weekly, -M/--monthly, -Q/--quarterly, or -Y/--yearly. More com-
plex intervals may be specified with a period expression. Report
ance and activity will divide their reports into multiple subperiods.
The basic intervals can be selected with one of -D/--daily,
-W/--weekly, -M/--monthly, -Q/--quarterly, or -Y/--yearly. More com-
plex intervals may be specified with a period expression. Report
intervals can not be specified with a query, currently.
Period expressions
The -p/--period option accepts period expressions, a shorthand way of
expressing a start date, end date, and/or report interval all at once.
The -p/--period option accepts period expressions, a shorthand way of
expressing a start date, end date, and/or report interval all at once.
Here's a basic period expression specifying the first quarter of 2009.
Note, hledger always treats start dates as inclusive and end dates as
@ -396,7 +394,6 @@ OPTIONS
long as you don't run two dates together. "to" can also be written as
"-". These are equivalent to the above:
-p "2009/1/1 2009/4/1"
-p2009/1/1to2009/4/1
-p2009/1/1-2009/4/1
@ -404,7 +401,6 @@ OPTIONS
Dates are smart dates, so if the current year is 2009, the above can
also be written as:
-p "1/1 4/1"
-p "january-apr"
-p "this year to 4/1"
@ -412,7 +408,6 @@ OPTIONS
If you specify only one date, the missing start or end date will be the
earliest or latest transaction in your journal:
-p "from 2009/1/1" everything after january
1, 2009
-p "from 2009/1" the same
@ -423,7 +418,6 @@ OPTIONS
A single date with no "from" or "to" defines both the start and end
date like so:
-p "2009" the year 2009; equivalent
to "2009/1/1 to 2010/1/1"
-p "2009/1" the month of jan; equiva-
@ -438,7 +432,6 @@ OPTIONS
-Y flags. Between report interval and start/end dates (if any), the
word in is optional. Examples:
-p "weekly from 2009/1/1 to 2009/4/1"
-p "monthly in 2008"
-p "quarterly"
@ -449,7 +442,6 @@ OPTIONS
Examples:
-p "bimonthly from 2008"
-p "every 2 weeks"
-p "every 5 days from 1/3"
@ -565,7 +557,7 @@ OPTIONS
$ hledger -f t.j bal euros -V -e 2016/12/21
$103.00 assets:euros
Currently, hledger's -V only uses market prices recorded with P direc-
Currently, hledger's -V only uses market prices recorded with P direc-
tives, not transaction prices (unlike Ledger).
Using -B and -V together is allowed.
@ -573,56 +565,56 @@ OPTIONS
Regular expressions
hledger uses regular expressions in a number of places:
o query terms, on the command line and in the hledger-web search form:
o query terms, on the command line and in the hledger-web search form:
REGEX, desc:REGEX, cur:REGEX, tag:...=REGEX
o CSV rules conditional blocks: if REGEX ...
o account alias directives and options: alias /REGEX/ = REPLACEMENT,
o account alias directives and options: alias /REGEX/ = REPLACEMENT,
--alias /REGEX/=REPLACEMENT
hledger's regular expressions come from the regex-tdfa library. In
hledger's regular expressions come from the regex-tdfa library. In
general they:
o are case insensitive
o are infix matching (do not need to match the entire thing being
o are infix matching (do not need to match the entire thing being
matched)
o are POSIX extended regular expressions
o also support GNU word boundaries (\<, \>, \b, \B)
o and parenthesised capturing groups and numeric backreferences in
o and parenthesised capturing groups and numeric backreferences in
replacement strings
o do not support mode modifiers like (?s)
Some things to note:
o In the alias directive and --alias option, regular expressions must
be enclosed in forward slashes (/REGEX/). Elsewhere in hledger,
o In the alias directive and --alias option, regular expressions must
be enclosed in forward slashes (/REGEX/). Elsewhere in hledger,
these are not required.
o In queries, to match a regular expression metacharacter like $ as a
literal character, prepend a backslash. Eg to search for amounts
o In queries, to match a regular expression metacharacter like $ as a
literal character, prepend a backslash. Eg to search for amounts
with the dollar sign in hledger-web, write cur:\$.
o On the command line, some metacharacters like $ have a special mean-
o On the command line, some metacharacters like $ have a special mean-
ing to the shell and so must be escaped at least once more. See Spe-
cial characters.
QUERIES
One of hledger's strengths is being able to quickly report on precise
subsets of your data. Most commands accept an optional query expres-
sion, written as arguments after the command name, to filter the data
by date, account name or other criteria. The syntax is similar to a
One of hledger's strengths is being able to quickly report on precise
subsets of your data. Most commands accept an optional query expres-
sion, written as arguments after the command name, to filter the data
by date, account name or other criteria. The syntax is similar to a
web search: one or more space-separated search terms, quotes to enclose
whitespace, prefixes to match specific fields, a not: prefix to negate
whitespace, prefixes to match specific fields, a not: prefix to negate
the match.
We do not yet support arbitrary boolean combinations of search terms;
instead most commands show transactions/postings/accounts which match
We do not yet support arbitrary boolean combinations of search terms;
instead most commands show transactions/postings/accounts which match
(or negatively match):
o any of the description terms AND
@ -643,32 +635,32 @@ QUERIES
o match all the other terms.
The following kinds of search terms can be used. Remember these can
The following kinds of search terms can be used. Remember these can
also be prefixed with not:, eg to exclude a particular subaccount.
REGEX match account names by this regular expression. (No prefix is
REGEX match account names by this regular expression. (No prefix is
equivalent to acct:).
acct:REGEX
same as above
amt:N, amt:<N, amt:<=N, amt:>N, amt:>=N
match postings with a single-commodity amount that is equal to,
less than, or greater than N. (Multi-commodity amounts are not
match postings with a single-commodity amount that is equal to,
less than, or greater than N. (Multi-commodity amounts are not
tested, and will always match.) The comparison has two modes: if
N is preceded by a + or - sign (or is 0), the two signed numbers
are compared. Otherwise, the absolute magnitudes are compared,
are compared. Otherwise, the absolute magnitudes are compared,
ignoring sign.
code:REGEX
match by transaction code (eg check number)
cur:REGEX
match postings or transactions including any amounts whose cur-
rency/commodity symbol is fully matched by REGEX. (For a par-
match postings or transactions including any amounts whose cur-
rency/commodity symbol is fully matched by REGEX. (For a par-
tial match, use .*REGEX.*). Note, to match characters which are
regex-significant, like the dollar sign ($), you need to prepend
\. And when using the command line you need to add one more
\. And when using the command line you need to add one more
level of quoting to hide it from the shell, so eg do:
hledger print cur:'\$' or hledger print cur:\\$.
@ -677,20 +669,20 @@ QUERIES
date:PERIODEXPR
match dates within the specified period. PERIODEXPR is a period
expression (with no report interval). Examples: date:2016,
date:thismonth, date:2000/2/1-2/15, date:lastweek-. If the
--date2 command line flag is present, this matches secondary
expression (with no report interval). Examples: date:2016,
date:thismonth, date:2000/2/1-2/15, date:lastweek-. If the
--date2 command line flag is present, this matches secondary
dates instead.
date2:PERIODEXPR
match secondary dates within the specified period.
depth:N
match (or display, depending on command) accounts at or above
match (or display, depending on command) accounts at or above
this depth
note:REGEX
match transaction notes (part of description right of |, or
match transaction notes (part of description right of |, or
whole description when there's no |)
payee:REGEX
@ -704,38 +696,38 @@ QUERIES
match unmarked, pending, or cleared transactions respectively
tag:REGEX[=REGEX]
match by tag name, and optionally also by tag value. Note a
tag: query is considered to match a transaction if it matches
any of the postings. Also remember that postings inherit the
match by tag name, and optionally also by tag value. Note a
tag: query is considered to match a transaction if it matches
any of the postings. Also remember that postings inherit the
tags of their parent transaction.
The following special search term is used automatically in hledger-web,
only:
inacct:ACCTNAME
tells hledger-web to show the transaction register for this
tells hledger-web to show the transaction register for this
account. Can be filtered further with acct etc.
Some of these can also be expressed as command-line options (eg depth:2
is equivalent to --depth 2). Generally you can mix options and query
arguments, and the resulting query will be their intersection (perhaps
is equivalent to --depth 2). Generally you can mix options and query
arguments, and the resulting query will be their intersection (perhaps
excluding the -p/--period option).
COMMANDS
hledger provides a number of subcommands; hledger with no arguments
hledger provides a number of subcommands; hledger with no arguments
shows a list.
If you install additional hledger-* packages, or if you put programs or
scripts named hledger-NAME in your PATH, these will also be listed as
scripts named hledger-NAME in your PATH, these will also be listed as
subcommands.
Run a subcommand by writing its name as first argument (eg
Run a subcommand by writing its name as first argument (eg
hledger incomestatement). You can also write one of the standard short
aliases displayed in parentheses in the command list (hledger b), or
aliases displayed in parentheses in the command list (hledger b), or
any any unambiguous prefix of a command name (hledger inc).
Here are all the builtin commands in alphabetical order. See also
hledger for a more organised command list, and hledger CMD -h for
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
@ -748,14 +740,14 @@ COMMANDS
--drop=N
in flat mode: omit N leading account name parts
This command lists all account names that are in use (ie, all the
accounts which have at least one transaction posting to them). With
This command lists all account names that are in use (ie, all the
accounts which have at least one transaction posting to them). With
query arguments, only matched account names are shown.
It shows a flat list by default. With --tree, it uses indentation to
It shows a flat list by default. With --tree, it uses indentation to
show the account hierarchy.
In flat mode you can add --drop N to omit the first few account name
In flat mode you can add --drop N to omit the first few account name
components.
Examples:
@ -798,8 +790,8 @@ COMMANDS
activity
Show an ascii barchart of posting counts per interval.
The activity command displays an ascii histogram showing transaction
counts by day, week, month or other reporting interval (by day is the
The activity command displays an ascii histogram showing transaction
counts by day, week, month or other reporting interval (by day is the
default). With query arguments, it counts only matched transactions.
$ hledger activity --quarterly
@ -812,24 +804,24 @@ COMMANDS
Prompt for transactions and add them to the journal.
--no-new-accounts
don't allow creating new accounts; helps prevent typos when
don't allow creating new accounts; helps prevent typos when
entering account names
Many hledger users edit their journals directly with a text editor, or
generate them from CSV. For more interactive data entry, there is the
add command, which prompts interactively on the console for new trans-
actions, and appends them to the journal file (if there are multiple
Many hledger users edit their journals directly with a text editor, or
generate them from CSV. For more interactive data entry, there is the
add command, which prompts interactively on the console for new trans-
actions, and appends them to the journal file (if there are multiple
-f FILE options, the first file is used.) Existing transactions are not
changed. This is the only hledger command that writes to the journal
changed. This is the only hledger command that writes to the journal
file.
To use it, just run hledger add and follow the prompts. You can add as
many transactions as you like; when you are finished, enter . or press
many transactions as you like; when you are finished, enter . or press
control-d or control-c to exit.
Features:
o add tries to provide useful defaults, using the most similar recent
o add tries to provide useful defaults, using the most similar recent
transaction (by description) as a template.
o You can also set the initial defaults with command line arguments.
@ -837,20 +829,20 @@ COMMANDS
o Readline-style edit keys can be used during data entry.
o The tab key will auto-complete whenever possible - accounts, descrip-
tions, dates (yesterday, today, tomorrow). If the input area is
tions, dates (yesterday, today, tomorrow). If the input area is
empty, it will insert the default value.
o If the journal defines a default commodity, it will be added to any
o If the journal defines a default commodity, it will be added to any
bare numbers entered.
o A parenthesised transaction code may be entered following a date.
o Comments and tags may be entered following a description or amount.
o If you make a mistake, enter < at any prompt to restart the transac-
o If you make a mistake, enter < at any prompt to restart the transac-
tion.
o Input prompts are displayed in a different colour when the terminal
o Input prompts are displayed in a different colour when the terminal
supports it.
Example (see the tutorial for a detailed explanation):
@ -887,7 +879,7 @@ COMMANDS
show balance change in each period (default)
--cumulative
show balance change accumulated across periods (in multicolumn
show balance change accumulated across periods (in multicolumn
reports)
-H --historical
@ -922,17 +914,17 @@ COMMANDS
select the output format. Supported formats: txt, csv.
-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.
--pretty-tables
Use unicode to display prettier tables.
--sort-amount
Sort by amount (total row amount, or by average if that is dis-
Sort by amount (total row amount, or by average if that is dis-
played), instead of account name (in flat mode)
The balance command displays accounts and balances. It is hledger's
The balance command displays accounts and balances. It is hledger's
most featureful and versatile command.
$ hledger balance
@ -949,25 +941,25 @@ COMMANDS
--------------------
0
More precisely, the balance command shows the change to each account's
More precisely, the balance command shows the change to each account's
balance caused by all (matched) postings. In the common case where you
do not filter by date and your journal sets the correct opening bal-
do not filter by date and your journal sets the correct opening bal-
ances, this is the same as the account's ending balance.
By default, accounts are displayed hierarchically, with subaccounts
By default, accounts are displayed hierarchically, with subaccounts
indented below their parent. "Boring" accounts, which contain a single
interesting subaccount and no balance of their own, are elided into the
following line for more compact output. (Use --no-elide to prevent
this. Eliding of boring accounts is not yet supported in multicolumn
following line for more compact output. (Use --no-elide to prevent
this. Eliding of boring accounts is not yet supported in multicolumn
reports.)
Each account's balance is the "inclusive" balance - it includes the
Each account's balance is the "inclusive" balance - it includes the
balances of any subaccounts.
Accounts which have zero balance (and no non-zero subaccounts) are
Accounts which have zero balance (and no non-zero subaccounts) are
omitted. Use -E/--empty to show them.
A final total is displayed by default; use -N/--no-total to suppress
A final total is displayed by default; use -N/--no-total to suppress
it:
$ hledger balance -p 2008/6 expenses --no-total
@ -977,9 +969,9 @@ COMMANDS
Flat mode
To see a flat list of full account names instead of the default hierar-
chical display, use --flat. In this mode, accounts (unless
chical display, use --flat. In this mode, accounts (unless
depth-clipped) show their "exclusive" balance, excluding any subaccount
balances. In this mode, you can also use --drop N to omit the first
balances. In this mode, you can also use --drop N to omit the first
few account name components.
$ hledger balance -p 2008/6 expenses -N --flat --drop 1
@ -987,9 +979,9 @@ COMMANDS
$1 supplies
Depth limited balance reports
With --depth N, balance shows accounts only to the specified depth.
This is very useful to show a complex charts of accounts in less
detail. In flat mode, balances from accounts below the depth limit
With --depth N, balance shows accounts only to the specified depth.
This is very useful to show a complex charts of accounts in less
detail. In flat mode, balances from accounts below the depth limit
will be shown as part of a parent account at the depth limit.
$ hledger balance -N --depth 1
@ -999,12 +991,12 @@ COMMANDS
$1 liabilities
Multicolumn balance reports
With a reporting interval, multiple balance columns will be shown, one
for each report period. There are three types of multi-column balance
With a reporting interval, multiple balance columns will be shown, one
for each report period. There are three types of multi-column balance
report, showing different information:
1. By default: each column shows the sum of postings in that period, ie
the account's change of balance in that period. This is useful eg
the account's change of balance in that period. This is useful eg
for a monthly income statement:
$ hledger balance --quarterly income expenses -E
@ -1019,8 +1011,8 @@ COMMANDS
-------------------++---------------------------------
|| $-1 $1 0 0
2. With --cumulative: each column shows the ending balance for that
period, accumulating the changes across periods, starting from 0 at
2. With --cumulative: each column shows the ending balance for that
period, accumulating the changes across periods, starting from 0 at
the report start date:
$ hledger balance --quarterly income expenses -E --cumulative
@ -1036,8 +1028,8 @@ COMMANDS
|| $-1 0 0 0
3. With --historical/-H: each column shows the actual historical ending
balance for that period, accumulating the changes across periods,
starting from the actual balance at the report start date. This is
balance for that period, accumulating the changes across periods,
starting from the actual balance at the report start date. This is
useful eg for a multi-period balance sheet, and when you are showing
only the data after a certain start date:
@ -1053,26 +1045,26 @@ COMMANDS
----------------------++-------------------------------------
|| 0 0 0
Multi-column balance reports display accounts in flat mode by default;
Multi-column balance reports display accounts in flat mode by default;
to see the hierarchy, use --tree.
With a reporting interval (like --quarterly above), the report
start/end dates will be adjusted if necessary so that they encompass
With a reporting interval (like --quarterly above), the report
start/end dates will be adjusted if necessary so that they encompass
the displayed report periods. This is so that the first and last peri-
ods will be "full" and comparable to the others.
The -E/--empty flag does two things in multicolumn balance reports:
first, the report will show all columns within the specified report
period (without -E, leading and trailing columns with all zeroes are
not shown). Second, all accounts which existed at the report start
date will be considered, not just the ones with activity during the
The -E/--empty flag does two things in multicolumn balance reports:
first, the report will show all columns within the specified report
period (without -E, leading and trailing columns with all zeroes are
not shown). Second, all accounts which existed at the report start
date will be considered, not just the ones with activity during the
report period (use -E to include low-activity accounts which would oth-
erwise would be omitted).
The -T/--row-total flag adds an additional column showing the total for
each row.
The -A/--average flag adds a column showing the average value in each
The -A/--average flag adds a column showing the average value in each
row.
Here's an example of all three:
@ -1094,7 +1086,7 @@ COMMANDS
# Average is rounded to the dollar here since all journal amounts are
Custom balance output
In simple (non-multi-column) balance reports, you can customise the
In simple (non-multi-column) balance reports, you can customise the
output with --format FMT:
$ hledger balance --format "%20(account) %12(total)"
@ -1112,7 +1104,7 @@ COMMANDS
0
The FMT format string (plus a newline) specifies the formatting applied
to each account/balance pair. It may contain any suitable text, with
to each account/balance pair. It may contain any suitable text, with
data fields interpolated like so:
%[MIN][.MAX](FIELDNAME)
@ -1123,14 +1115,14 @@ COMMANDS
o FIELDNAME must be enclosed in parentheses, and can be one of:
o depth_spacer - a number of spaces equal to the account's depth, or
o depth_spacer - a number of spaces equal to the account's depth, or
if MIN is specified, MIN * depth spaces.
o account - the account's name
o total - the account's balance/posted total, right justified
Also, FMT can begin with an optional prefix to control how multi-com-
Also, FMT can begin with an optional prefix to control how multi-com-
modity amounts are rendered:
o %_ - render on multiple lines, bottom-aligned (the default)
@ -1139,7 +1131,7 @@ COMMANDS
o %, - render on one line, comma-separated
There are some quirks. Eg in one-line mode, %(depth_spacer) has no
There are some quirks. Eg in one-line mode, %(depth_spacer) has no
effect, instead %(account) has indentation built in.
Experimentation may be needed to get pleasing results.
@ -1147,14 +1139,14 @@ COMMANDS
o %(total) - the account's total
o %-20.20(account) - the account's name, left justified, padded to 20
o %-20.20(account) - the account's name, left justified, padded to 20
characters and clipped at 20 characters
o %,%-50(account) %25(total) - account name padded to 50 characters,
total padded to 20 characters, with multiple commodities rendered on
o %,%-50(account) %25(total) - account name padded to 50 characters,
total padded to 20 characters, with multiple commodities rendered on
one line
o %20(total) %2(depth_spacer)%-(account) - the default format for the
o %20(total) %2(depth_spacer)%-(account) - the default format for the
single-column balance report
Colour support
@ -1165,8 +1157,8 @@ COMMANDS
o the output is not being redirected or piped anywhere
Output destination
The balance, print, register and stats commands can write their output
to a destination other than the console. This is controlled by the
The balance, print, register and stats commands can write their output
to a destination other than the console. This is controlled by the
-o/--output-file option.
$ hledger balance -o - # write to stdout (the default)
@ -1174,8 +1166,8 @@ COMMANDS
CSV output
The balance, print and register commands can write their output as CSV.
This is useful for exporting data to other applications, eg to make
charts in a spreadsheet. This is controlled by the -O/--output-format
This is useful for exporting data to other applications, eg to make
charts in a spreadsheet. This is controlled by the -O/--output-format
option, or by specifying a .csv file extension with -o/--output-file.
$ hledger balance -O csv # write CSV to stdout
@ -1189,7 +1181,7 @@ COMMANDS
balances
--cumulative
show balance change accumulated across periods (in multicolumn
show balance change accumulated across periods (in multicolumn
reports), instead of historical ending balances
-H --historical
@ -1223,8 +1215,8 @@ COMMANDS
--sort-amount
sort by amount instead of account name
This command displays a simple balance sheet. It currently assumes
that you have top-level accounts named asset and liability (plural
This command displays a simple balance sheet. It currently assumes
that you have top-level accounts named asset and liability (plural
forms also allowed.)
$ hledger balancesheet
@ -1247,19 +1239,19 @@ COMMANDS
0
With a reporting interval, multiple columns will be shown, one for each
report period. As with multicolumn balance reports, you can alter the
report mode with --change/--cumulative/--historical. Normally bal-
ancesheet shows historical ending balances, which is what you need for
report period. As with multicolumn balance reports, you can alter the
report mode with --change/--cumulative/--historical. Normally bal-
ancesheet shows historical ending balances, which is what you need for
a balance sheet; note this means it ignores report begin dates.
balancesheetequity
Show a balance sheet including equity. Alias: bse.
Other than showing the equity accounts, this command is exactly the
Other than showing the equity accounts, this command is exactly the
same as the command balancesheet. Please refer to it for the available
options.
This command displays a balancesheet. It currently assumes that you
This command displays a balancesheet. It currently assumes that you
have top-level accounts named asset, liability and equity (plural forms
also allowed.)
@ -1294,7 +1286,7 @@ COMMANDS
show balance change in each period (default)
--cumulative
show balance change accumulated across periods (in multicolumn
show balance change accumulated across periods (in multicolumn
reports), instead of changes during periods
-H --historical
@ -1398,7 +1390,7 @@ COMMANDS
...
import
Read new transactions added to each FILE since last run, and add them
Read new transactions added to each FILE since last run, and add them
to the main journal file.
--dry-run
@ -1412,7 +1404,7 @@ COMMANDS
ing transactions are always added to the input files in increasing date
order, and by saving .latest.FILE state files.
The --dry-run output is in journal format, so you can filter it, eg to
The --dry-run output is in journal format, so you can filter it, eg to
see only uncategorised transactions:
$ hledger import --dry ... | hledger -f- print unknown --ignore-assertions
@ -1424,7 +1416,7 @@ COMMANDS
show balance change in each period (default)
--cumulative
show balance change accumulated across periods (in multicolumn
show balance change accumulated across periods (in multicolumn
reports), instead of changes during periods
-H --historical
@ -1904,16 +1896,16 @@ TROUBLESHOOTING
that is ~/.local/bin and ~/.cabal/bin respectively.
I set a custom LEDGER_FILE, but hledger is still using the default file
LEDGER_FILE should be a real environment variable, not just a shell
variable. The command env | grep LEDGER_FILE should show it. You may
LEDGER_FILE should be a real environment variable, not just a shell
variable. The command env | grep LEDGER_FILE should show it. You may
need to use export. Here's an explanation.
"Illegal byte sequence" or "Invalid or incomplete multibyte or wide
"Illegal byte sequence" or "Invalid or incomplete multibyte or wide
character" errors
In order to handle non-ascii letters and symbols (like ), hledger needs
an appropriate locale. This is usually configured system-wide; you can
also configure it temporarily. The locale may need to be one that sup-
ports UTF-8, if you built hledger with GHC < 7.2 (or possibly always,
ports UTF-8, if you built hledger with GHC < 7.2 (or possibly always,
I'm not sure yet).
Here's an example of setting the locale temporarily, on ubuntu
@ -1932,7 +1924,7 @@ TROUBLESHOOTING
$ echo "export LANG=en_US.UTF-8" >>~/.bash_profile
$ bash --login
If we preferred to use eg fr_FR.utf8, we might have to install that
If we preferred to use eg fr_FR.utf8, we might have to install that
first:
$ apt-get install language-pack-fr
@ -1953,7 +1945,7 @@ TROUBLESHOOTING
REPORTING BUGS
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
or hledger mail list)
@ -1967,7 +1959,7 @@ COPYRIGHT
SEE ALSO
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time-
dot(5), ledger(1)