summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/ledger.11
-rw-r--r--src/session.cc2
-rw-r--r--src/session.h3
-rw-r--r--test/baseline/opt-value-expr.test0
4 files changed, 6 insertions, 0 deletions
diff --git a/doc/ledger.1 b/doc/ledger.1
index a948d5a6..a8e5dcc4 100644
--- a/doc/ledger.1
+++ b/doc/ledger.1
@@ -424,6 +424,7 @@ appeared in the original journal file.
.It Fl \-unrealized-gains
.It Fl \-unrealized-losses
.It Fl \-unround
+.It Fl \-value-expr Ar EXPR
.It Fl \-verbose
.It Fl \-verify
.It Fl \-version
diff --git a/src/session.cc b/src/session.cc
index 7c546b82..d0cd4573 100644
--- a/src/session.cc
+++ b/src/session.cc
@@ -112,6 +112,8 @@ std::size_t session_t::read_data(const string& master_account)
journal->checking_style = journal_t::CHECK_ERROR;
else if (HANDLED(strict))
journal->checking_style = journal_t::CHECK_WARNING;
+ else if (HANDLED(value_expr))
+ journal->value_expr = HANDLER(value_expr).str();
#if defined(HAVE_BOOST_SERIALIZATION)
optional<archive_t> cache;
diff --git a/src/session.h b/src/session.h
index cb981346..f2b1dbef 100644
--- a/src/session.h
+++ b/src/session.h
@@ -61,6 +61,7 @@ public:
unique_ptr<journal_t> journal;
parse_context_stack_t parsing_context;
+ optional<expr_t> value_expr;
explicit session_t();
virtual ~session_t() {
@@ -107,6 +108,7 @@ public:
HANDLER(price_db_).report(out);
HANDLER(price_exp_).report(out);
HANDLER(strict).report(out);
+ HANDLER(value_expr).report(out);
}
option_t<session_t> * lookup_option(const char * p);
@@ -154,6 +156,7 @@ public:
OPTION(session_t, permissive);
OPTION(session_t, price_db_);
OPTION(session_t, strict);
+ OPTION(session_t, value_expr);
};
/**
diff --git a/test/baseline/opt-value-expr.test b/test/baseline/opt-value-expr.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-value-expr.test