cli: doc: queries: clarifications, especially not:
This commit is contained in:
		
							parent
							
								
									75df6e0277
								
							
						
					
					
						commit
						81d7d3f709
					
				| @ -937,12 +937,12 @@ Most commands accept an optional query expression, 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, optional prefixes to match | ||||
| specific fields. | ||||
| Multiple search terms are combined as follows: | ||||
| search terms, quotes to enclose whitespace, prefixes to match specific | ||||
| fields, a not: prefix to negate the match. | ||||
| .PP | ||||
| All commands except print: show transactions/postings/accounts which | ||||
| match (or negatively match) | ||||
| We do not yet support arbitrary boolean combinations of search terms; | ||||
| instead most commands show transactions/postings/accounts which match | ||||
| (or negatively match): | ||||
| .IP \[bu] 2 | ||||
| any of the description terms AND | ||||
| .IP \[bu] 2 | ||||
| @ -952,7 +952,7 @@ any of the status terms AND | ||||
| .IP \[bu] 2 | ||||
| all the other terms. | ||||
| .PP | ||||
| The print command: show transactions which | ||||
| The print command instead shows transactions which: | ||||
| .IP \[bu] 2 | ||||
| match any of the description terms AND | ||||
| .IP \[bu] 2 | ||||
| @ -962,10 +962,13 @@ have no postings matching any of the negative account terms AND | ||||
| .IP \[bu] 2 | ||||
| match all the other terms. | ||||
| .PP | ||||
| The following kinds of search terms can be used: | ||||
| The following kinds of search terms can be used. | ||||
| Remember these can also be prefixed with \f[B]\f[C]not:\f[]\f[], eg to | ||||
| exclude a particular subaccount. | ||||
| .TP | ||||
| .B \f[B]\f[C]REGEX\f[]\f[] | ||||
| match account names by this regular expression | ||||
| match account names by this regular expression. | ||||
| (No prefix is equivalent to \f[C]acct:\f[]). | ||||
| .RS | ||||
| .RE | ||||
| .TP | ||||
| @ -1057,18 +1060,13 @@ Also remember that postings inherit the tags of their parent | ||||
| transaction. | ||||
| .RS | ||||
| .RE | ||||
| .TP | ||||
| .B \f[B]\f[C]not:\f[]\f[] | ||||
| before any of the above negates the match. | ||||
| .RS | ||||
| .RE | ||||
| .PP | ||||
| The following special search term is used only you click an account name | ||||
| in hledger\-web: | ||||
| .TP | ||||
| .B \f[B]\f[C]inacct:ACCTNAME\f[]\f[] | ||||
| a special term used automatically when you click an account name in | ||||
| hledger\-web, specifying the account register we are currently in | ||||
| (selects the transactions of that account and how to show them, can be | ||||
| filtered further with \f[C]acct\f[] etc). | ||||
| Not supported elsewhere in hledger. | ||||
| tells hledger\-web to show the transaction register for this account. | ||||
| Can be filtered further with \f[C]acct\f[] etc. | ||||
| .RS | ||||
| .RE | ||||
| .PP | ||||
|  | ||||
| @ -666,29 +666,32 @@ subsets of your data.  Most commands accept an optional query | ||||
| expression, 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, optional prefixes to match specific fields. | ||||
| Multiple search terms are combined as follows: | ||||
| enclose whitespace, prefixes to match specific fields, a not: prefix to | ||||
| negate the match. | ||||
| 
 | ||||
|    All commands except print: show transactions/postings/accounts which | ||||
| match (or negatively match) | ||||
|    We do not yet support arbitrary boolean combinations of search terms; | ||||
| instead most commands show transactions/postings/accounts which match | ||||
| (or negatively match): | ||||
| 
 | ||||
|    * any of the description terms AND | ||||
|    * any of the account terms AND | ||||
|    * any of the status terms AND | ||||
|    * all the other terms. | ||||
| 
 | ||||
|    The print command: show transactions which | ||||
|    The print command instead shows transactions which: | ||||
| 
 | ||||
|    * match any of the description terms AND | ||||
|    * have any postings matching any of the positive account terms AND | ||||
|    * have no postings matching any of the negative account terms AND | ||||
|    * match all the other terms. | ||||
| 
 | ||||
