summaryrefslogtreecommitdiff
path: root/reports.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-04-04 23:59:20 +0000
committerJohn Wiegley <johnw@newartisans.com>2004-04-04 23:59:20 +0000
commit42a1c0396865a7e606b9d0b35fee7aaa3ebf7166 (patch)
tree6811657dc08c2eb2b098b282c957283794005355 /reports.cc
parentf672024e06b7b03c2a9287bf75faf375955fa791 (diff)
downloadfork-ledger-42a1c0396865a7e606b9d0b35fee7aaa3ebf7166.tar.gz
fork-ledger-42a1c0396865a7e606b9d0b35fee7aaa3ebf7166.tar.bz2
fork-ledger-42a1c0396865a7e606b9d0b35fee7aaa3ebf7166.zip
*** empty log message ***
Diffstat (limited to 'reports.cc')
-rw-r--r--reports.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/reports.cc b/reports.cc
index d9efac2b..9827367e 100644
--- a/reports.cc
+++ b/reports.cc
@@ -1,13 +1,13 @@
#include "ledger.h"
-#define LEDGER_VERSION "1.2"
+#define LEDGER_VERSION "1.3"
#include <fstream>
#include <unistd.h>
namespace ledger {
-static bool show_cleared = false;
+static bool cleared_only = false;
static bool show_virtual = true;
static bool get_quotes = false;
static bool show_children = false;
@@ -105,7 +105,7 @@ void report_balances(std::ostream& out, regexps_map& regexps)
for (entries_list_iterator i = main_ledger->entries.begin();
i != main_ledger->entries.end();
i++) {
- if ((show_cleared && ! (*i)->cleared) || ! matches_date_range(*i))
+ if ((cleared_only && ! (*i)->cleared) || ! matches_date_range(*i))
continue;
for (std::list<transaction *>::iterator x = (*i)->xacts.begin();
@@ -203,7 +203,7 @@ void print_register(const std::string& acct_name, std::ostream& out,
i != main_ledger->entries.end();
i++) {
if ((! have_beginning && ! have_ending && ! have_date_mask &&
- ! show_cleared && (*i)->cleared) ||
+ ! (cleared_only ? (*i)->cleared : ! (*i)->cleared)) ||
! matches_date_range(*i) || ! (*i)->matches(regexps))
continue;
@@ -374,7 +374,7 @@ void add_new_entry(int index, int argc, char **argv)
std::exit(1);
}
- added.cleared = show_cleared;
+ added.cleared = cleared_only;
if (index == argc) {
std::cerr << "Error: Too few arguments to 'entry'." << std::endl;
@@ -591,7 +591,7 @@ int main(int argc, char * argv[])
case 'h': show_help(std::cout); break;
case 'f': file = new std::ifstream(optarg); break;
- case 'C': show_cleared = true; break;
+ case 'C': cleared_only = true; break;
case 'R': show_virtual = false; break;
case 's': show_children = true; break;
case 'S': show_sorted = true; break;
@@ -718,7 +718,7 @@ int main(int argc, char * argv[])
else if (command == "print") {
if (show_sorted)
main_ledger->sort(cmp_entry_date());
- main_ledger->print(std::cout, regexps, true);
+ main_ledger->print(std::cout, regexps, ! full_names);
}
else if (command == "equity") {
equity_ledger(std::cout, regexps);