From 6b5ff2aebfc55cb9cd2f8e621663d3b749179a66 Mon Sep 17 00:00:00 2001 From: thdox Date: Thu, 22 Jan 2015 00:57:20 +0100 Subject: Add documentation for --no-pager option. Minor updates to --pager documentation. [ci skip] --- doc/ledger3.texi | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 9597083c..9f80ea91 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -5620,6 +5620,9 @@ Report the last @var{INT} postings. @item --pager @var{FILE} Direct output to @var{FILE} pager program. +@item --no-pager +Direct output to stdout, avoiding pager program. + @item --average @itemx -A Report the average posting value. @@ -6430,6 +6433,9 @@ Aliases are completely ignored. @item --no-color Suppress any color TTY output. +@item --no-pager +Direct output to stdout, avoiding pager program. + @item --no-rounding Don't output @samp{} postings. Note that this will cause the running total to often not add up! Its main use is for @@ -6453,7 +6459,7 @@ been executed, such as periodic gathering. Redirect the output of ledger to the file defined in @file{FILE}. @item --pager @var{FILE} -Specify the pager program to use. +Direct output to @var{FILE} pager program. @item --payee @var{VEXPR} Sets a value expression for formatting the payee. In the @@ -6960,9 +6966,13 @@ meaning of the flag (instead of the first five transactions being printed, for example, it would print all but the first five). @item --pager @var{FILE} -Tell Ledger to pass its output to the given pager program; very useful -when the output is especially long. This behavior can be made the -default by setting the @env{LEDGER_PAGER} environment variable. +Tell Ledger to pass its output to the given @var{FILE} pager program; +very useful when the output is especially long. This behavior can be +made the default by setting the @env{LEDGER_PAGER} environment variable. + +@item --no-pager +Tell Ledger to @emph{not} pass its output to a pager program; useful +when a pager is set by default. @item --average @itemx -A -- cgit v1.2.3 From 97a6761ca7da2957e870d3698dcfef9272e41ed7 Mon Sep 17 00:00:00 2001 From: thdox Date: Thu, 22 Jan 2015 01:35:14 +0100 Subject: Add documentation for option --permissive. --- doc/ledger.1 | 3 ++- doc/ledger3.texi | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger.1 b/doc/ledger.1 index fb434880..9aac44e5 100644 --- a/doc/ledger.1 +++ b/doc/ledger.1 @@ -679,7 +679,8 @@ For a balance report only those transactions will be accounted in the final balances. .It Fl \-period-sort Sort the posting within transactions using the given value expression. -.\".It Fl \-permissive +.It Fl \-permissive +Quiet balance assertions. .It Fl \-pivot Ar STR Produce a balance pivot report .Nm around diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 9597083c..a05f15db 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -5936,7 +5936,7 @@ Ledger does not expand any aliases if this option is specified. Accounts, tags or commodities not previously declared will cause errors. @item --permissive -FIX THIS ENTRY @c FIXME thdox +Quiet balance assertions. @item --price-db @var{FILE} Specify the location of the price entry data file. -- cgit v1.2.3 From 3b74b20eddeefbdc7144ce7414b4a4c779876676 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Tue, 27 Jan 2015 21:58:41 +0100 Subject: [doc] Add texinfo reference for permissive option to related balance assertions section. [ci skip] --- doc/ledger3.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 8615c0d7..55d65c82 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -5939,7 +5939,7 @@ Ledger does not expand any aliases if this option is specified. Accounts, tags or commodities not previously declared will cause errors. @item --permissive -Quiet balance assertions. +Quiet @ref{Balance assertions, balance assertions}. @item --price-db @var{FILE} Specify the location of the price entry data file. -- cgit v1.2.3 From 185656e191d5e0b3424f528b33956d2b4f917234 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Mon, 19 Jan 2015 17:27:43 +0100 Subject: [doc] Add tests to value and format expressions and change formatting for value expressions using @defun, @defvar. --- doc/ledger.1 | 20 +- doc/ledger3.texi | 576 ++++++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 506 insertions(+), 90 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger.1 b/doc/ledger.1 index 03cd9dac..8aa0f474 100644 --- a/doc/ledger.1 +++ b/doc/ledger.1 @@ -956,6 +956,7 @@ Character position where entry for posting begins. Return the transaction code, the string between the parenthesis after the date. .It Nm comment .It Nm commodity +Return the commodity of the posting amount. .It Nm cost .It Nm count .It Nm date @@ -970,7 +971,14 @@ Line number where entry for posting ends. Character position where entry for posting ends. .It Nm filename The name of the ledger data file from whence the posting came. -.It Nm format_date +.It Fn format_date date format +Return the +.Ar date +as a string using +.Ar format . +See +.Xr strftime 3 +for format string details. .It Nm get_at .It Nm has_meta .It Nm has_tag @@ -983,11 +991,19 @@ The name of the ledger data file from whence the posting came. .It Nm options .It Nm partial_account .It Nm payee +.It Fn percent value_a value_b +Return the percentage of +.Ar value_a +in relation to +.Ar value_b . .It Nm pending .It Nm post .It Nm print .It Nm quantity -.It Nm quoted +.It Fn quoted expression +Surround +.Ar expression +with double-quotes. .It Nm real .It Nm rounded .It Nm scrub diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 55d65c82..b98664f9 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -2,6 +2,7 @@ @setfilename ledger3.info @include version.texi +@set FIXME:UNDOCUMENTED @sc{undocumented}! Please help by contributing documentation for this feature. @settitle Ledger: Command-Line Accounting @c Before release, run C-u C-c C-u C-a (texinfo-all-menus-update with @@ -5323,13 +5324,13 @@ with Ledger 2.X. @findex stats @findex stat -FIX THIS ENTRY @c FIXME thdox +@value{FIXME:UNDOCUMENTED} @node @command{select}, , @command{stats}, Reports about your Journals @subsection @command{select} @findex select -FIX THIS ENTRY @c FIXME thdox +@value{FIXME:UNDOCUMENTED} @node Command-Line Syntax, Budgeting and Forecasting, Reporting Commands, Top @chapter Command-Line Syntax @@ -5465,6 +5466,9 @@ Redirect output to @file{FILE}. @itemx -i @var{FILE} Specify an options file. +@item --import @var{FILE} +@value{FIXME:UNDOCUMENTED} + @item --account @var{STR} @itemx -a @var{STR} Specify default account @var{STR} for QIF file postings. @@ -5782,7 +5786,7 @@ or testing small journal files not associated with your main financial database. @item --debug @var{CODE} -FIX THIS ENTRY @c FIXME thdox +@value{FIXME:UNDOCUMENTED} @item --help @itemx -h @@ -5843,10 +5847,10 @@ slowdown. When combined with @option{--debug @var{CODE}} ledger will produce memory trace information. @item --verify-memory -FIX THIS ENTRY @c FIXME thdox +@value{FIXME:UNDOCUMENTED} @item --version -FIX THIS ENTRY @c FIXME thdox +@value{FIXME:UNDOCUMENTED} @end ftable @@ -5863,13 +5867,26 @@ sessions with multiple reports per session. @ftable @option @item --cache @var{FIXME} -FIX THIS ENTRY @c FIXME thdox +@value{FIXME:UNDOCUMENTED} @item --check-payees -FIX THIS ENTRY @c FIXME thdox +Enable strict and pedantic checking for payees as well as accounts, +commodities and tags. This only works in conjunction with +@option{--strict} or @option{--pedantic}. @item --day-break -FIX THIS ENTRY @c FIXME thdox +Break up @command{register} report of @ref{timelog} entries that span multiple +days by day. +@c see test/baseline/opt-day-break.dat +@c @smallexample @c input: +@c i 2015/ +@c @end smallexample +@c @smallexample @c command: +@c $ ledger reg --day-break +@c @end smallexample +@c @smallexample @c output: +@c @end smallexample +@value{FIXME:UNDOCUMENTED} @item --decimal-comma Direct Ledger to parse journals using the European standard comma as @@ -5881,7 +5898,8 @@ Direct Ledger to download prices using the script defined via the option @option{--getquote @var{FILE}}. @item --explicit -FIX THIS ENTRY @c FIXME thdox +@c see test/baseline/opt-explicit.test +@value{FIXME:UNDOCUMENTED} @item --file @var{FILE} @itemx -f @var{FILE} @@ -5975,7 +5993,7 @@ For example 8100 seconds by default will be displayed as 2.25 whereas with the @option{--time-colon} option they will be displayed as 2:15. @item --value-expr @var{FIXME} -FIX THIS ENTRY @c FIXME thdox +@value{FIXME:UNDOCUMENTED} @end ftable @@ -6035,7 +6053,9 @@ Set the width in characters of the amount column in the Anonymize registry output, mostly for sending in bug reports. @item --auto-match -FIX THIS ENTRY @c FIXME thdox +@c Automatically match accounts from ledger journal when using convert command +@c see test/baseline/opt-auto-match.dat +@value{FIXME:UNDOCUMENTED} @item --aux-date @itemx --effective @@ -6059,7 +6079,10 @@ Strings}). The default is: @end smallexample @item --base -FIX THIS ENTRY @c ASK JOHN +@c Report commodity in the base commodity s instead of h +@c Does this apply to other commodities too? +@c see test/baseline/opt-base.test/ +@value{FIXME:UNDOCUMENTED} @item --basis @itemx -B @@ -6109,7 +6132,7 @@ Consider only transactions that have been cleared for display and calculation. @item --cleared-format @var{FORMAT_STRING} -FIX THIS ENTRY @c FIXME thdox: to keep? +@c FIXME thdox: to keep? Specify the format to use for the @command{cleared} report (@pxref{Format Strings}). The default is: @@ -6178,8 +6201,11 @@ Specify the format ledger should use to read and print dates Specify the width, in characters, of the date column in the @command{register} report. -@item --datetime-format @var{FIXME} -FIX THIS ENTRY @c ASK JOHN +@item --datetime-format @var{DATETIME_FORMAT} +@c Specify the format ledger should use to print datetimes in +@c @command{balance} @option{--timelog-report} reports. +@c see test/baseline/opt-datetime-format.test +@value{FIXME:UNDOCUMENTED} @item --dc Display register or balance in debit/credit format If you use @@ -6287,7 +6313,7 @@ command}). Gives current account balances in the form of a register report. @item --exact -FIX THIS ENTRY @c ASK JOHN +@value{FIXME:UNDOCUMENTED} @item --exchange @var{COMMODITY} @itemx -X @var{COMMODITY} @@ -6365,10 +6391,10 @@ Print the first @var{INT} entries. Opposite of @option{--tail @item --historical @itemx -H -FIX THIS ENTRY @c FIXME thdox +@value{FIXME:UNDOCUMENTED} @item --immediate -FIX THIS ENTRY @c FIXME thdox +@value{FIXME:UNDOCUMENTED} @item --inject Use @code{Expected} amounts in calculations. In case you know @@ -6409,7 +6435,8 @@ Report the date and price at which each commodity was purchased in a balance report. @item --lots-actual -FIX THIS ENTRY +@c see test/baseline/opt-lots-actual.test +@value{FIXME:UNDOCUMENTED} @item --market @itemx -V @@ -6564,17 +6591,22 @@ Show all postings in a transaction, similar to @option{--related} but show both @emph{sides} of each transaction. @item --revalued -FIX THIS ENTRY +@c see test/baeline/opt-revalued.test +@value{FIXME:UNDOCUMENTED} @item --revalued-only -FIX THIS ENTRY +@c see test/baeline/opt-revalued-only.test +@value{FIXME:UNDOCUMENTED} @item --revalued-total @var{FIXME} -FIX THIS ENTRY +@value{FIXME:UNDOCUMENTED} @item --rich-data @itemx --detail -FIX THIS ENTRY @c FIXME thdox +@c When generating ledger transaction from csv using the convert command +@c add CSV, Imported, and UUID meta-data. +@c see test/baeline/opt-rich-data.test +@value{FIXME:UNDOCUMENTED} @item --seed @var{INT} Set the random seed to @var{INT} for the @code{generate} command. @@ -6585,8 +6617,8 @@ Used as part of development testing. Sort the @command{register} report based on the value expression given to sort. -@c @item --sort-all @var{FIXME} -@c FIX THIS ENTRY +@item --sort-all @var{FIXME} +@value{FIXME:UNDOCUMENTED} @item --sort-xacts @var{VEXPR} @itemx --period-sort @var{VEXPR} @@ -6599,7 +6631,7 @@ week. @item --subtotal @itemx -s -FIX THIS ENTRY +@value{FIXME:UNDOCUMENTED} @item --tail @var{INT} @itemx --last @var{INT} @@ -6607,7 +6639,9 @@ Report only the last @var{INT} entries. Only useful in a @command{register} report. @item --time-report -FIX THIS ENTRY @c FIXME thdox +@c Display begin and end time for each timelog entry in balance reports +@c see test/baseline/opt-time-report.test +@value{FIXME:UNDOCUMENTED} @item --total @var{VEXPR} @itemx -T @var{VEXPR} @@ -7614,6 +7648,7 @@ $ ledger --forecast "d<[2010]" bal ^assets ^liabilities @chapter Time Keeping @findex --day-break +@anchor{timelog} Ledger directly supports ``timelog'' entries, which have this form: @smallexample @c input:validate @@ -7945,8 +7980,6 @@ will match both all the three examples below: Expenses:Phone $-50.00 @end smallexample - - @item (EXPR) A sub-expression is nested in parenthesis. This can be useful passing more complicated arguments to functions, or for overriding the natural @@ -7974,61 +8007,337 @@ expect (@pxref{Pre-Commands}). @node Miscellaneous, , Complex expressions, Complex expressions @subsection Miscellaneous -@table @code -@item abs--> U -@item amount_expr -@item ansify_if -@item ceiling -Return the next integer toward +infinity -@item code -Return the transaction code, the string between the parenthesis after -the date. -@item commodity -@item date -@item display_amount --> t -@item display_total --> T -@item floor -Return the next integer toward -infinity -@item format -@item format_date -@item format_datetime -@item get_at -@item is_seq -@item join -@item justify -@item market --> P -@item nail_down -@item now --> d m -@item options -@item percent -@item print -@item quantity -@item quoted -@item round -@item rounded -@item roundto -Return value rounded to n digits. Does not affect formatting. -@item scrub -@item should_bold -@item strip --> S -@item to_amount -@item to_balance -@item to_boolean -@item to_date -@item to_datetime -@item to_int -@item to_mask -@item to_sequence -@item to_spring -@item today -@item top_amount -@item total_expr -@item trim -@item truncated -@item unround -@item unrounded -@item value_date -@end table +The following Ledger journal data (saved as @file{expr.dat}) is used to explain the behaviour of the +functions and variables below: +@anchor{expr.dat} +@smallexample @c input:3406FC1 +2015/01/16 * (C0D3) Payee + Assets:Cash ¤ -123,45 + ; Payee: PiggyBank + Expenses:Office Supplies +@end smallexample + +@defun abs value +@defunx U value +Return the absolute value of the given @var{value}, e.g. @var{amount}. +@end defun +@smallexample @c command:3406FC1 +$ ledger -f expr.dat --format "%(account) %(abs(amount))\n" reg assets +@end smallexample +@smallexample @c output:3406FC1 +Assets:Cash ¤ 123,45 +@end smallexample + +@defun amount_expr +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun ansify_if value color bool +Render the given @var{expression} as a string, applying the proper ANSI escape +codes to display it in the given @var{color} if @var{bool} is true. It +typically checks the value of the option @option{--color}. Since ANSI escape +codes include non-printable character sequences, such as escape @kbd{^[} +the following example may not appear as the final result on the commandline. +@end defun +@smallexample @c command:4D836EE,with_input:3406FC1 +$ ledger -f expr.dat --format "%(ansify_if(account, blue, options.color))\n" reg +@end smallexample +@smallexample @c output:4D836EE +Assets:Cash +Expenses:Office Supplies +@end smallexample + +@defun ceiling value +Return the next integer of @var{value} toward @math{+}infinity. +@end defun +@smallexample @c command:FF9C18C,with_input:3406FC1 +$ ledger -f expr.dat --format "%(account) %(ceiling(amount))\n" reg +@end smallexample +@smallexample @c output:FF9C18C +Assets:Cash ¤ -123,00 +Expenses:Office Supplies ¤ 124,00 +@end smallexample + +@defvar code +Return the transaction code, the string between the parenthesis after the date. +@smallexample @c command:46FCFD3,with_input:3406FC1 +$ ledger -f expr.dat --format "%(account) %(code)\n" reg assets +@end smallexample +@smallexample @c output:46FCFD3 +Assets:Cash C0D3 +@end smallexample +@end defvar + +@defvar commodity +Return the commodity of the posting amount. +@end defvar +@smallexample @c command:2CD27D7,with_input:3406FC1 +$ ledger -f expr.dat --format "%(account) %(commodity)\n" reg +@end smallexample +@smallexample @c output:2CD27D7 +Assets:Cash ¤ +Expenses:Office Supplies ¤ +@end smallexample + +@defvar date +Return the date of the posting. +@end defvar +@smallexample @c command:67EBA45,with_input:3406FC1 +$ ledger -f expr.dat --format "%(date) %(account)\n" reg assets +@end smallexample +@smallexample @c output:67EBA45 +2015/01/16 Assets:Cash +@end smallexample + +@defvar display_amount +@defvarx t +@value{FIXME:UNDOCUMENTED} +@end defvar + +@c FIXME +@defvar display_total +@defvarx T +@value{FIXME:UNDOCUMENTED} +@end defvar + +@defun floor value +Return the next integer of @var{value} toward @math{-}infinity. +@end defun +@smallexample @c command:4FDC7C5,with_input:3406FC1 +$ ledger -f expr.dat --format "%(account) %(floor(amount))\n" reg +@end smallexample +@smallexample @c output:4FDC7C5 +Assets:Cash ¤ -124,00 +Expenses:Office Supplies ¤ 123,00 +@end smallexample + +@defun format +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun format_date date format +Return the @var{date} as a string using @var{format}. See strftime (3) +for format string details. +@end defun +@smallexample @c command:9605B13,with_input:3406FC1 +$ ledger -f expr.dat --format "%(format_date(date, '%A, %B %d. %Y'))\n" reg assets +@end smallexample +@smallexample @c output:9605B13 +Friday, January 16. 2015 +@end smallexample + +@defun format_datetime +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun get_at +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun is_seq +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun join +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun justify value first_width latter_width right_justify colorize +Right or left justify the string representing @var{value}. The width +of the field in the first line is given by @var{first_width}. For +subsequent lines the width is given by @var{latter_width}. If +@var{latter_width=-1}, then @var{first_width} is use for all lines. +If @var{right_justify=true} then the field is right justify within +the width of the field. If it is @var{false}, then the field is left +justified and padded to the full width of the field. If +@var{colorize} is true, then ledger will honor color settings. +@end defun +@smallexample @c command:082FB27,with_input:3406FC1 +$ ledger -f expr.dat --format "»%(justify(account, 30, 30, true))«\n" reg +@end smallexample +@smallexample @c output:082FB27 +» Assets:Cash« +» Expenses:Office Supplies« +@end smallexample + +@defun market +@defunx P +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun nail_down +@value{FIXME:UNDOCUMENTED} +@end defun + +@defvar now +@defvarx d +@defvarx m +@value{FIXME:UNDOCUMENTED} +@end defvar + +@defvar options +A variable that allows access to the values of the given command-line options +using the long option names, e.g. to see whether @option{--daily} or @option{-D} +was given use @code{option.daily}. +@smallexample @c command:C1FC7A7,with_input:3406FC1 +$ ledger -f expr.dat -X $ -D --format "%(options.daily) %(options.exchange)\n" reg assets +@end smallexample +@smallexample @c output:C1FC7A7 +true $ +@end smallexample +@end defvar + +@defun percent value_a value_b +Return the percentage of @var{value_a} in relation to @var{value_b} (used as 100%) +@end defun +@smallexample @c command:04959BF,with_input:3406FC1 +$ ledger -f expr.dat --format "%(percent(amount, 200))\n" reg +@end smallexample +@smallexample @c output:04959BF +-61.73% +61.73% +@end smallexample + +@defun print +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun quantity +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun quoted expression +Surround @var{expression} with double-quotes. +@end defun +@smallexample @c command:EAD8AA7,with_input:3406FC1 +$ ledger -f expr.dat --format "%(quoted(account)) %(quoted(amount))\n" reg +@end smallexample +@smallexample @c output:EAD8AA7 +"Assets:Cash" "¤ -123,45" +"Expenses:Office Supplies" "¤ 123,45" +@end smallexample + +@defun round +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun rounded +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun roundto value n +Return @var{value} rounded to @var{n} digits. Does not affect formatting. +@end defun +@smallexample @c command:B4DFB9F,with_input:3406FC1 +$ ledger -f expr.dat --format "%(account) %(roundto(amount, 1))\n" reg +@end smallexample +@smallexample @c output:B4DFB9F +Assets:Cash ¤ -123,40 +Expenses:Office Supplies ¤ 123,50 +@end smallexample + +@defun scrub +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun should_bold +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun strip +@defunx S +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun to_amount +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun to_balance +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun to_boolean +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun to_date +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun to_datetime +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun to_int value +@defunx int value +Return the integer value for @var{value}. +@end defun +@smallexample @c command:0B0CBA1,with_input:3406FC1 +$ ledger -f expr.dat --format "%(1 + to_int('1'))\n%(2,5 + int(2,5))\n" reg assets +@end smallexample +@smallexample @c output:0B0CBA1 +2 +4.5 +@end smallexample + +@defun to_mask +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun to_sequence +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun to_string value +@defunx str value +Convert @var{value} to a character string. +@end defun + +@defvar today +Return today's date. +@end defvar +@smallexample @c command:F2FDF4B,with_input:3406FC1 +$ ledger -f expr.dat --now 2015/01/01 --format "%(today)\n" reg assets +@end smallexample +@smallexample @c output:F2FDF4B +2015/01/01 +@end smallexample + +@defun top_amount +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun total_expr +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun trim value +Trim leading and trailing whitespace from @var{value}. +@end defun +@smallexample @c command:377BBAB,with_input:3406FC1 +$ ledger -f expr.dat --format "»%(trim(' Trimmed '))«\n" reg assets +@end smallexample +@smallexample @c output:377BBAB +»Trimmed« +@end smallexample + +@defun truncated +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun unround +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun unrounded +@value{FIXME:UNDOCUMENTED} +@end defun + +@defun value_date +@value{FIXME:UNDOCUMENTED} +@end defun + @node Format Strings, Extending with Python, Value Expressions, Top @chapter Format Strings @@ -8115,12 +8424,19 @@ or an expression enclosed in parentheses or brackets. @findex --amount @var{EXPR} @findex --total @var{VEXPR} +For demonstration purposes the journal data from @ref{expr.dat} is used. The allowable expressions are: @table @code @item % Inserts a percent sign. +@smallexample @c command:6F90EFC,with_input:3406FC1 +$ ledger -f expr.dat --format "%%\n" reg assets +@end smallexample +@smallexample @c output:6F90EFC +% +@end smallexample @item t Inserts the results of the value expression specified by @@ -8138,6 +8454,12 @@ parentheses. To insert five times the total value of an account, for example, one could say @samp{%12(5*O)}. Note: It's important to put the five first in that expression, so that the commodity doesn't get stripped from the total. +@smallexample @c command:494256E,with_input:3406FC1 +$ ledger -f expr.dat --format "%12(5*O)\n" reg assets +@end smallexample +@smallexample @c output:494256E + ¤ -617,25 +@end smallexample @item [DATEFMT] Inserts the result of formatting a posting's date with a date @@ -8147,20 +8469,52 @@ example: @samp{%[%Y/%m/%d %H:%M:%S]}. @item S Insert the path name of the file from which the transaction's data was read. Only sensible in a @command{register} report. +@c Note: Unable to test this properly since the output depends on +@c where the ledger source tree resides in the filesystem. +@smallexample +$ ledger -f ~/journal.dat --format "%S\n" reg assets +@end smallexample +@smallexample +/home/jwiegley/journal.dat +@end smallexample @item B Inserts the beginning character position of that transaction within the file. +@smallexample @c command:2B669C9,with_input:3406FC1 +$ ledger -f expr.dat --format "%B\n" reg assets +@end smallexample +@smallexample @c output:2B669C9 +26 +@end smallexample @item b Inserts the beginning line of that transaction within the file. +@smallexample @c command:F6E356F,with_input:3406FC1 +$ ledger -f expr.dat --format "%b\n" reg assets +@end smallexample +@smallexample @c output:F6E356F +2 +@end smallexample @item E Inserts the ending character position of that transaction within the file. +@smallexample @c command:0E55246,with_input:3406FC1 +$ ledger -f expr.dat --format "%E\n" reg assets +@end smallexample +@smallexample @c output:0E55246 +90 +@end smallexample @item e Inserts the ending line of that transaction within the file. +@smallexample @c command:A26F4C0,with_input:3406FC1 +$ ledger -f expr.dat --format "%e\n" reg assets +@end smallexample +@smallexample @c output:A26F4C0 +3 +@end smallexample @item D Returns the date according to the default format. @@ -8179,9 +8533,23 @@ character if all of the member postings have the same state. @item C Inserts the transaction code. This is the value specified between parentheses on the first line of the transaction. +@smallexample @c command:C1CAAF3,with_input:3406FC1 +$ ledger -f expr.dat --format "%C\n" reg assets +@end smallexample +@c Note: The output needs a space character at the end +@c for this test to pass +@smallexample @c output:C1CAAF3 +(C0D3) +@end smallexample @item P Inserts the payee related to a posting. +@smallexample @c command:F41A9BB,with_input:3406FC1 +$ ledger -f expr.dat --format "%P\n" reg assets +@end smallexample +@smallexample @c output:F41A9BB +PiggyBank +@end smallexample @c @item a @c Inserts the optimal short name for an account. This is normally @@ -8191,6 +8559,13 @@ Inserts the payee related to a posting. @item A Inserts the full name of an account. +@smallexample @c command:29A70DD,with_input:3406FC1 +$ ledger -f expr.dat --format "%A\n" reg +@end smallexample +@smallexample @c output:29A70DD +Assets:Cash +Expenses:Office Supplies +@end smallexample @c @item W @c This is the same as @code{%A}, except that it first displays the @@ -8207,12 +8582,25 @@ Inserts the full name of an account. @item N Inserts the note associated with a posting, if one exists. +@smallexample @c command:E6DC93A,with_input:3406FC1 +$ ledger -f expr.dat --format "%N\n" reg assets +@end smallexample +@smallexample @c output:E6DC93A + Payee: PiggyBank +@end smallexample @item / The @samp{%/} construct is special. It separates a format string between what is printed for the first posting of a transaction, and what is printed for all subsequent postings. If not used, the same format string is used for all postings. +@smallexample @c command:E80897D,with_input:3406FC1 +$ ledger -f expr.dat --format "%P\n%/%A\n" reg +@end smallexample +@smallexample @c output:E80897D +PiggyBank +Expenses:Office Supplies +@end smallexample @end table @@ -9323,7 +9711,7 @@ slowdown. When combined with @option{--debug @var{CODE}} ledger will produce memory trace information. @item --verify-memory -FIX THIS ENTRY @c FIXME thdox +@value{FIXME:UNDOCUMENTED} @item --version Print version information and exit. @@ -9421,7 +9809,7 @@ true @end smallexample @item script -FIX THIS ENTRY @c FIXME thdox +@value{FIXME:UNDOCUMENTED} @item template Shows the insertion template that the @command{xact} sub-command @@ -9706,11 +10094,23 @@ to the main body of the documentation. @node Invoking Ledger, Ledger Files, Cookbook, Cookbook @subsection Invoking Ledger -@smallexample + +@smallexample @c command:validate $ ledger --group-by "tag('trip')" bal -$ ledger reg --sort "tag('foo')" %foo +@end smallexample +@c FIXME: The following example fails to validate due to: +@c While applying is_realzero to : +@c Error: Cannot determine if an uninitialized value is really zero +@c @smallexample @c command:validate +@c $ ledger reg --sort "tag('foo')" %foo +@c @end smallexample +@smallexample @c command:validate $ ledger cleared VWCU NFCU Tithe Misentry +@end smallexample +@smallexample @c command:validate $ ledger register Joint --uncleared +@end smallexample +@smallexample @c command:validate $ ledger register Checking --sort d -d 'd>[2011/04/01]' until 2011/05/25 @end smallexample -- cgit v1.2.3 From 217193608ac818b33c034d013ca08e1c43afe090 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Fri, 23 Jan 2015 15:51:40 +0100 Subject: [doc] Use specific example to explain environment vars [ci skip] --- doc/ledger3.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index b98664f9..080fc3eb 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -7442,8 +7442,8 @@ BTC:USD}. @subsection Environment variables Every option to ledger may be set using an environment variable. If -an option has a long name such @option{--this-option}, setting the -environment variable @env{LEDGER_THIS_OPTION} will have the same +an option has a long name, for example @option{--account}, setting the +environment variable @env{LEDGER_ACCOUNT} will have the same effect as specifying that option on the command-line. Options on the command-line always take precedence over environment variable settings, however. -- cgit v1.2.3 From 11a01f1b5aeff063740edfbe99dba35003237551 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Tue, 27 Jan 2015 11:55:08 +0100 Subject: [doc] Report undocumented value expression functions in the manpage and texinfo manual. --- doc/ledger3.texi | 22 +++++++++++----------- test/CheckManpage.py | 1 + test/CheckOptions.py | 48 ++++++++++++++++++++++++++++++++++++++---------- test/CheckTexinfo.py | 41 +++++++++++++++++++++++++++++++++++++++-- 4 files changed, 89 insertions(+), 23 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 080fc3eb..a2a93c98 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -8020,13 +8020,13 @@ functions and variables below: @defun abs value @defunx U value Return the absolute value of the given @var{value}, e.g. @var{amount}. -@end defun @smallexample @c command:3406FC1 $ ledger -f expr.dat --format "%(account) %(abs(amount))\n" reg assets @end smallexample @smallexample @c output:3406FC1 Assets:Cash ¤ 123,45 @end smallexample +@end defun @defun amount_expr @value{FIXME:UNDOCUMENTED} @@ -8038,7 +8038,6 @@ codes to display it in the given @var{color} if @var{bool} is true. It typically checks the value of the option @option{--color}. Since ANSI escape codes include non-printable character sequences, such as escape @kbd{^[} the following example may not appear as the final result on the commandline. -@end defun @smallexample @c command:4D836EE,with_input:3406FC1 $ ledger -f expr.dat --format "%(ansify_if(account, blue, options.color))\n" reg @end smallexample @@ -8046,10 +8045,10 @@ $ ledger -f expr.dat --format "%(ansify_if(account, blue, options.color))\n" reg Assets:Cash Expenses:Office Supplies @end smallexample +@end defun @defun ceiling value Return the next integer of @var{value} toward @math{+}infinity. -@end defun @smallexample @c command:FF9C18C,with_input:3406FC1 $ ledger -f expr.dat --format "%(account) %(ceiling(amount))\n" reg @end smallexample @@ -8057,6 +8056,7 @@ $ ledger -f expr.dat --format "%(account) %(ceiling(amount))\n" reg Assets:Cash ¤ -123,00 Expenses:Office Supplies ¤ 124,00 @end smallexample +@end defun @defvar code Return the transaction code, the string between the parenthesis after the date. @@ -8102,7 +8102,6 @@ $ ledger -f expr.dat --format "%(date) %(account)\n" reg assets @defun floor value Return the next integer of @var{value} toward @math{-}infinity. -@end defun @smallexample @c command:4FDC7C5,with_input:3406FC1 $ ledger -f expr.dat --format "%(account) %(floor(amount))\n" reg @end smallexample @@ -8110,6 +8109,7 @@ $ ledger -f expr.dat --format "%(account) %(floor(amount))\n" reg Assets:Cash ¤ -124,00 Expenses:Office Supplies ¤ 123,00 @end smallexample +@end defun @defun format @value{FIXME:UNDOCUMENTED} @@ -8118,13 +8118,13 @@ Expenses:Office Supplies ¤ 123,00 @defun format_date date format Return the @var{date} as a string using @var{format}. See strftime (3) for format string details. -@end defun @smallexample @c command:9605B13,with_input:3406FC1 $ ledger -f expr.dat --format "%(format_date(date, '%A, %B %d. %Y'))\n" reg assets @end smallexample @smallexample @c output:9605B13 Friday, January 16. 2015 @end smallexample +@end defun @defun format_datetime @value{FIXME:UNDOCUMENTED} @@ -8151,7 +8151,6 @@ If @var{right_justify=true} then the field is right justify within the width of the field. If it is @var{false}, then the field is left justified and padded to the full width of the field. If @var{colorize} is true, then ledger will honor color settings. -@end defun @smallexample @c command:082FB27,with_input:3406FC1 $ ledger -f expr.dat --format "»%(justify(account, 30, 30, true))«\n" reg @end smallexample @@ -8159,6 +8158,7 @@ $ ledger -f expr.dat --format "»%(justify(account, 30, 30, true))«\n" reg » Assets:Cash« » Expenses:Office Supplies« @end smallexample +@end defun @defun market @defunx P @@ -8189,7 +8189,6 @@ true $ @defun percent value_a value_b Return the percentage of @var{value_a} in relation to @var{value_b} (used as 100%) -@end defun @smallexample @c command:04959BF,with_input:3406FC1 $ ledger -f expr.dat --format "%(percent(amount, 200))\n" reg @end smallexample @@ -8197,6 +8196,7 @@ $ ledger -f expr.dat --format "%(percent(amount, 200))\n" reg -61.73% 61.73% @end smallexample +@end defun @defun print @value{FIXME:UNDOCUMENTED} @@ -8208,7 +8208,6 @@ $ ledger -f expr.dat --format "%(percent(amount, 200))\n" reg @defun quoted expression Surround @var{expression} with double-quotes. -@end defun @smallexample @c command:EAD8AA7,with_input:3406FC1 $ ledger -f expr.dat --format "%(quoted(account)) %(quoted(amount))\n" reg @end smallexample @@ -8216,6 +8215,7 @@ $ ledger -f expr.dat --format "%(quoted(account)) %(quoted(amount))\n" reg "Assets:Cash" "¤ -123,45" "Expenses:Office Supplies" "¤ 123,45" @end smallexample +@end defun @defun round @value{FIXME:UNDOCUMENTED} @@ -8227,7 +8227,6 @@ $ ledger -f expr.dat --format "%(quoted(account)) %(quoted(amount))\n" reg @defun roundto value n Return @var{value} rounded to @var{n} digits. Does not affect formatting. -@end defun @smallexample @c command:B4DFB9F,with_input:3406FC1 $ ledger -f expr.dat --format "%(account) %(roundto(amount, 1))\n" reg @end smallexample @@ -8235,6 +8234,7 @@ $ ledger -f expr.dat --format "%(account) %(roundto(amount, 1))\n" reg Assets:Cash ¤ -123,40 Expenses:Office Supplies ¤ 123,50 @end smallexample +@end defun @defun scrub @value{FIXME:UNDOCUMENTED} @@ -8272,7 +8272,6 @@ Expenses:Office Supplies ¤ 123,50 @defun to_int value @defunx int value Return the integer value for @var{value}. -@end defun @smallexample @c command:0B0CBA1,with_input:3406FC1 $ ledger -f expr.dat --format "%(1 + to_int('1'))\n%(2,5 + int(2,5))\n" reg assets @end smallexample @@ -8280,6 +8279,7 @@ $ ledger -f expr.dat --format "%(1 + to_int('1'))\n%(2,5 + int(2,5))\n" reg asse 2 4.5 @end smallexample +@end defun @defun to_mask @value{FIXME:UNDOCUMENTED} @@ -8314,13 +8314,13 @@ $ ledger -f expr.dat --now 2015/01/01 --format "%(today)\n" reg assets @defun trim value Trim leading and trailing whitespace from @var{value}. -@end defun @smallexample @c command:377BBAB,with_input:3406FC1 $ ledger -f expr.dat --format "»%(trim(' Trimmed '))«\n" reg assets @end smallexample @smallexample @c output:377BBAB »Trimmed« @end smallexample +@end defun @defun truncated @value{FIXME:UNDOCUMENTED} diff --git a/test/CheckManpage.py b/test/CheckManpage.py index 6b0f2476..944f4e07 100755 --- a/test/CheckManpage.py +++ b/test/CheckManpage.py @@ -17,6 +17,7 @@ class CheckManpage (CheckOptions): def __init__(self, args): CheckOptions.__init__(self, args) self.option_pattern = '\.It Fl \\\\-([-A-Za-z]+)' + self.function_pattern = '\.It Fn ([-A-Za-z_]+)' self.source_file = join(self.source, 'doc', 'ledger.1') self.source_type = 'manpage' diff --git a/test/CheckOptions.py b/test/CheckOptions.py index 124ce197..5059a289 100755 --- a/test/CheckOptions.py +++ b/test/CheckOptions.py @@ -22,16 +22,21 @@ class CheckOptions (object): self.ledger = os.path.abspath(args.ledger) self.source = os.path.abspath(args.source) - self.missing_baseline_tests = set() self.missing_options = set() self.unknown_options = set() + self.missing_functions = set() + self.unknown_functions = set() - def find_options(self, filename): - regex = re.compile(self.option_pattern) + def find_pattern(self, filename, pattern): + regex = re.compile(pattern) return {match.group(1) for match in {regex.match(line) for line in open(filename)} if match} + def find_options(self, filename): + return self.find_pattern(filename, self.option_pattern) + + def find_functions(self, filename): + return self.find_pattern(filename, self.function_pattern) def find_alternates(self): - regex = re.compile(r'OPT_ALT\([^,]*,\s*([^)]+?)_?\)'); command = shlex.split('grep --no-filename OPT_ALT') for source_file in ['session', 'report']: command.append(os.path.join(self.source, 'src', '%s.cc' % source_file)) @@ -39,6 +44,8 @@ class CheckOptions (object): output = subprocess.check_output(command).split('\n'); except subprocess.CalledProcessError: output = '' + + regex = re.compile(r'OPT_ALT\([^,]*,\s*([^)]+?)_?\)'); alternates = {match.group(1).replace('_', '-') for match in {regex.search(line) for line in output} if match} return alternates @@ -49,22 +56,43 @@ class CheckOptions (object): ledger_options = {match.group(1).replace('_', '-') for match in {regex.search(line.decode()) for line in pipe.stderr} if match} return ledger_options + def ledger_functions(self): + command = shlex.split('grep --no-filename fn_ %s' % (os.path.join(self.source, 'src', 'report.h'))) + try: + output = subprocess.check_output(command).split('\n'); + except subprocess.CalledProcessError: + output = '' + + regex = re.compile(r'fn_([^(]+)\('); + functions = {match.group(1) for match in {regex.search(line) for line in output} if match} + return functions + def main(self): options = self.find_options(self.source_file) - for option in self.ledger_options(): if option not in options: self.missing_options.add(option) else: options.remove(option) - known_alternates = self.find_alternates() self.unknown_options = {option for option in options if option not in known_alternates} + functions = self.find_functions(self.source_file) + for function in self.ledger_functions(): + if function not in functions: + self.missing_functions.add(function) + else: + functions.remove(function) + known_functions = ['tag', 'has_tag'] + self.unknown_functions = {function for function in functions if function not in known_functions} + if len(self.missing_options): - print("Missing %s entries for:%s%s\n" % (self.source_type, self.sep, self.sep.join(sorted(list(self.missing_options))))) + print("Missing %s option entries for:%s%s\n" % (self.source_type, self.sep, self.sep.join(sorted(list(self.missing_options))))) if len(self.unknown_options): - print("%s entry for unknown options:%s%s" % (self.source_type, self.sep, self.sep.join(sorted(list(self.unknown_options))))) - - errors = len(self.missing_options) + len(self.unknown_options) + print("%s entry for unknown options:%s%s\n" % (self.source_type, self.sep, self.sep.join(sorted(list(self.unknown_options))))) + if len(self.missing_functions): + print("Missing %s function entries for:%s%s\n" % (self.source_type, '\n ', '\n '.join(sorted(list(self.missing_functions))))) + if len(self.unknown_functions): + print("%s entry for unknown functions:%s%s\n" % (self.source_type, '\n ', '\n '.join(sorted(list(self.unknown_functions))))) + errors = len(self.missing_options) + len(self.unknown_options) + len(self.missing_functions) + len(self.unknown_functions) return errors diff --git a/test/CheckTexinfo.py b/test/CheckTexinfo.py index 34d0e153..cd167eba 100755 --- a/test/CheckTexinfo.py +++ b/test/CheckTexinfo.py @@ -16,10 +16,47 @@ from CheckOptions import CheckOptions class CheckTexinfo (CheckOptions): def __init__(self, args): CheckOptions.__init__(self, args) - self.option_pattern = '@item --([-A-Za-z]+).*@c option' + self.option_pattern = '^@item\s+--([-A-Za-z]+)' + self.function_pattern = '^@defun\s+([-A-Za-z_]+)' self.source_file = join(self.source, 'doc', 'ledger3.texi') self.source_type = 'texinfo' + + def find_functions(self, filename): + functions = set() + state_normal = 0 + state_function = 1 + state = state_normal + function = None + fun_doc = str() + fun_example = False + item_regex = re.compile(self.function_pattern) + itemx_regex = re.compile('^@defunx') + example_regex = re.compile('^@smallexample\s+@c\s+command:') + fix_regex = re.compile('FIX') + comment_regex = re.compile('^\s*@c') + for line in open(filename): + line = line.strip() + if state == state_normal: + match = item_regex.match(line) + if match: + state = state_function + function = match.group(1) + elif state == state_function: + if line == '@end defun': + if function and fun_example and len(fun_doc) and not fix_regex.search(fun_doc): + functions.add(function) + state = state_normal + fun_example = None + fun_doc = str() + elif itemx_regex.match(line): + continue + elif example_regex.match(line): + fun_example = True + elif not comment_regex.match(line): + fun_doc += line + return functions + def find_options(self, filename): options = set() state_normal = 0 @@ -27,7 +64,7 @@ class CheckTexinfo (CheckOptions): state = state_normal option = None opt_doc = str() - item_regex = re.compile('^@item --([-A-Za-z]+)') + item_regex = re.compile(self.option_pattern) itemx_regex = re.compile('^@itemx') fix_regex = re.compile('FIX') comment_regex = re.compile('^\s*@c') -- cgit v1.2.3 From 7c9750edcaf5ead362736c2993f121409ee9c290 Mon Sep 17 00:00:00 2001 From: thdox Date: Wed, 28 Jan 2015 23:13:05 +0100 Subject: Remove back-link from option to section "balance assertions". Add forward-link from section to option. Add option to @findex --- doc/ledger3.texi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index a2a93c98..e199181d 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -3120,6 +3120,7 @@ the amount expression with parentheses: @node Balance verification, Posting cost, Expression amounts, Transactions @section Balance verification +@findex --permissive @menu * Balance assertions:: @@ -3131,7 +3132,7 @@ the amount expression with parentheses: If at the end of a posting's amount (and after the cost too, if there is one) there is an equals sign, then Ledger will verify that the total value for that account as of that posting matches the amount -specified. +specified. See @option{--permissive} option to relax the balance assertions checks. There are two forms of this features: balance assertions, and balance assignments. @@ -5957,7 +5958,7 @@ Ledger does not expand any aliases if this option is specified. Accounts, tags or commodities not previously declared will cause errors. @item --permissive -Quiet @ref{Balance assertions, balance assertions}. +Quiet balance assertions. @item --price-db @var{FILE} Specify the location of the price entry data file. -- cgit v1.2.3 From bc487be14bd1a79cbbedb9203921b357ced79ef7 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Thu, 29 Jan 2015 16:23:48 +0100 Subject: [doc] Improve example for environment variable options [ci skip] --- doc/ledger.1 | 15 +++++++-------- doc/ledger3.texi | 13 ++++++------- 2 files changed, 13 insertions(+), 15 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger.1 b/doc/ledger.1 index 2374971b..67c24470 100644 --- a/doc/ledger.1 +++ b/doc/ledger.1 @@ -1291,14 +1291,13 @@ was parsed. See the section on .Sh ENVIRONMENT Every option to .Nm -may be set using an environment variable. If -an option has a long name, for example -.Fl \-account , -setting the environment variable -.Ev LEDGER_ACCOUNT -will have the same effect as specifying that option on the command-line. -Options on the command-line always take precedence over environment variable -settings, however. +may be set using an environment variable if the option has a long name. +For example setting the environment variable +.Ev LEDGER_DATE_FORMAT="%d.%m.%Y' +will have the same effect as specifying +.Fl \-date-format Ar '%d.%m.%Y' +on the command-line. Options on the command-line always take precedence over +environment variable settings, however. .Sh FILES .Bl -tag -width -indent .It Pa ~/.ledgerrc diff --git a/doc/ledger3.texi b/doc/ledger3.texi index e199181d..08d0d2db 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -7442,15 +7442,14 @@ BTC:USD}. @node Environment variables, , Commodity reporting, Detailed Option Description @subsection Environment variables -Every option to ledger may be set using an environment variable. If -an option has a long name, for example @option{--account}, setting the -environment variable @env{LEDGER_ACCOUNT} will have the same -effect as specifying that option on the command-line. Options on the -command-line always take precedence over environment variable -settings, however. +Every option to ledger may be set using an environment variable if the +option has a long name. For example setting the environment variable +@samp{@env{LEDGER_DATE_FORMAT}="%d.%m.%Y"} will have the same effect as specifying +@samp{@option{--date-format} '%d.%m.%Y'} on the command-line. Options on the +command-line always take precedence over environment variable settings, however. Note that you may also permanently specify option values by placing -option settings in the file @file{~/.ledgerrc}, for example: +option settings in the file @file{~/.ledgerrc} one option per line, for example: @smallexample --pager /bin/cat -- cgit v1.2.3