diff --git a/hledger/doc/hledger.1 b/hledger/doc/hledger.1 index dffb19eb2..4cdd619db 100644 --- a/hledger/doc/hledger.1 +++ b/hledger/doc/hledger.1 @@ -423,7 +423,7 @@ $\ hledger\ \-f\ /some/file\ stats \f[] .fi .PP -The file name \f[C]\-\f[] (hyphen) means standard input, as usual: +The file name \f[C]\-\f[] (hyphen) means standard input: .IP .nf \f[C] @@ -431,46 +431,45 @@ $\ cat\ some.journal\ |\ hledger\ \-f\- \f[] .fi .PP -Usually this file is in hledger\[aq]s journal format, but it can also be -one of several other formats, shown below. -hledger tries to identify the format based on the file extension, as -follows: +Usually the data file is in hledger\[aq]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: .PP .TS tab(@); -l l l. +lw(10.7n) lw(33.2n) lw(26.1n). T{ -Format: +Reader: T}@T{ -Description: +Reads: T}@T{ -File extensions: +Used for file extensions: T} _ T{ -journal +\f[C]journal\f[] T}@T{ -hledger\[aq]s journal format +hledger\[aq]s journal format, also some Ledger journals T}@T{ -\f[C]\&.journal\f[], \f[C]\&.j\f[], \f[C]\&.hledger\f[], -\f[C]\&.ledger\f[] +\f[C]\&.journal\f[] \f[C]\&.j\f[] \f[C]\&.hledger\f[] \f[C]\&.ledger\f[] T} T{ -timeclock +\f[C]timeclock\f[] T}@T{ timeclock files (precise time logging) T}@T{ \f[C]\&.timeclock\f[] T} T{ -timedot +\f[C]timedot\f[] T}@T{ timedot files (approximate time logging) T}@T{ \f[C]\&.timedot\f[] T} T{ -CSV +\f[C]csv\f[] T}@T{ comma\-separated values (data interchange) T}@T{ @@ -478,11 +477,9 @@ T}@T{ T} .TE .PP -hledger identifies the format based on the file extension if possible. -If that does not identify a known format, it tries each format in turn. -.PP -If needed, eg to ensure correct error messages, you can force a specific -format by prepending it to the file path with a colon. +If needed (eg to ensure correct error messages when a file has the +"wrong" extension), you can force a specific reader/format by prepending +it to the file path with a colon. Examples: .IP .nf @@ -492,32 +489,10 @@ $\ echo\ \[aq]i\ 2009/13/1\ 08:00:00\[aq]\ |\ hledger\ print\ \-ftimeclock:\- \f[] .fi .PP -Some other experimental formats are available but not yet used by -default: -.PP -.TS -tab(@); -l l l. -T{ -Format: -T}@T{ -Description: -T}@T{ -File extensions: -T} -_ -T{ -ledger -T}@T{ -Ledger\[aq]s journal format (incomplete) -T}@T{ -T} -.TE -.PP -You can specify multiple \f[C]\-f\f[] options, to read multiple files as -one big journal. -Directives in one file will not affect subsequent files in this case (if -you need that, use the include directive instead). +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.) .SS Depth limiting .PP With the \f[C]\-\-depth\ N\f[] option, commands like account, balance diff --git a/hledger/doc/hledger.1.info b/hledger/doc/hledger.1.info index e5f2359d1..7b441396d 100644 --- a/hledger/doc/hledger.1.info +++ b/hledger/doc/hledger.1.info @@ -337,44 +337,38 @@ $ hledger stats $ hledger -f /some/file stats - The file name `-' (hyphen) means standard input, as usual: + The file name `-' (hyphen) means standard input: $ cat some.journal | hledger -f- - Usually this file is in hledger's journal format, but it can also be -one of several other formats, shown below. hledger tries to identify the -format based on the file extension, as follows: + 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: -Format: Description: File extensions: --------------------------------------------------------------------------------------------------- -journal hledger's journal format `.journal', `.j', `.hledger', `.ledger' -timeclock timeclock files (precise time logging) `.timeclock' -timedot timedot files (approximate time logging) `.timedot' -CSV comma-separated values (data interchange) `.csv' +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' + logging) +`timedot' timedot files (approximate time `.timedot' + logging) +`csv' comma-separated values (data `.csv' + interchange) - hledger identifies the format based on the file extension if -possible. If that does not identify a known format, it tries each -format in turn. - - If needed, eg to ensure correct error messages, you can force a -specific format by prepending it to the file path with a colon. -Examples: + If needed (eg to ensure correct error messages when a file has the +"wrong" extension), you can force a specific reader/format by prepending +it to the file path with a colon. Examples: $ hledger -f csv:/some/csv-file.dat stats $ echo 'i 2009/13/1 08:00:00' | hledger print -ftimeclock:- - Some other experimental formats are available but not yet used by -default: - -Format: Description: File extensions: --------------------------------------------------------------------- -ledger Ledger's journal format (incomplete) - - You can specify multiple `-f' options, to read multiple files as one -big journal. Directives in one file will not affect subsequent files in -this case (if you need that, use the include directive instead). + 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.)  File: hledger.1.info, Node: Depth limiting, Next: Smart dates, Prev: Input files, Up: OPTIONS @@ -2175,91 +2169,91 @@ Node: Reporting options7583 Ref: #reporting-options7736 Node: Input files9512 Ref: #input-files9652 -Node: Depth limiting11677 -Ref: #depth-limiting11817 -Node: Smart dates12018 -Ref: #smart-dates12157 -Node: Report intervals13154 -Ref: #report-intervals13307 -Node: Period expressions13643 -Ref: #period-expressions13808 -Node: Regular expressions16143 -Ref: #regular-expressions16285 -Node: QUERIES17768 -Ref: #queries17872 -Node: COMMANDS21511 -Ref: #commands21625 -Node: accounts22298 -Ref: #accounts22398 -Node: activity23380 -Ref: #activity23492 -Node: add23851 -Ref: #add23952 -Node: balance26611 -Ref: #balance26724 -Node: Flat mode29697 -Ref: #flat-mode29824 -Node: Depth limited balance reports30243 -Ref: #depth-limited-balance-reports30446 -Node: Multicolumn balance reports30867 -Ref: #multicolumn-balance-reports31069 -Node: Market value35718 -Ref: #market-value35882 -Node: Custom balance output36375 -Ref: #custom-balance-output36548 -Node: Output destination38652 -Ref: #output-destination38817 -Node: CSV output39087 -Ref: #csv-output39206 -Node: balancesheet39603 -Ref: #balancesheet39731 -Node: cashflow40383 -Ref: #cashflow40500 -Node: help41190 -Ref: #help41302 -Node: incomestatement42139 -Ref: #incomestatement42269 -Node: info42996 -Ref: #info43103 -Node: man43465 -Ref: #man43562 -Node: print43965 -Ref: #print44070 -Node: register45416 -Ref: #register45529 -Node: Custom register output50021 -Ref: #custom-register-output50152 -Node: stats51449 -Ref: #stats51555 -Node: test52431 -Ref: #test52518 -Node: ADD-ON COMMANDS52885 -Ref: #add-on-commands53021 -Node: api54309 -Ref: #api54401 -Node: autosync54435 -Ref: #autosync54550 -Node: diff56865 -Ref: #diff56975 -Node: equity57639 -Ref: #equity57753 -Node: interest59081 -Ref: #interest59198 -Node: irr62282 -Ref: #irr62395 -Node: print-unique64770 -Ref: #print-unique64900 -Node: rewrite65158 -Ref: #rewrite65277 -Node: ui65806 -Ref: #ui65906 -Node: web65947 -Ref: #web66035 -Node: TROUBLESHOOTING66068 -Ref: #troubleshooting66187 -Node: Run-time problems66241 -Ref: #run-time-problems66384 -Node: Known limitations68328 -Ref: #known-limitations68471 +Node: Depth limiting11489 +Ref: #depth-limiting11629 +Node: Smart dates11830 +Ref: #smart-dates11969 +Node: Report intervals12966 +Ref: #report-intervals13119 +Node: Period expressions13455 +Ref: #period-expressions13620 +Node: Regular expressions15955 +Ref: #regular-expressions16097 +Node: QUERIES17580 +Ref: #queries17684 +Node: COMMANDS21323 +Ref: #commands21437 +Node: accounts22110 +Ref: #accounts22210 +Node: activity23192 +Ref: #activity23304 +Node: add23663 +Ref: #add23764 +Node: balance26423 +Ref: #balance26536 +Node: Flat mode29509 +Ref: #flat-mode29636 +Node: Depth limited balance reports30055 +Ref: #depth-limited-balance-reports30258 +Node: Multicolumn balance reports30679 +Ref: #multicolumn-balance-reports30881 +Node: Market value35530 +Ref: #market-value35694 +Node: Custom balance output36187 +Ref: #custom-balance-output36360 +Node: Output destination38464 +Ref: #output-destination38629 +Node: CSV output38899 +Ref: #csv-output39018 +Node: balancesheet39415 +Ref: #balancesheet39543 +Node: cashflow40195 +Ref: #cashflow40312 +Node: help41002 +Ref: #help41114 +Node: incomestatement41951 +Ref: #incomestatement42081 +Node: info42808 +Ref: #info42915 +Node: man43277 +Ref: #man43374 +Node: print43777 +Ref: #print43882 +Node: register45228 +Ref: #register45341 +Node: Custom register output49833 +Ref: #custom-register-output49964 +Node: stats51261 +Ref: #stats51367 +Node: test52243 +Ref: #test52330 +Node: ADD-ON COMMANDS52697 +Ref: #add-on-commands52833 +Node: api54121 +Ref: #api54213 +Node: autosync54247 +Ref: #autosync54362 +Node: diff56677 +Ref: #diff56787 +Node: equity57451 +Ref: #equity57565 +Node: interest58893 +Ref: #interest59010 +Node: irr62094 +Ref: #irr62207 +Node: print-unique64582 +Ref: #print-unique64712 +Node: rewrite64970 +Ref: #rewrite65089 +Node: ui65618 +Ref: #ui65718 +Node: web65759 +Ref: #web65847 +Node: TROUBLESHOOTING65880 +Ref: #troubleshooting65999 +Node: Run-time problems66053 +Ref: #run-time-problems66196 +Node: Known limitations68140 +Ref: #known-limitations68283  End Tag Table diff --git a/hledger/doc/hledger.1.txt b/hledger/doc/hledger.1.txt index c1e78d800..b69909acc 100644 --- a/hledger/doc/hledger.1.txt +++ b/hledger/doc/hledger.1.txt @@ -287,60 +287,47 @@ OPTIONS $ hledger -f /some/file stats - The file name - (hyphen) means standard input, as usual: + The file name - (hyphen) means standard input: $ cat some.journal | hledger -f- - Usually this file is in hledger's journal format, but it can also be - one of several other formats, shown below. hledger tries to identify - the format based on the file extension, as follows: + 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: - Format: Description: File extensions: - ------------------------------------------------------ - journal hledger's journal .journal, .j, - format .hledger, .ledger - timeclock timeclock files .timeclock - (precise time log- - ging) - timedot timedot files .timedot - (approximate time - logging) - CSV comma-separated .csv - values (data inter- - change) + 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 + logging) + timedot timedot files (approximate time .timedot + logging) + csv comma-separated values (data .csv + interchange) - hledger identifies the format based on the file extension if possible. - If that does not identify a known format, it tries each format in turn. - - If needed, eg to ensure correct error messages, you can force a spe- - cific format by prepending it to the file path with a colon. Examples: + 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 $ echo 'i 2009/13/1 08:00:00' | hledger print -ftimeclock:- - Some other experimental formats are available but not yet used by - default: - - - Format: Description: File extensions: - ------------------------------------------------- - ledger Ledger's journal - format (incomplete) - - You can specify multiple -f options, to read multiple files as one big - journal. Directives in one file will not affect subsequent files in - this case (if you need that, use the include directive instead). + 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.) Depth limiting - With the --depth N option, commands like account, balance and register - will show only the uppermost accounts in the account tree, down to + With the --depth N option, commands like account, balance and register + will show only the uppermost accounts in the account tree, down to level N. Use this when you want a summary with less detail. 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: @@ -348,10 +335,10 @@ OPTIONS 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 + 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 @@ -364,23 +351,23 @@ 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- + 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. 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 + Here's a basic period expression specifying the first quarter of 2009. + Note, hledger always treats start dates as inclusive and end dates as exclusive: -p "from 2009/1/1 to 2009/4/1" - Keywords like "from" and "to" are optional, and so are the spaces, as - long as you don't run two dates together. "to" can also be written as + Keywords like "from" and "to" are optional, and so are the spaces, as + long as you don't run two dates together. "to" can also be written as "-". These are equivalent to the above: @@ -388,7 +375,7 @@ OPTIONS -p2009/1/1to2009/4/1 -p2009/1/1-2009/4/1 - Dates are smart dates, so if the current year is 2009, the above can + Dates are smart dates, so if the current year is 2009, the above can also be written as: @@ -404,25 +391,26 @@ OPTIONS 1, 2009 -p "from 2009/1" the same -p "from 2009" the same - -p "to 2009" everything before january + -p "to 2009" everything before january 1, 2009 - A single date with no "from" or "to" defines both the start and end + A single date with no "from" or "to" defines both the start and end date like so: - -p "2009" the year 2009; equivalent + + -p "2009" the year 2009; equivalent to "2009/1/1 to 2010/1/1" - -p "2009/1" the month of jan; equiva- + -p "2009/1" the month of jan; equiva- lent to "2009/1/1 to 2009/2/1" - -p "2009/1/1" just that day; equivalent + -p "2009/1/1" just that day; equivalent to "2009/1/1 to 2009/1/2" - The argument of -p can also begin with, or be, a report interval - expression. The basic report intervals are daily, weekly, monthly, + The argument of -p can also begin with, or be, a report interval + expression. The basic report intervals are daily, weekly, monthly, quarterly, or yearly, which have the same effect as the -D,-W,-M,-Q, or - -Y flags. Between report interval and start/end dates (if any), the + -Y flags. Between report interval and start/end dates (if any), the word in is optional. Examples: @@ -431,7 +419,7 @@ OPTIONS -p "quarterly" The following more complex report intervals are also supported: - biweekly, bimonthly, every N days|weeks|months|quarters|years, + biweekly, bimonthly, every N days|weeks|months|quarters|years, every Nth day [of month], every Nth day of week. Examples: @@ -441,12 +429,12 @@ OPTIONS -p "every 2 weeks" -p "every 5 days from 1/3" - Show historical balances at end of 15th each month (N is exclusive end + Show historical balances at end of 15th each month (N is exclusive end date): hledger balance -H -p "every 16th day" - Group postings from start of wednesday to end of next tuesday (N is + Group postings from start of wednesday to end of next tuesday (N is start date and exclusive end date): hledger register checking -p "every 3rd day of week" @@ -454,56 +442,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 To match a regular expression metacharacter like $ as a literal char- acter, 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 a second time, with single or - double quotes or another backslash. Eg, to match amounts with the + double quotes or another backslash. Eg, to match amounts with the dollar sign from the command line, write cur:'\$' or cur:\\$. 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, optional prefixes to match specific fields. Multiple + whitespace, optional prefixes to match specific fields. Multiple search terms are combined as follows: - All commands except print: show transactions/postings/accounts which + All commands except print: show transactions/postings/accounts which match (or negatively match) o any of the description terms AND @@ -530,22 +518,22 @@ QUERIES same as above 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:\\$. @@ -554,29 +542,29 @@ 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 real:, real:0 match real or virtual postings respectively status:*, status:!, status: - match cleared, pending, or uncleared/pending transactions + match cleared, pending, or uncleared/pending 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. not: before any of the above negates the match. @@ -584,24 +572,24 @@ QUERIES 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 + in (selects the transactions of that account and how to show + them, can be filtered further with acct etc). Not supported elsewhere in hledger. 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 any unambiguous prefix of a command name (hledger inc), or one of the standard short aliases dis- played in the command list (hledger is). @@ -616,14 +604,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: @@ -666,8 +654,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 @@ -680,24 +668,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. @@ -705,20 +693,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): @@ -755,7 +743,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 @@ -769,7 +757,7 @@ COMMANDS account is depth-clipped (default in multicolumn reports) -V --value - convert amounts to current market value in their default valua- + convert amounts to current market value in their default valua- tion commodity -A --average @@ -794,10 +782,10 @@ 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. - 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 most useful command. $ hledger balance @@ -814,24 +802,24 @@ 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 + following line for more compact output. (Use --no-elide to prevent this.) - 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 @@ -841,9 +829,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 @@ -851,9 +839,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 @@ -863,12 +851,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 @@ -883,8 +871,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 @@ -900,8 +888,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: @@ -917,26 +905,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: @@ -959,16 +947,16 @@ COMMANDS Market value The -V/--value flag converts all the reported amounts to their "current - market value" using their default market price. That is the latest - market price (P directive) found in the journal (or an included file), + market value" using their default market price. That is the latest + market price (P directive) found in the journal (or an included file), for the amount's commodity, dated on or before the report end date. Unlike Ledger, hledger's -V only uses the market prices recorded with P - directives, ignoring transaction prices recorded as part of posting + directives, ignoring transaction prices recorded as part of posting amounts (which -B/--cost uses). Using -B and -V together is allowed. 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)" @@ -986,7 +974,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) @@ -997,14 +985,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) @@ -1013,7 +1001,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. @@ -1021,19 +1009,19 @@ 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 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) @@ -1041,8 +1029,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 @@ -1056,8 +1044,8 @@ COMMANDS --drop=N in flat mode: omit N leading account name parts - 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 @@ -1087,9 +1075,9 @@ COMMANDS --drop=N in flat mode: omit N leading account name parts - This command displays a simple cashflow statement It shows the change - in all "cash" (ie, liquid assets) accounts for the period. It cur- - rently assumes that cash accounts are under a top-level account named + This command displays a simple cashflow statement It shows the change + in all "cash" (ie, liquid assets) accounts for the period. It cur- + rently assumes that cash accounts are under a top-level account named asset and do not contain receivable or A/R (plural forms also allowed.) $ hledger cashflow @@ -1109,11 +1097,11 @@ COMMANDS help Show any of the hledger manuals. - The help command displays any of the main hledger man pages. (Unlike - hledger --help, which displays only the hledger man page.) Run it with - no arguments to list available topics (their names are shortened for - easier typing), and run hledger help TOPIC to select one. The output - is similar to a man page, but fixed width. It may be long, so you may + The help command displays any of the main hledger man pages. (Unlike + hledger --help, which displays only the hledger man page.) Run it with + no arguments to list available topics (their names are shortened for + easier typing), and run hledger help TOPIC to select one. The output + is similar to a man page, but fixed width. It may be long, so you may wish to pipe it into a pager. See also info and man. $ hledger help @@ -1142,8 +1130,8 @@ COMMANDS --drop=N in flat mode: omit N leading account name parts - This command displays a simple income statement. It currently assumes - that you have top-level accounts named income (or revenue) and expense + This command displays a simple income statement. It currently assumes + that you have top-level accounts named income (or revenue) and expense (plural forms also allowed.) $ hledger incomestatement @@ -1170,37 +1158,37 @@ COMMANDS info Show any of the hledger manuals using info. - The info command displays any of the hledger reference manuals using - the info hypertextual documentation viewer. This can be a very effi- - cient way to browse large manuals. It requires the "info" program to + The info command displays any of the hledger reference manuals using + the info hypertextual documentation viewer. This can be a very effi- + cient way to browse large manuals. It requires the "info" program to be available in your PATH. - As with help, run it with no arguments to list available topics (manu- + As with help, run it with no arguments to list available topics (manu- als). man Show any of the hledger manuals using man. - The man command displays any of the hledger reference manuals using - man, the standard documentation viewer on unix systems. This will fit - the text to your terminal width, and probably invoke a pager automati- + The man command displays any of the hledger reference manuals using + man, the standard documentation viewer on unix systems. This will fit + the text to your terminal width, and probably invoke a pager automati- cally. It requires the "man" program to be available in your PATH. - As with help, run it with no arguments to list available topics (manu- + As with help, run it with no arguments to list available topics (manu- als). print Show transactions from the journal. -m STR --match=STR - show the transaction whose description is most similar to STR, + show the transaction whose description is most similar to STR, and is most recent -O FMT --output-format=FMT 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. $ hledger print @@ -1225,12 +1213,12 @@ COMMANDS liabilities:debts $1 assets:bank:checking $-1 - The print command displays full transactions from the journal file, - tidily formatted and showing all amounts explicitly. The output of - print is always a valid hledger journal, but it does always not pre- + The print command displays full transactions from the journal file, + tidily formatted and showing all amounts explicitly. The output of + print is always a valid hledger journal, but it does always not pre- serve all original content exactly (eg directives). - hledger's print command also shows all unit prices in effect, or (with + hledger's print command also shows all unit prices in effect, or (with -B/--cost) shows cost amounts. The print command also supports output destination and CSV output. @@ -1242,7 +1230,7 @@ COMMANDS show running total from report start date (default) -H --historical - show historical running total/balance (includes postings before + show historical running total/balance (includes postings before report start date) -A --average @@ -1253,18 +1241,18 @@ COMMANDS show postings' siblings instead -w N --width=N - set output width (default: terminal width or COLUMNS. -wN,M + set output width (default: terminal width or COLUMNS. -wN,M sets description width as well) -O FMT --output-format=FMT 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. The register command displays postings, one per line, and their running - total. This is typically used with a query selecting a particular + total. This is typically used with a query selecting a particular account, to see that account's activity: $ hledger register checking @@ -1273,8 +1261,8 @@ COMMANDS 2008/06/02 save assets:bank:checking $-1 $1 2008/12/31 pay off assets:bank:checking $-1 0 - The --historical/-H flag adds the balance from any undisplayed prior - postings to the running total. This is useful when you want to see + The --historical/-H flag adds the balance from any undisplayed prior + postings to the running total. This is useful when you want to see only recent activity, with a historically accurate running balance: $ hledger register checking -b 2008/6 --historical @@ -1284,23 +1272,23 @@ COMMANDS The --depth option limits the amount of sub-account detail displayed. - The --average/-A flag shows the running average posting amount instead + The --average/-A flag shows the running average posting amount instead of the running total (so, the final number displayed is the average for - the whole report period). This flag implies --empty (see below). It - is affected by --historical. It works best when showing just one + the whole report period). This flag implies --empty (see below). It + is affected by --historical. It works best when showing just one account and one commodity. - The --related/-r flag shows the other postings in the transactions of + The --related/-r flag shows the other postings in the transactions of the postings which would normally be shown. - With a reporting interval, register shows summary postings, one per + With a reporting interval, register shows summary postings, one per interval, aggregating the postings to each account: $ hledger register --monthly income 2008/01 income:salary $-1 $-1 2008/06 income:gifts $-1 $-2 - Periods with no activity, and summary postings with a zero amount, are + Periods with no activity, and summary postings with a zero amount, are not shown by default; use the --empty/-E flag to see them: $ hledger register --monthly income -E @@ -1317,7 +1305,7 @@ COMMANDS 2008/11 0 $-2 2008/12 0 $-2 - Often, you'll want to see just one line per interval. The --depth + Often, you'll want to see just one line per interval. The --depth option helps with this, causing subaccounts to be aggregated: $ hledger register --monthly assets --depth 1h @@ -1325,19 +1313,19 @@ COMMANDS 2008/06 assets $-1 0 2008/12 assets $-1 $-1 - Note when using report intervals, if you specify start/end dates these - will be adjusted outward if necessary to contain a whole number of - intervals. This ensures that the first and last intervals are full + Note when using report intervals, if you specify start/end dates these + will be adjusted outward if necessary to contain a whole number of + intervals. This ensures that the first and last intervals are full length and comparable to the others in the report. Custom register output - register uses the full terminal width by default, except on windows. - You can override this by setting the COLUMNS environment variable (not + register uses the full terminal width by default, except on windows. + You can override this by setting the COLUMNS environment variable (not a bash shell variable) or by using the --width/-w option. - The description and account columns normally share the space equally - (about half of (width - 40) each). You can adjust this by adding a - description width as part of --width's argument, comma-separated: + The description and account columns normally share the space equally + (about half of (width - 40) each). You can adjust this by adding a + description width as part of --width's argument, comma-separated: --width W,D . Here's a diagram: <--------------------------------- width (W) ----------------------------------> @@ -1353,14 +1341,14 @@ COMMANDS $ hledger reg -w 100,40 # set overall width 100, description width 40 $ hledger reg -w $COLUMNS,40 # use terminal width, and set description width - The register command also supports the -o/--output-file and -O/--out- + The register command also supports the -o/--output-file and -O/--out- put-format options for controlling output destination and CSV output. stats Show some journal statistics. -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. $ hledger stats @@ -1375,8 +1363,8 @@ COMMANDS Accounts : 8 (depth 3) Commodities : 1 ($) - The stats command displays summary information for the whole journal, - or a matched part of it. With a reporting interval, it shows a report + The stats command displays summary information for the whole journal, + or a matched part of it. With a reporting interval, it shows a report for each report period. The stats command also supports -o/--output-file for controlling output @@ -1388,37 +1376,37 @@ COMMANDS $ hledger test Cases: 74 Tried: 74 Errors: 0 Failures: 0 - This command runs hledger's built-in unit tests and displays a quick + This command runs hledger's built-in unit tests and displays a quick report. With a regular expression argument, it selects only tests with matching names. It's mainly used in development, but it's also nice to be able to check your hledger executable for smoke at any time. ADD-ON COMMANDS - Add-on commands are executables in your PATH whose name starts with - hledger- and ends with any of these file extensions: none, - .hs,.lhs,.pl,.py,.rb,.rkt,.sh,.bat,.com,.exe. Also, an add-on's name + Add-on commands are executables in your PATH whose name starts with + hledger- and ends with any of these file extensions: none, + .hs,.lhs,.pl,.py,.rb,.rkt,.sh,.bat,.com,.exe. Also, an add-on's name may not be the same as any built-in command or alias. - hledger will detect these and include them in the command list and let - you invoke them with hledger ADDONCMD. However there are some limita- + hledger will detect these and include them in the command list and let + you invoke them with hledger ADDONCMD. However there are some limita- tions: o Options appearing before ADDONCMD will be visible only to hledger and will not be passed to the add-on. Eg: hledger -h web shows hledger's usage, hledger web -h shows hledger-web's usage. - o Options understood only by the add-on must go after a -- argument to - hide them from hledger, which would otherwise reject them. Eg: + o Options understood only by the add-on must go after a -- argument to + hide them from hledger, which would otherwise reject them. Eg: hledger web -- --server. - Sometimes it may be more convenient to just run the add-on directly, + Sometimes it may be more convenient to just run the add-on directly, eg: hledger-web --server. - Add-ons which are written in haskell can take advantage of the - hledger-lib library for journal parsing, reporting, command-line + Add-ons which are written in haskell can take advantage of the + hledger-lib library for journal parsing, reporting, command-line options, etc. - Here are some hledger add-ons available from Hackage, the extra direc- + Here are some hledger add-ons available from Hackage, the extra direc- tory in the hledger source, or elsewhere: api @@ -1476,11 +1464,11 @@ ADD-ON COMMANDS WF:4303001832 -$6.00 [assets:business:bank:wf:bchecking:banking] $6.00 - ledger-autosync, which includes a hledger-autosync alias, downloads + ledger-autosync, which includes a hledger-autosync alias, downloads transactions from your bank(s) via OFX, and prints just the new ones as journal entries which you can add to your journal. It can also operate - on .OFX files which you've downloaded manually. It can be a nice - alternative to hledger's built-in CSV reader, especially if your bank + on .OFX files which you've downloaded manually. It can be a nice + alternative to hledger's built-in CSV reader, especially if your bank supports OFX download. diff @@ -1506,9 +1494,9 @@ ADD-ON COMMANDS 2015/02/02 (acct:two) $2 - hledger-diff compares two journal files. Given an account name, it - prints out the transactions affecting that account which are in one - journal file but not in the other. This can be useful for reconciling + hledger-diff compares two journal files. Given an account name, it + prints out the transactions affecting that account which are in one + journal file but not in the other. This can be useful for reconciling existing journals with bank statements. equity @@ -1535,14 +1523,14 @@ ADD-ON COMMANDS equity:opening balances 0 This prints a journal entry which zeroes out the specified accounts (or - all accounts) with a transfer to/from "equity:closing balances" (like - Ledger's equity command). Also, it prints an similar entry with oppo- + all accounts) with a transfer to/from "equity:closing balances" (like + Ledger's equity command). Also, it prints an similar entry with oppo- site sign for restoring the balances from "equity:opening balances". These can be useful for ending one journal file and starting a new one, - respectively. By zeroing your asset and liability accounts at the end + respectively. By zeroing your asset and liability accounts at the end of a file and restoring them at the start of the next one, you will see - correct asset/liability balances whether you run hledger on just one + correct asset/liability balances whether you run hledger on just one file, or on several files concatenated with include. interest @@ -1623,11 +1611,11 @@ ADD-ON COMMANDS Liabilities:Bank EUR 3700.00 hledger-interest computes interests for a given account. Using command - line flags, the program can be configured to use various schemes for - day-counting, such as act/act, 30/360, 30E/360, and 30/360isda. Fur- - thermore, it supports a (small) number of interest schemes, i.e. + line flags, the program can be configured to use various schemes for + day-counting, such as act/act, 30/360, 30E/360, and 30/360isda. Fur- + thermore, it supports a (small) number of interest schemes, i.e. annual interest with a fixed rate and the scheme mandated by the German - BGB288 (Basiszins fr Verbrauchergeschfte). See the package page for + BGB288 (Basiszins fr Verbrauchergeschfte). See the package page for more. irr @@ -1685,11 +1673,11 @@ ADD-ON COMMANDS 2011/04/01 - 2011/05/01: 32.24% 2011/05/01 - 2011/06/01: 95.92% - hledger-irr computes the internal rate of return, also known as the - effective interest rate, of a given investment. After specifying what - account holds the investment, and what account stores the gains (or - losses, or fees, or cost), it calculates the hypothetical annual rate - of fixed rate investment that would have provided the exact same cash + hledger-irr computes the internal rate of return, also known as the + effective interest rate, of a given investment. After specifying what + account holds the investment, and what account stores the gains (or + losses, or fees, or cost), it calculates the hypothetical annual rate + of fixed rate investment that would have provided the exact same cash flow. See the package page for more. print-unique @@ -1710,8 +1698,8 @@ ADD-ON COMMANDS entries. hledger-rewrite.hs, in hledger's extra directory (compilation - optional), adds postings to existing transactions, optionally with an - amount based on the existing transaction's first amount. See the + optional), adds postings to existing transactions, optionally with an + amount based on the existing transaction's first amount. See the script for more details. $ hledger rewrite -- [QUERY] --add-posting "ACCT AMTEXPR" ... @@ -1726,26 +1714,26 @@ ADD-ON COMMANDS TROUBLESHOOTING Run-time problems - Here are some issues you might encounter when you run hledger (and - remember you can also seek help from the IRC channel, mail list or bug + Here are some issues you might encounter when you run hledger (and + remember you can also seek help from the IRC channel, mail list or bug tracker): Successfully installed, but "No command 'hledger' found" stack and cabal install binaries into a special directory, which should - be added to your PATH environment variable. Eg on unix-like systems, + be added to your PATH environment variable. Eg on unix-like systems, 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 @@ -1764,7 +1752,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 @@ -1785,45 +1773,45 @@ TROUBLESHOOTING Known limitations Command line interface - Add-on command options, unless they are also understood by the main - hledger executable, must be written after --, like this: + Add-on command options, unless they are also understood by the main + hledger executable, must be written after --, like this: hledger web -- --server Differences from Ledger - Not all of Ledger's journal file syntax is supported. See file format + Not all of Ledger's journal file syntax is supported. See file format differences. - hledger is slower than Ledger, and uses more memory, on large data + hledger is slower than Ledger, and uses more memory, on large data files. Windows limitations - In a windows CMD window, non-ascii characters and colours are not sup- + In a windows CMD window, non-ascii characters and colours are not sup- ported. In a windows Cygwin/MSYS/Mintty window, the tab key is not supported in hledger add. ENVIRONMENT - COLUMNS The screen width used by the register command. Default: the + COLUMNS The screen width used by the register command. Default: the full terminal width. 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. - hledger can't render non-ascii characters when run from a Windows com- + hledger can't render non-ascii characters when run from a Windows com- mand prompt (up to Windows 7 at least). When input data contains non-ascii characters, a suitable system locale @@ -1833,7 +1821,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) @@ -1847,7 +1835,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) diff --git a/hledger/doc/options.m4.md b/hledger/doc/options.m4.md index 820fe6c91..607d26b35 100644 --- a/hledger/doc/options.m4.md +++ b/hledger/doc/options.m4.md @@ -87,34 +87,34 @@ or with the `-f/--file` option: $ hledger -f /some/file stats ``` -The file name `-` (hyphen) means standard input, as usual: +The file name `-` (hyphen) means standard input: ```bash $ cat some.journal | hledger -f- ``` -Usually this file is in hledger's journal format, -but it can also be one of several other formats. -Each one is handled by a built-in "reader", as follows: +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 some Ledger journals | `.journal` `.j` `.hledger` `.ledger` -| `timeclock` | timeclock files (precise time logging) | `.timeclock` -| `timedot` | timedot files (approximate time logging) | `.timedot` -| `csv` | comma-separated values (data interchange) | `.csv` +| Reader: | Reads: | Used for file extensions: +|-----------------|-------------------------------------------------------|------------------------------------------- +| `journal` | hledger's journal format, also some Ledger journals | `.journal` `.j` `.hledger` `.ledger` +| `timeclock` | timeclock files (precise time logging) | `.timeclock` +| `timedot` | timedot files (approximate time logging) | `.timedot` +| `csv` | comma-separated values (data interchange) | `.csv` -Usually hledger detects the format automatically based on the file extension, -or if that does not work, by trying each reader in turn. -If needed, eg to ensure correct error messages, you can force a specific reader/format -by prepending it to the file path with a colon. Examples: +If needed (eg to ensure correct error messages when a file has the "wrong" extension), +you can force a specific reader/format by prepending it to the file path with a colon. +Examples: ```bash $ hledger -f csv:/some/csv-file.dat stats $ echo 'i 2009/13/1 08:00:00' | hledger print -ftimeclock:- ``` -You can 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. +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.) ## Depth limiting