|    The following kinds of search terms can be used: | ||||
|    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 | ||||
|      match account names by this regular expression.  (No prefix is | ||||
|      equivalent to 'acct:'). | ||||
| *'acct:REGEX'* | ||||
| 
 | ||||
|      same as above | ||||
| @ -749,16 +752,14 @@ match (or negatively match) | ||||
|      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. | ||||
| *'not:'* | ||||
| 
 | ||||
|      before any of the above negates the match. | ||||
|    The following special search term is used only you click an account | ||||
| name in hledger-web: | ||||
| 
 | ||||
| *'inacct:ACCTNAME'* | ||||
| 
 | ||||
|      a special term used automatically when you click an account name in | ||||
|      hledger-web, specifying the account register we are currently in | ||||
|      (selects the transactions of that account and how to show them, can | ||||
|      be filtered further with 'acct' etc).  Not supported elsewhere in | ||||
|      hledger. | ||||
|      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 | ||||
| @ -2162,95 +2163,95 @@ Node: Regular expressions19999 | ||||
| Ref: #regular-expressions20137 | ||||
| Node: QUERIES21498 | ||||
| Ref: #queries21602 | ||||
| Node: COMMANDS25534 | ||||
| Ref: #commands25648 | ||||
| Node: accounts26327 | ||||
| Ref: #accounts26427 | ||||
| Node: activity27409 | ||||
| Ref: #activity27521 | ||||
| Node: add27880 | ||||
| Ref: #add27981 | ||||
| Node: balance30639 | ||||
| Ref: #balance30752 | ||||
| Node: Flat mode33767 | ||||
| Ref: #flat-mode33894 | ||||
| Node: Depth limited balance reports34314 | ||||
| Ref: #depth-limited-balance-reports34517 | ||||
| Node: Multicolumn balance reports34937 | ||||
| Ref: #multicolumn-balance-reports35148 | ||||
| Node: Custom balance output39796 | ||||
| Ref: #custom-balance-output39980 | ||||
| Node: Colour support42073 | ||||
| Ref: #colour-support42234 | ||||
| Node: Output destination42407 | ||||
| Ref: #output-destination42565 | ||||
| Node: CSV output42835 | ||||
| Ref: #csv-output42954 | ||||
| Node: balancesheet43351 | ||||
| Ref: #balancesheet43489 | ||||
| Node: balancesheetequity45396 | ||||
| Ref: #balancesheetequity45547 | ||||
| Node: cashflow46336 | ||||
| Ref: #cashflow46459 | ||||
| Node: help48310 | ||||
| Ref: #help48422 | ||||
| Node: incomestatement49496 | ||||
| Ref: #incomestatement49627 | ||||
| Node: print51519 | ||||
| Ref: #print51636 | ||||
| Node: register55392 | ||||
| Ref: #register55505 | ||||
| Node: Custom register output60001 | ||||
| Ref: #custom-register-output60132 | ||||
| Node: stats61429 | ||||
| Ref: #stats61535 | ||||
| Node: test62416 | ||||
| Ref: #test62503 | ||||
| Node: ADD-ON COMMANDS62871 | ||||
| Ref: #add-on-commands62983 | ||||
| Node: Official add-ons64270 | ||||
| Ref: #official-add-ons64412 | ||||
| Node: api64499 | ||||
| Ref: #api64590 | ||||
| Node: ui64642 | ||||
| Ref: #ui64743 | ||||
| Node: web64801 | ||||
| Ref: #web64892 | ||||
| Node: Third party add-ons64938 | ||||
| Ref: #third-party-add-ons65115 | ||||
| Node: diff65250 | ||||
| Ref: #diff65349 | ||||
| Node: iadd65448 | ||||
| Ref: #iadd65564 | ||||
| Node: interest65647 | ||||
| Ref: #interest65770 | ||||
| Node: irr65865 | ||||
| Ref: #irr65965 | ||||
| Node: Experimental add-ons66043 | ||||
| Ref: #experimental-add-ons66197 | ||||
| Node: autosync66599 | ||||
| Ref: #autosync66713 | ||||
| Node: budget66952 | ||||
| Ref: #budget67076 | ||||
| Node: chart67142 | ||||
| Ref: #chart67261 | ||||
| Node: check67332 | ||||
| Ref: #check67456 | ||||
| Node: check-dates67523 | ||||
| Ref: #check-dates67665 | ||||
| Node: check-dupes67738 | ||||
| Ref: #check-dupes67881 | ||||
| Node: equity67958 | ||||
| Ref: #equity68086 | ||||
| Node: prices68205 | ||||
| Ref: #prices68334 | ||||
| Node: print-unique68389 | ||||
| Ref: #print-unique68538 | ||||
| Node: register-match68631 | ||||
| Ref: #register-match68787 | ||||
| Node: rewrite68885 | ||||
| Ref: #rewrite69019 | ||||
| Node: tags69097 | ||||
| Ref: #tags69202 | ||||
| Node: COMMANDS25580 | ||||
| Ref: #commands25694 | ||||
| Node: accounts26373 | ||||
| Ref: #accounts26473 | ||||
| Node: activity27455 | ||||
| Ref: #activity27567 | ||||
| Node: add27926 | ||||
| Ref: #add28027 | ||||
| Node: balance30685 | ||||
| Ref: #balance30798 | ||||
| Node: Flat mode33813 | ||||
| Ref: #flat-mode33940 | ||||
| Node: Depth limited balance reports34360 | ||||
| Ref: #depth-limited-balance-reports34563 | ||||
| Node: Multicolumn balance reports34983 | ||||
| Ref: #multicolumn-balance-reports35194 | ||||
| Node: Custom balance output39842 | ||||
| Ref: #custom-balance-output40026 | ||||
| Node: Colour support42119 | ||||
| Ref: #colour-support42280 | ||||
| Node: Output destination42453 | ||||
| Ref: #output-destination42611 | ||||
| Node: CSV output42881 | ||||
| Ref: #csv-output43000 | ||||
| Node: balancesheet43397 | ||||
| Ref: #balancesheet43535 | ||||
| Node: balancesheetequity45442 | ||||
| Ref: #balancesheetequity45593 | ||||
| Node: cashflow46382 | ||||
| Ref: #cashflow46505 | ||||
| Node: help48356 | ||||
| Ref: #help48468 | ||||
| Node: incomestatement49542 | ||||
| Ref: #incomestatement49673 | ||||
| Node: print51565 | ||||
| Ref: #print51682 | ||||
| Node: register55438 | ||||
| Ref: #register55551 | ||||
| Node: Custom register output60047 | ||||
| Ref: #custom-register-output60178 | ||||
| Node: stats61475 | ||||
| Ref: #stats61581 | ||||
| Node: test62462 | ||||
| Ref: #test62549 | ||||
| Node: ADD-ON COMMANDS62917 | ||||
| Ref: #add-on-commands63029 | ||||
| Node: Official add-ons64316 | ||||
| Ref: #official-add-ons64458 | ||||
| Node: api64545 | ||||
| Ref: #api64636 | ||||
| Node: ui64688 | ||||
| Ref: #ui64789 | ||||
| Node: web64847 | ||||
| Ref: #web64938 | ||||
| Node: Third party add-ons64984 | ||||
| Ref: #third-party-add-ons65161 | ||||
| Node: diff65296 | ||||
| Ref: #diff65395 | ||||
| Node: iadd65494 | ||||
| Ref: #iadd65610 | ||||
| Node: interest65693 | ||||
| Ref: #interest65816 | ||||
| Node: irr65911 | ||||
| Ref: #irr66011 | ||||
| Node: Experimental add-ons66089 | ||||
| Ref: #experimental-add-ons66243 | ||||
| Node: autosync66645 | ||||
| Ref: #autosync66759 | ||||
| Node: budget66998 | ||||
| Ref: #budget67122 | ||||
| Node: chart67188 | ||||
| Ref: #chart67307 | ||||
| Node: check67378 | ||||
| Ref: #check67502 | ||||
| Node: check-dates67569 | ||||
| Ref: #check-dates67711 | ||||
| Node: check-dupes67784 | ||||
| Ref: #check-dupes67927 | ||||
| Node: equity68004 | ||||
| Ref: #equity68132 | ||||
| Node: prices68251 | ||||
| Ref: #prices68380 | ||||
| Node: print-unique68435 | ||||
| Ref: #print-unique68584 | ||||
| Node: register-match68677 | ||||
| Ref: #register-match68833 | ||||
| Node: rewrite68931 | ||||
| Ref: #rewrite69065 | ||||
| Node: tags69143 | ||||
| Ref: #tags69248 | ||||
|  | ||||
| End Tag Table | ||||
|  | ||||
| @ -605,11 +605,12 @@ QUERIES | ||||
|        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,  optional  prefixes  to  match  specific  fields.  Multiple | ||||
|        search terms are combined as follows: | ||||
|        whitespace,  prefixes to match specific fields, a not: prefix to negate | ||||
|        the match. | ||||
| 
 | ||||
