I am confused why %D and %[] don't work in the --format here:

Contents of test.ledger

2012/01/01  Testing
   Unearned Income:Test  $-500.00
   Assets:Checking       $500.00

$ ledger --version
Ledger 3.0.0-20120518, the command-line accounting tool

$ ledger --format "%[%Y/%m/%d] %-.10C  %-.80P  %-.80N  %18t  %18T\n" -f 
test.ledger reg 'Assets:Checking'
Error: Unrecognized formatting character: [

$ ledger --format "%D %-.10C  %-.80P  %-.80N  %18t  %18T\n" -f test.ledger reg 
'Assets:Checking'
Error: Unrecognized formatting character: D

$ ledger -y '%Y/%m/%d' --format '%D\n' -f test.ledger reg 'Assets:Checking'
Error: Unrecognized formatting character: D


Removing any reference to date, it works:

$ ledger --format "%-.10C  %-.80P  %-.80N  %18t  %18T\n" -f test.ledger reg 
'Assets:Checking'
(null)      Testing                                                             
              (null)                                                            
                           $500.00             $500.00

ledger3.texi says:

   @item [DATEFMT]
   ... For example: @samp{%[%Y/%m/%d %H:%M:%S]}.
   ...
   @item D
   By default, this is the same as @samp{%[%Y/%m%/d]}.

What am I doing wrong?


BTW, another related problem, ledger3.texi says:

   @item C
   Inserts the checking number for a transaction, in parentheses, followed by
   a space; if none was specified, nothing is inserted.

But, instead as seen above, (null) is inserted.

Same is sort of true for N:

   @item N
   Inserts the note associated with a posting, if one exists.



-- 
   -- bkuhn

Reply via email to