diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-29 23:32:29 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-08-29 23:32:29 -0400 |
commit | 63367e3aac062a7b55a3ba5c36a6c7fffbb6e2cc (patch) | |
tree | 6af161c7d0a7ca78a26f8b1f1f57426acddf9be9 /main.cc | |
parent | 2d62f7b633bdaa39c650bb67425514cf1e66a4dd (diff) | |
download | fork-ledger-63367e3aac062a7b55a3ba5c36a6c7fffbb6e2cc.tar.gz fork-ledger-63367e3aac062a7b55a3ba5c36a6c7fffbb6e2cc.tar.bz2 fork-ledger-63367e3aac062a7b55a3ba5c36a6c7fffbb6e2cc.zip |
the amount/balance/value logic is now a library, completely separate from ledger
Diffstat (limited to 'main.cc')
-rw-r--r-- | main.cc | 27 |
1 files changed, 9 insertions, 18 deletions
@@ -335,8 +335,8 @@ int parse_and_report(int argc, char * argv[], char * envp[]) if (command == "b") { format_account acct_formatter(out, config.format, config.display_predicate); - sum_accounts(journal->master); - walk_accounts(journal->master, acct_formatter, config.sort_order.get()); + sum_accounts(*journal->master); + walk_accounts(*journal->master, acct_formatter, config.sort_order.get()); acct_formatter.flush(); if (journal->master->data) { @@ -344,15 +344,15 @@ int parse_and_report(int argc, char * argv[], char * envp[]) if (ACCT_DATA(journal->master)->dflags & ACCOUNT_TO_DISPLAY) { out << "--------------------\n"; - config.format.format_elements(out, details_t(journal->master)); + config.format.format_elements(out, details_t(*journal->master)); } } } else if (command == "E") { format_equity acct_formatter(out, config.format, config.nformat, config.display_predicate); - sum_accounts(journal->master); - walk_accounts(journal->master, acct_formatter, config.sort_order.get()); + sum_accounts(*journal->master); + walk_accounts(*journal->master, acct_formatter, config.sort_order.get()); acct_formatter.flush(); } @@ -363,7 +363,7 @@ int parse_and_report(int argc, char * argv[], char * envp[]) walk_entries(journal->entries, xact_cleanup); clear_account_data acct_cleanup; - walk_accounts(journal->master, acct_cleanup); + walk_accounts(*journal->master, acct_cleanup); #endif TIMER_STOP(report_gen); @@ -384,25 +384,16 @@ int parse_and_report(int argc, char * argv[], char * envp[]) int main(int argc, char * argv[], char * envp[]) { - int status = 0; - - initialize(); - try { - status = parse_and_report(argc, argv, envp); + return parse_and_report(argc, argv, envp); } catch (error& err) { std::cerr << "Error: " << err.what() << std::endl; - status = 1; + return 1; } catch (int& val) { - status = val; + return val; // this acts like a std::setjmp } - -#if DEBUG_LEVEL >= BETA - shutdown(); -#endif - return status; } // main.cc ends here. |