|        All commands except print:  show  transactions/postings/accounts  which | ||||
|        match (or negatively 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 | ||||
| 
 | ||||
| @ -619,7 +620,7 @@ QUERIES | ||||
| 
 | ||||
|        o all the other terms. | ||||
| 
 | ||||
|        The print command: show transactions which | ||||
|        The print command instead shows transactions which: | ||||
| 
 | ||||
|        o match any of the description terms AND | ||||
| 
 | ||||
| @ -629,9 +630,11 @@ QUERIES | ||||
| 
 | ||||
|        o match all the other terms. | ||||
| 
 | ||||
|        The following kinds of search terms can be used: | ||||
|        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 | ||||
|        REGEX  match  account  names by this regular expression.  (No prefix is | ||||
|               equivalent to acct:). | ||||
| 
 | ||||
|        acct:REGEX | ||||
|               same as above | ||||
| @ -693,14 +696,12 @@ QUERIES | ||||
|               any of the postings.  Also remember that  postings  inherit  the | ||||
|               tags of their parent transaction. | ||||
| 
 | ||||
|        not:   before any of the above negates the match. | ||||
|        The  following  special  search  term is used only you click an account | ||||
|        name in hledger-web: | ||||
| 
 | ||||
|        inacct:ACCTNAME | ||||
|               a special term used automatically when you click an account name | ||||
|               in hledger-web, specifying the account register we are currently | ||||
|               in (selects the transactions of that account  and  how  to  show | ||||
|               them,  can  be  filtered  further with acct etc).  Not supported | ||||
|               elsewhere in hledger. | ||||
|               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 | ||||
|  | ||||
| @ -6,29 +6,29 @@ 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, | ||||
| optional prefixes to match specific fields. | ||||
| Multiple search terms are combined as follows: | ||||
| prefixes to match specific fields, | ||||
| a not: prefix to negate the match. | ||||
| 
 | ||||
| All commands except print: | ||||
| show transactions/postings/accounts which match (or negatively match) | ||||
| We do not yet support arbitrary boolean combinations of search terms; | ||||
| instead most commands show transactions/postings/accounts which match (or negatively match): | ||||
| 
 | ||||
| - any of the description terms AND | ||||
| - any of the account terms AND | ||||
| - any of the status terms AND | ||||
| - all the other terms. | ||||
| 
 | ||||
| The print command: | ||||
| show transactions which | ||||
| The [print](/manual.html#print) command instead shows transactions which: | ||||
| 
 | ||||
| - match any of the description terms AND | ||||
| - have any postings matching any of the positive account terms AND | ||||
| - have no postings matching any of the negative account terms AND | ||||
| - match all the other terms. | ||||
| 
 | ||||
| The following kinds of search terms can be used: | ||||
| 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 | ||||
| : match account names by this regular expression. (No prefix is equivalent to `acct:`). | ||||
| 
 | ||||
| **`acct:REGEX`** | ||||
| : same as above | ||||
| @ -88,14 +88,11 @@ 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. | ||||
| 
 | ||||
| **`not:`** | ||||
| : before any of the above negates the match. | ||||
| The following special search term is used only you click an account name in hledger-web: | ||||
| 
 | ||||
| **`inacct:ACCTNAME`** | ||||
| : a special term used automatically when you click an account name in hledger-web,  | ||||
| specifying the account register we are currently in | ||||
| (selects the transactions of that account and how to show them, can be filtered further with `acct` etc). | ||||
| Not supported elsewhere in hledger. | ||||
| : 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 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user