summaryrefslogtreecommitdiff
path: root/main.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-09-24 06:29:01 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-09-24 06:29:01 -0400
commitd110df6741d3732634beb287b94afd0dbff52b7b (patch)
treeba98061a35baaafd2f90c52ccdc2b2aa9ba17559 /main.cc
parent2f16a8213264a9428b31228373a5aae7605f5575 (diff)
downloadfork-ledger-d110df6741d3732634beb287b94afd0dbff52b7b.tar.gz
fork-ledger-d110df6741d3732634beb287b94afd0dbff52b7b.tar.bz2
fork-ledger-d110df6741d3732634beb287b94afd0dbff52b7b.zip
added a custom transaction formatter, format_entries, used by "print"
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/main.cc b/main.cc
index 8e827212..f1dbeff4 100644
--- a/main.cc
+++ b/main.cc
@@ -248,13 +248,14 @@ int parse_and_report(int argc, char * argv[], char * envp[])
item_handler<transaction_t> * formatter;
std::list<item_handler<transaction_t> *> formatter_ptrs;
- if (command == "b" || command == "E") {
+ if (command == "b" || command == "E")
formatter = new set_account_value;
- formatter = chain_formatters(command, formatter, formatter_ptrs);
- } else {
+ else if (command == "p")
+ formatter = new format_entries(*out, *format);
+ else
formatter = new format_transactions(*out, *format);
- formatter = chain_formatters(command, formatter, formatter_ptrs);
- }
+
+ formatter = chain_formatters(command, formatter, formatter_ptrs);
if (command == "e")
walk_transactions(new_entry->transactions, *formatter);