doc: note an issue with balance assertions & multiple -f options
[ci skip]
This commit is contained in:
		
							parent
							
								
									d3883bad1f
								
							
						
					
					
						commit
						d657374ac4
					
				| @ -368,6 +368,7 @@ might break and require updating. | ||||
| This order dependence does bring an advantage: precise control over the | ||||
| order of postings and assertions within a day, so you can assert | ||||
| intra\-day balances. | ||||
| .SS Assertions and included files | ||||
| .PP | ||||
| With included files, things are a little more complicated. | ||||
| Including preserves the ordering of postings and assertions. | ||||
| @ -375,6 +376,11 @@ If you have multiple postings to an account on the same day, split | ||||
| across different files, and you also want to assert the account\[aq]s | ||||
| balance on the same day, you\[aq]ll have to put the assertion in the | ||||
| right file. | ||||
| .SS Assertions and multiple \-f options | ||||
| .PP | ||||
| Balance assertions don\[aq]t work well across files specified with | ||||
| multiple \-f options. | ||||
| Use include or concatenate the files instead. | ||||
| .SS Assertions and commodities | ||||
| .PP | ||||
| The asserted balance must be a simple single\-commodity amount, and in | ||||
|  | ||||
| @ -361,12 +361,14 @@ for reading Ledger files. | ||||
| * Menu: | ||||
| 
 | ||||
| * Assertions and ordering:: | ||||
| * Assertions and included files:: | ||||
| * Assertions and multiple -f options:: | ||||
| * Assertions and commodities:: | ||||
| * Assertions and subaccounts:: | ||||
| * Assertions and virtual postings:: | ||||
| 
 | ||||
|  | ||||
| File: hledger_journal.5.info,  Node: Assertions and ordering,  Next: Assertions and commodities,  Up: Balance Assertions | ||||
| File: hledger_journal.5.info,  Node: Assertions and ordering,  Next: Assertions and included files,  Up: Balance Assertions | ||||
| 
 | ||||
| 1.6.1 Assertions and ordering | ||||
| ----------------------------- | ||||
| @ -384,16 +386,31 @@ updating. This order dependence does bring an advantage: precise control | ||||
| over the order of postings and assertions within a day, so you can | ||||
| assert intra-day balances. | ||||
| 
 | ||||
|    With included files, things are a little more complicated. Including | ||||
|  | ||||
| File: hledger_journal.5.info,  Node: Assertions and included files,  Next: Assertions and multiple -f options,  Prev: Assertions and ordering,  Up: Balance Assertions | ||||
| 
 | ||||
| 1.6.2 Assertions and included files | ||||
| ----------------------------------- | ||||
| 
 | ||||
| With included files, things are a little more complicated. Including | ||||
| preserves the ordering of postings and assertions. If you have multiple | ||||
| 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. | ||||
| 
 | ||||
|  | ||||
| File: hledger_journal.5.info,  Node: Assertions and commodities,  Next: Assertions and subaccounts,  Prev: Assertions and ordering,  Up: Balance Assertions | ||||
| File: hledger_journal.5.info,  Node: Assertions and multiple -f options,  Next: Assertions and commodities,  Prev: Assertions and included files,  Up: Balance Assertions | ||||
| 
 | ||||
| 1.6.2 Assertions and commodities | ||||
| 1.6.3 Assertions and multiple -f options | ||||
| ---------------------------------------- | ||||
| 
 | ||||
| Balance assertions don't work well across files specified with multiple | ||||
| -f options. Use include or concatenate the files instead. | ||||
| 
 | ||||
|  | ||||
| File: hledger_journal.5.info,  Node: Assertions and commodities,  Next: Assertions and subaccounts,  Prev: Assertions and multiple -f options,  Up: Balance Assertions | ||||
| 
 | ||||
| 1.6.4 Assertions and commodities | ||||
| -------------------------------- | ||||
| 
 | ||||
| The asserted balance must be a simple single-commodity amount, and in | ||||
| @ -411,7 +428,7 @@ for this kind of total balance assertion if there's demand.) | ||||
|  | ||||
| File: hledger_journal.5.info,  Node: Assertions and subaccounts,  Next: Assertions and virtual postings,  Prev: Assertions and commodities,  Up: Balance Assertions | ||||
| 
 | ||||
