summaryrefslogtreecommitdiff
path: root/main.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-11 23:03:54 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-11 23:03:54 -0400
commit69c587681ab297141925d5a898b4d9b875516fd5 (patch)
tree384bb6ce5bf8bb7a7986f043b10f07584b607cdc /main.cc
parenta77c20a7723c66ac1deca94410bb97859df871cd (diff)
downloadfork-ledger-69c587681ab297141925d5a898b4d9b875516fd5.tar.gz
fork-ledger-69c587681ab297141925d5a898b4d9b875516fd5.tar.bz2
fork-ledger-69c587681ab297141925d5a898b4d9b875516fd5.zip
more reorg
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/main.cc b/main.cc
index da705d29..a25a525a 100644
--- a/main.cc
+++ b/main.cc
@@ -524,7 +524,7 @@ int main(int argc, char * argv[])
if (! show_empty)
display_predicate = "T";
- if (! show_expanded) {
+ if (! show_expanded && predicate.empty()) {
if (! display_predicate.empty())
display_predicate += "&";
display_predicate += "!n";
@@ -602,8 +602,13 @@ int main(int argc, char * argv[])
format_account acct_formatter(std::cout, format, display_predicate);
- walk_accounts(journal->master, acct_formatter, show_subtotals,
- sort_order.get());
+ if (show_subtotals)
+ sum_accounts(journal->master);
+
+ if (sort_order.get())
+ walk_accounts(journal->master, acct_formatter, sort_order.get());
+ else
+ walk_accounts(journal->master, acct_formatter);
if (format_account::disp_subaccounts_p(journal->master)) {
std::string end_format = "--------------------\n";
@@ -617,7 +622,12 @@ int main(int argc, char * argv[])
format_equity acct_formatter(std::cout, format, nformat,
display_predicate);
- walk_accounts(journal->master, acct_formatter, true, sort_order.get());
+ sum_accounts(journal->master);
+
+ if (sort_order.get())
+ walk_accounts(journal->master, acct_formatter, sort_order.get());
+ else
+ walk_accounts(journal->master, acct_formatter);
}
else if (command == "e") {
format_transactions formatter(std::cout, format, nformat);