Added --value-expr option

This commit is contained in:
John Wiegley 2012-03-09 20:11:38 -06:00
parent 2df8edc71c
commit 022059f2a8
4 changed files with 6 additions and 0 deletions

View file

@ -424,6 +424,7 @@ appeared in the original journal file.
.It Fl \-unrealized-gains .It Fl \-unrealized-gains
.It Fl \-unrealized-losses .It Fl \-unrealized-losses
.It Fl \-unround .It Fl \-unround
.It Fl \-value-expr Ar EXPR
.It Fl \-verbose .It Fl \-verbose
.It Fl \-verify .It Fl \-verify
.It Fl \-version .It Fl \-version

View file

@ -112,6 +112,8 @@ std::size_t session_t::read_data(const string& master_account)
journal->checking_style = journal_t::CHECK_ERROR; journal->checking_style = journal_t::CHECK_ERROR;
else if (HANDLED(strict)) else if (HANDLED(strict))
journal->checking_style = journal_t::CHECK_WARNING; journal->checking_style = journal_t::CHECK_WARNING;
else if (HANDLED(value_expr))
journal->value_expr = HANDLER(value_expr).str();
#if defined(HAVE_BOOST_SERIALIZATION) #if defined(HAVE_BOOST_SERIALIZATION)
optional<archive_t> cache; optional<archive_t> cache;

View file

@ -61,6 +61,7 @@ public:
unique_ptr<journal_t> journal; unique_ptr<journal_t> journal;
parse_context_stack_t parsing_context; parse_context_stack_t parsing_context;
optional<expr_t> value_expr;
explicit session_t(); explicit session_t();
virtual ~session_t() { virtual ~session_t() {
@ -107,6 +108,7 @@ public:
HANDLER(price_db_).report(out); HANDLER(price_db_).report(out);
HANDLER(price_exp_).report(out); HANDLER(price_exp_).report(out);
HANDLER(strict).report(out); HANDLER(strict).report(out);
HANDLER(value_expr).report(out);
} }
option_t<session_t> * lookup_option(const char * p); option_t<session_t> * lookup_option(const char * p);
@ -154,6 +156,7 @@ public:
OPTION(session_t, permissive); OPTION(session_t, permissive);
OPTION(session_t, price_db_); OPTION(session_t, price_db_);
OPTION(session_t, strict); OPTION(session_t, strict);
OPTION(session_t, value_expr);
}; };
/** /**

View file