| 1.6.3 Assertions and subaccounts | ||||
| 1.6.5 Assertions and subaccounts | ||||
| -------------------------------- | ||||
| 
 | ||||
| Balance assertions do not count the balance from subaccounts; they check | ||||
| @ -436,7 +453,7 @@ $ hledger bal checking --flat | ||||
|  | ||||
| File: hledger_journal.5.info,  Node: Assertions and virtual postings,  Prev: Assertions and subaccounts,  Up: Balance Assertions | ||||
| 
 | ||||
| 1.6.4 Assertions and virtual postings | ||||
| 1.6.6 Assertions and virtual postings | ||||
| ------------------------------------- | ||||
| 
 | ||||
| Balance assertions are checked against all postings, both real and | ||||
| @ -984,53 +1001,57 @@ Node: Virtual Postings10420 | ||||
| Ref: #virtual-postings10581 | ||||
| Node: Balance Assertions11801 | ||||
| Ref: #balance-assertions11978 | ||||
| Node: Assertions and ordering12800 | ||||
| Ref: #assertions-and-ordering12985 | ||||
| Node: Assertions and commodities14016 | ||||
| Ref: #assertions-and-commodities14242 | ||||
| Node: Assertions and subaccounts14934 | ||||
| Ref: #assertions-and-subaccounts15168 | ||||
| Node: Assertions and virtual postings15690 | ||||
| Ref: #assertions-and-virtual-postings15899 | ||||
| Node: Balance Assignments16040 | ||||
| Ref: #balance-assignments16209 | ||||
| Node: Prices17327 | ||||
| Ref: #prices17460 | ||||
| Node: Transaction prices17511 | ||||
| Ref: #transaction-prices17656 | ||||
| Node: Market prices19236 | ||||
| Ref: #market-prices19371 | ||||
| Node: Comments20371 | ||||
| Ref: #comments20493 | ||||
| Node: Tags21605 | ||||
| Ref: #tags21725 | ||||
| Node: Directives22648 | ||||
| Ref: #directives22763 | ||||
| Node: Account aliases22956 | ||||
| Ref: #account-aliases23102 | ||||
| Node: Basic aliases23704 | ||||
| Ref: #basic-aliases23849 | ||||
| Node: Regex aliases24537 | ||||
| Ref: #regex-aliases24707 | ||||
| Node: Multiple aliases25477 | ||||
| Ref: #multiple-aliases25651 | ||||
| Node: end aliases26147 | ||||
| Ref: #end-aliases26289 | ||||
| Node: account directive26391 | ||||
| Ref: #account-directive26573 | ||||
| Node: apply account directive26869 | ||||
| Ref: #apply-account-directive27067 | ||||
| Node: Multi-line comments27727 | ||||
| Ref: #multi-line-comments27919 | ||||
| Node: commodity directive28046 | ||||
| Ref: #commodity-directive28232 | ||||
| Node: Default commodity29105 | ||||
| Ref: #default-commodity29280 | ||||
| Node: Default year29816 | ||||
| Ref: #default-year29983 | ||||
| Node: Including other files30406 | ||||
| Ref: #including-other-files30565 | ||||
| Node: EDITOR SUPPORT30961 | ||||
| Ref: #editor-support31081 | ||||
| Node: Assertions and ordering12873 | ||||
| Ref: #assertions-and-ordering13061 | ||||
| Node: Assertions and included files13758 | ||||
| Ref: #assertions-and-included-files14001 | ||||
| Node: Assertions and multiple -f options14332 | ||||
| Ref: #assertions-and-multiple--f-options14588 | ||||
| Node: Assertions and commodities14719 | ||||
| Ref: #assertions-and-commodities14956 | ||||
| Node: Assertions and subaccounts15648 | ||||
| Ref: #assertions-and-subaccounts15882 | ||||
| Node: Assertions and virtual postings16404 | ||||
| Ref: #assertions-and-virtual-postings16613 | ||||
| Node: Balance Assignments16754 | ||||
| Ref: #balance-assignments16923 | ||||
| Node: Prices18041 | ||||
| Ref: #prices18174 | ||||
| Node: Transaction prices18225 | ||||
| Ref: #transaction-prices18370 | ||||
| Node: Market prices19950 | ||||
| Ref: #market-prices20085 | ||||
| Node: Comments21085 | ||||
| Ref: #comments21207 | ||||
| Node: Tags22319 | ||||
| Ref: #tags22439 | ||||
| Node: Directives23362 | ||||
| Ref: #directives23477 | ||||
| Node: Account aliases23670 | ||||
| Ref: #account-aliases23816 | ||||
| Node: Basic aliases24418 | ||||
| Ref: #basic-aliases24563 | ||||
| Node: Regex aliases25251 | ||||
| Ref: #regex-aliases25421 | ||||
| Node: Multiple aliases26191 | ||||
| Ref: #multiple-aliases26365 | ||||
| Node: end aliases26861 | ||||
| Ref: #end-aliases27003 | ||||
| Node: account directive27105 | ||||
| Ref: #account-directive27287 | ||||
| Node: apply account directive27583 | ||||
| Ref: #apply-account-directive27781 | ||||
| Node: Multi-line comments28441 | ||||
| Ref: #multi-line-comments28633 | ||||
| Node: commodity directive28760 | ||||
| Ref: #commodity-directive28946 | ||||
| Node: Default commodity29819 | ||||
| Ref: #default-commodity29994 | ||||
| Node: Default year30530 | ||||
| Ref: #default-year30697 | ||||
| Node: Including other files31120 | ||||
| Ref: #including-other-files31279 | ||||
| Node: EDITOR SUPPORT31675 | ||||
| Ref: #editor-support31795 | ||||
|  | ||||
| End Tag Table | ||||
|  | ||||
| @ -290,6 +290,8 @@ updating. This order dependence does bring an advantage: precise | ||||
| control over the order of postings and assertions within a day, so you | ||||
| can assert intra-day balances. | ||||
| 
 | ||||
