summaryrefslogtreecommitdiff
path: root/src/session.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-19 22:36:08 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-19 22:36:08 -0400
commitf2f52066d2a9c82619ffea0f3972e48417a90b5b (patch)
tree3390b046e383309c4845be29dcf1d44c258c6d56 /src/session.cc
parent2694335e54316606ab169e957034ba71e8274144 (diff)
downloadfork-ledger-f2f52066d2a9c82619ffea0f3972e48417a90b5b.tar.gz
fork-ledger-f2f52066d2a9c82619ffea0f3972e48417a90b5b.tar.bz2
fork-ledger-f2f52066d2a9c82619ffea0f3972e48417a90b5b.zip
Added a --strict session option
When enabled, if any accounts or commodities are seen in an uncleared transaction, which were not seen previously in a cleared or pending transaction or a textual directive dealing with accounts or commodities, a warning is generated about the unknown item.
Diffstat (limited to 'src/session.cc')
-rw-r--r--src/session.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/session.cc b/src/session.cc
index 1e2dfb64..7a3ecf19 100644
--- a/src/session.cc
+++ b/src/session.cc
@@ -84,7 +84,8 @@ std::size_t session_t::read_journal(std::istream& in,
{
if (! master)
master = journal->master;
- std::size_t count = journal->parse(in, *this, master, &pathname);
+ std::size_t count = journal->parse(in, *this, master, &pathname,
+ HANDLED(strict));
clean_accounts(); // remove calculated totals
return count;
}
@@ -220,6 +221,9 @@ option_t<session_t> * session_t::lookup_option(const char * p)
case 'p':
OPT(price_db_);
break;
+ case 's':
+ OPT(strict);
+ break;
case 'Q':
OPT_CH(download); // -Q
break;