| ### Assertions and included files | ||||
| 
 | ||||
| With [included files](#including-other-files), things are a little | ||||
| more complicated. Including preserves the ordering of postings and | ||||
| assertions. If you have multiple postings to an account on the same | ||||
| @ -297,6 +299,11 @@ 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 | ||||
| 
 | ||||
| Balance assertions don't work well across files specified | ||||
| with multiple -f options. Use include or [concatenate the files](/hledger.html#input-files) | ||||
| instead. | ||||
| 
 | ||||
| ### Assertions and commodities | ||||
| 
 | ||||
|  | ||||
| @ -287,28 +287,33 @@ FILE FORMAT | ||||
|        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 | ||||
|        day, you'll have to put the assertion in the right file. | ||||
| 
 | ||||
|    Assertions and multiple -f options | ||||
|        Balance assertions don't work well across files specified with multiple | ||||
|        -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 | ||||
| @ -316,7 +321,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 | ||||
| @ -330,10 +335,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 | ||||
| @ -351,27 +356,27 @@ 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. | ||||
| 
 | ||||
|    Prices | ||||
|    Transaction prices | ||||
|        Within a transaction posting, you  can  record  an  amount's  price  in | ||||
|        another  commodity.   This can be used to document the cost (for a pur- | ||||
|        chase), or selling price (for a sale), or the exchange  rate  that  was | ||||
|        Within  a  transaction  posting,  you  can  record an amount's price in | ||||
|        another commodity.  This can be used to document the cost (for  a  pur- | ||||
|        chase),  or  selling  price (for a sale), or the exchange rate that was | ||||
|        used, for this transaction.  These transaction prices are fixed, and do | ||||
|        not change over time. | ||||
| 
 | ||||
|        Amounts with transaction prices can be  displayed  in  the  transaction | ||||
|        price's  commodity,  by  using  the  --cost/-B  flag  supported by most | ||||
|        Amounts  with  transaction  prices  can be displayed in the transaction | ||||
|        price's commodity, by  using  the  --cost/-B  flag  supported  by  most | ||||
|        hledger commands (mnemonic: "cost Basis"). | ||||
| 
 | ||||
|        There are several ways to record a transaction price: | ||||
| 
 | ||||
|        1. Write the unit price (aka exchange rate), as @ UNITPRICE  after  the | ||||
|        1. Write  the  unit price (aka exchange rate), as @ UNITPRICE after the | ||||
|           amount: | ||||
| 
 | ||||
|                   2009/1/1 | ||||
| @ -385,7 +390,7 @@ FILE FORMAT | ||||
|                     assets:cash | ||||
| 
 | ||||
|        3. Or let hledger infer the price so as to balance the transaction.  To | ||||
|           permit this, you must fully specify all posting amounts,  and  their | ||||
|           permit  this,  you must fully specify all posting amounts, and their | ||||
|           sum must have a non-zero amount in exactly two commodities: | ||||
| 
 | ||||
|                   2009/1/1 | ||||
| @ -399,46 +404,46 @@ FILE FORMAT | ||||
|                   assets:foreign currency       $135.00 | ||||
|                   assets:cash                  $-135.00 | ||||
| 
 | ||||
|        Example  use for transaction prices: recording the effective conversion | ||||
|        Example use for transaction prices: recording the effective  conversion | ||||
|        rate of purchases made in a foreign currency. | ||||
| 
 | ||||
|    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.  Some commands (balance, cur- | ||||
|        rently) can use this information to show the market value of things  at | ||||
|        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.  Some commands (balance,  cur- | ||||
|        rently)  can use this information to show the market value of things at | ||||
|        a given date. | ||||
| 
 | ||||
|        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 (just the symbol, no quantity).  UNITPRICE | ||||
|        is an ordinary amount (symbol and  quantity)  in  a  second  commodity, | ||||
|        DATE  is a simple date as usual.  COMMODITYBEINGPRICED is the symbol of | ||||
|        the commodity being priced (just the symbol, no  quantity).   UNITPRICE | ||||
|        is  an  ordinary  amount  (symbol  and quantity) in a second commodity, | ||||
|        specifying the unit price or conversion 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 | ||||
|        Also,   anything  between  comment  and  end comment  directives  is  a | ||||
|        (multi-line) comment.  If there is no end comment, the comment  extends | ||||
|        to the end of the file. | ||||
| 
 | ||||
|        You can attach comments to a transaction  by  writing  them  after  the | ||||
|        description  and/or  indented  on the following lines (before the post- | ||||
|        ings).  Similarly, you can attach comments to an individual posting  by | ||||
|        You  can  attach  comments  to  a transaction by writing them after the | ||||
|        description and/or indented on the following lines  (before  the  post- | ||||
|        ings).   Similarly, you can attach comments to an individual posting by | ||||
|        writing them after the amount and/or indented on the following lines. | ||||
| 
 | ||||
|        Some examples: | ||||
| @ -463,30 +468,30 @@ FILE FORMAT | ||||
|               ; a journal comment (because not indented) | ||||
| 
 | ||||
|    Tags | ||||
|        A  tag is a word followed by a full colon inside a transaction or post- | ||||
|        ing comment.  You  can  write  multiple  tags,  comma  separated.   Eg: | ||||
|        ; a comment containing sometag:, anothertag:.   You can search for tags | ||||
|        A tag is a word followed by a full colon inside a transaction or  post- | ||||
|        ing  comment.   You  can  write  multiple  tags,  comma separated.  Eg: | ||||
|        ; a comment containing sometag:, anothertag:.  You can search for  tags | ||||
|        with the tag: query. | ||||
| 
 | ||||
|        A tag can also have a value, which is any text between  the  colon  and | ||||
|        the  next comma or newline, excluding leading/trailing whitespace.  (So | ||||
|        A  tag  can  also have a value, which is any text between the colon and | ||||
|        the next comma or newline, excluding leading/trailing whitespace.   (So | ||||
|        hledger tag values can not contain commas or newlines). | ||||
| 
 | ||||
|        Tags in a transaction comment affect the transaction  and  all  of  its | ||||
|        postings,  while  tags  in  a posting comment affect only that posting. | ||||
|        For example,  the  following  transaction  has  three  tags  (A,  TAG2, | ||||
|        Tags  in  a  transaction  comment affect the transaction and all of its | ||||
|        postings, while tags in a posting comment  affect  only  that  posting. | ||||
|        For  example,  the  following  transaction  has  three  tags  (A, TAG2, | ||||
|        third-tag) and the posting has four (A, TAG2, third-tag, posting-tag): | ||||
| 
 | ||||
|               1/1 a transaction  ; A:, TAG2: | ||||
|                   ; third-tag: a third transaction tag, this time with a value | ||||
|                   (a)  $1  ; posting-tag: | ||||
| 
 | ||||
|        Tags  are  like  Ledger's metadata feature, except hledger's tag values | ||||
|        Tags are like Ledger's metadata feature, except  hledger's  tag  values | ||||
|        are simple strings. | ||||
| 
 | ||||
|    Directives | ||||
|    Account aliases | ||||
|        You can define aliases which rewrite your account names (after  reading | ||||
|        You  can define aliases which rewrite your account names (after reading | ||||
|        the journal, before generating reports).  hledger's account aliases can | ||||
|        be useful for: | ||||
| 
 | ||||
| @ -503,8 +508,8 @@ FILE FORMAT | ||||
|        See also How to use account aliases. | ||||
| 
 | ||||
|    Basic aliases | ||||
|        To set an account alias, use the alias directive in your journal  file. | ||||
|        This  affects all subsequent journal entries in the current file or its | ||||
|        To  set an account alias, use the alias directive in your journal file. | ||||
|        This affects all subsequent journal entries in the current file or  its | ||||
|        included files.  The spaces around the = are optional: | ||||
| 
 | ||||
|               alias OLD = NEW | ||||
| @ -512,53 +517,53 @@ 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, | ||||
|        indicated  by  the forward slashes.  (This was the default behaviour in | ||||
|        There  is  also a more powerful variant that uses a regular expression, | ||||
|        indicated by the forward slashes.  (This was the default  behaviour  in | ||||
|        hledger 0.24-0.25): | ||||
| 
 | ||||
|               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.  Note, cur- | ||||
|        rently regular expression  aliases  may  cause  noticeable  slow-downs. | ||||
|        rently  regular  expression  aliases  may  cause noticeable slow-downs. | ||||
|        (And if you use Ledger on your hledger file, they will be ignored.) Eg: | ||||
| 
 | ||||
|               alias /^(.+):bank:([^:]+)(.*)/ = \1:\2 \3 | ||||
|               # rewrites "assets:bank:wells fargo:checking" to  "assets:wells fargo checking" | ||||
| 
 | ||||
|    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 | ||||
| @ -573,8 +578,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 | ||||
| @ -591,7 +596,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 | ||||
| @ -600,16 +605,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: | ||||
| @ -621,8 +626,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 | ||||
| @ -635,10 +640,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 | ||||
| @ -650,8 +655,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 | ||||
| @ -671,24 +676,24 @@ 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: | ||||
| 
 | ||||
| 
 | ||||
| @ -705,7 +710,7 @@ EDITOR SUPPORT | ||||
| 
 | ||||
| 
 | ||||
| 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) | ||||
| 
 | ||||
| 
 | ||||
| @ -719,7 +724,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) | ||||
| 
 | ||||
|  | ||||
| @ -490,8 +490,14 @@ $\ echo\ \[aq]i\ 2009/13/1\ 08:00:00\[aq]\ |\ hledger\ print\ \-ftimeclock:\- | ||||
| .PP | ||||
| You can also specify multiple \f[C]\-f\f[] options, to read multiple | ||||
| files as one big journal. | ||||
| (Directives in one file will not affect the other files. | ||||
| If you need that, use the include directive instead.) | ||||
| There are some limitations with this: | ||||
| .IP \[bu] 2 | ||||
| directives in one file will not affect the other files | ||||
| .IP \[bu] 2 | ||||
| balance assertions will not see any account balances from previous files | ||||
| .PP | ||||
| If you need those, either use the include directive, or concatenate the | ||||
| files, eg: \f[C]cat\ a.journal\ b.journal\ |\ hledger\ \-f\-\ CMD\f[]. | ||||
| .SS Depth limiting | ||||
| .PP | ||||
| With the \f[C]\-\-depth\ N\f[] option, commands like account, balance | ||||
|  | ||||
| @ -369,8 +369,15 @@ $ hledger -f csv:/some/csv-file.dat stats | ||||
| $ echo 'i 2009/13/1 08:00:00' | hledger print -ftimeclock:- | ||||
| 
 | ||||
|    You can also specify multiple `-f' options, to read multiple files | ||||
| as one big journal. (Directives in one file will not affect the other | ||||
| files. If you need that, use the include directive instead.) | ||||
| as one big journal. There are some limitations with this: | ||||
| 
 | ||||
|    * directives in one file will not affect the other files | ||||
| 
 | ||||
|    * balance assertions will not see any account balances from previous | ||||
|      files | ||||
| 
 | ||||
|    If you need those, either use the include directive, or concatenate | ||||
| the files, eg: `cat a.journal b.journal | hledger -f- CMD'. | ||||
| 
 | ||||
|  | ||||
| File: hledger.1.info,  Node: Depth limiting,  Next: Smart dates,  Prev: Input files,  Up: OPTIONS | ||||
| @ -2283,93 +2290,93 @@ Node: Reporting options7611 | ||||
| Ref: #reporting-options7764 | ||||
| Node: Input files9587 | ||||
| Ref: #input-files9727 | ||||
| Node: Depth limiting11564 | ||||
| Ref: #depth-limiting11704 | ||||
| Node: Smart dates11905 | ||||
| Ref: #smart-dates12051 | ||||
| Node: Report start & end date13048 | ||||
| Ref: #report-start-end-date13220 | ||||
| Node: Report intervals14296 | ||||
| Ref: #report-intervals14461 | ||||
| Node: Period expressions14860 | ||||
| Ref: #period-expressions15025 | ||||
| Node: Regular expressions17360 | ||||
| Ref: #regular-expressions17502 | ||||
| Node: QUERIES18985 | ||||
| Ref: #queries19089 | ||||
| Node: COMMANDS22728 | ||||
| Ref: #commands22842 | ||||
| Node: accounts23515 | ||||
| Ref: #accounts23615 | ||||
| Node: activity24597 | ||||
| Ref: #activity24709 | ||||
| Node: add25068 | ||||
| Ref: #add25169 | ||||
| Node: balance27832 | ||||
| Ref: #balance27945 | ||||
| Node: Flat mode30958 | ||||
| Ref: #flat-mode31085 | ||||
| Node: Depth limited balance reports31504 | ||||
| Ref: #depth-limited-balance-reports31707 | ||||
| Node: Multicolumn balance reports32128 | ||||
| Ref: #multicolumn-balance-reports32330 | ||||
| Node: Market value36979 | ||||
| Ref: #market-value37143 | ||||
| Node: Custom balance output38444 | ||||
| Ref: #custom-balance-output38617 | ||||
| Node: Output destination40721 | ||||
| Ref: #output-destination40886 | ||||
| Node: CSV output41156 | ||||
| Ref: #csv-output41275 | ||||
| Node: balancesheet41672 | ||||
| Ref: #balancesheet41800 | ||||
| Node: cashflow42452 | ||||
| Ref: #cashflow42569 | ||||
| Node: help43259 | ||||
| Ref: #help43371 | ||||
| Node: incomestatement44208 | ||||
| Ref: #incomestatement44338 | ||||
| Node: info45065 | ||||
| Ref: #info45172 | ||||
| Node: man45534 | ||||
| Ref: #man45631 | ||||
| Node: print46034 | ||||
| Ref: #print46139 | ||||
| Node: register49888 | ||||
| Ref: #register50001 | ||||
| Node: Custom register output54493 | ||||
| Ref: #custom-register-output54624 | ||||
| Node: stats55921 | ||||
| Ref: #stats56027 | ||||
| Node: test56907 | ||||
| Ref: #test56994 | ||||
| Node: ADD-ON COMMANDS57361 | ||||
| Ref: #add-on-commands57497 | ||||
| Node: api58785 | ||||
| Ref: #api58877 | ||||
| Node: autosync58911 | ||||
| Ref: #autosync59026 | ||||
| Node: diff61341 | ||||
| Ref: #diff61451 | ||||
| Node: equity62115 | ||||
| Ref: #equity62229 | ||||
| Node: interest63557 | ||||
| Ref: #interest63674 | ||||
| Node: irr66758 | ||||
| Ref: #irr66871 | ||||
| Node: print-unique69246 | ||||
| Ref: #print-unique69376 | ||||
| Node: rewrite69634 | ||||
| Ref: #rewrite69753 | ||||
| Node: ui70282 | ||||
| Ref: #ui70382 | ||||
| Node: web70423 | ||||
| Ref: #web70511 | ||||
| Node: TROUBLESHOOTING70544 | ||||
| Ref: #troubleshooting70663 | ||||
| Node: Run-time problems70717 | ||||
| Ref: #run-time-problems70860 | ||||
| Node: Known limitations72804 | ||||
| Ref: #known-limitations72947 | ||||
| Node: Depth limiting11768 | ||||
| Ref: #depth-limiting11908 | ||||
| Node: Smart dates12109 | ||||
| Ref: #smart-dates12255 | ||||
| Node: Report start & end date13252 | ||||
| Ref: #report-start-end-date13424 | ||||
| Node: Report intervals14500 | ||||
| Ref: #report-intervals14665 | ||||
| Node: Period expressions15064 | ||||
| Ref: #period-expressions15229 | ||||
| Node: Regular expressions17564 | ||||
| Ref: #regular-expressions17706 | ||||
| Node: QUERIES19189 | ||||
| Ref: #queries19293 | ||||
| Node: COMMANDS22932 | ||||
| Ref: #commands23046 | ||||
| Node: accounts23719 | ||||
| Ref: #accounts23819 | ||||
| Node: activity24801 | ||||
| Ref: #activity24913 | ||||
| Node: add25272 | ||||
| Ref: #add25373 | ||||
| Node: balance28036 | ||||
| Ref: #balance28149 | ||||
| Node: Flat mode31162 | ||||
| Ref: #flat-mode31289 | ||||
| Node: Depth limited balance reports31708 | ||||
| Ref: #depth-limited-balance-reports31911 | ||||
| Node: Multicolumn balance reports32332 | ||||
| Ref: #multicolumn-balance-reports32534 | ||||
| Node: Market value37183 | ||||
| Ref: #market-value37347 | ||||
| Node: Custom balance output38648 | ||||
| Ref: #custom-balance-output38821 | ||||
| Node: Output destination40925 | ||||
| Ref: #output-destination41090 | ||||
| Node: CSV output41360 | ||||
| Ref: #csv-output41479 | ||||
| Node: balancesheet41876 | ||||
| Ref: #balancesheet42004 | ||||
| Node: cashflow42656 | ||||
| Ref: #cashflow42773 | ||||
| Node: help43463 | ||||
| Ref: #help43575 | ||||
| Node: incomestatement44412 | ||||
| Ref: #incomestatement44542 | ||||
| Node: info45269 | ||||
| Ref: #info45376 | ||||
| Node: man45738 | ||||
| Ref: #man45835 | ||||
| Node: print46238 | ||||
| Ref: #print46343 | ||||
| Node: register50092 | ||||
| Ref: #register50205 | ||||
| Node: Custom register output54697 | ||||
| Ref: #custom-register-output54828 | ||||
| Node: stats56125 | ||||
| Ref: #stats56231 | ||||
| Node: test57111 | ||||
| Ref: #test57198 | ||||
| Node: ADD-ON COMMANDS57565 | ||||
| Ref: #add-on-commands57701 | ||||
| Node: api58989 | ||||
| Ref: #api59081 | ||||
| Node: autosync59115 | ||||
| Ref: #autosync59230 | ||||
| Node: diff61545 | ||||
| Ref: #diff61655 | ||||
| Node: equity62319 | ||||
| Ref: #equity62433 | ||||
| Node: interest63761 | ||||
| Ref: #interest63878 | ||||
| Node: irr66962 | ||||
| Ref: #irr67075 | ||||
| Node: print-unique69450 | ||||
| Ref: #print-unique69580 | ||||
| Node: rewrite69838 | ||||
| Ref: #rewrite69957 | ||||
| Node: ui70486 | ||||
| Ref: #ui70586 | ||||
| Node: web70627 | ||||
| Ref: #web70715 | ||||
| Node: TROUBLESHOOTING70748 | ||||
| Ref: #troubleshooting70867 | ||||
| Node: Run-time problems70921 | ||||
| Ref: #run-time-problems71064 | ||||
| Node: Known limitations73008 | ||||
| Ref: #known-limitations73151 | ||||
|  | ||||
| End Tag Table | ||||
|  | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -113,8 +113,13 @@ $ echo 'i 2009/13/1 08:00:00' | hledger print -ftimeclock:- | ||||
| ``` | ||||
| 
 | ||||
| You can also specify multiple `-f` options, to read multiple files as one big journal. | ||||
| (Directives in one file will not affect the other files. If you need that,  | ||||
| use the [include directive](#including-other-files) instead.) | ||||
| There are some limitations with this: | ||||
| 
 | ||||
| - directives in one file will not affect the other files | ||||
| - [balance assertions](/journal.html#balance-assertions) will not see any account balances from previous files | ||||
| 
 | ||||
| If you need those, either use the [include directive](/journal.html#including-other-files), | ||||
| or concatenate the files, eg: `cat a.journal b.journal | hledger -f- CMD`. | ||||
| 
 | ||||
| ## Depth limiting | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user