summaryrefslogtreecommitdiff
path: root/src/session.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-06-02 19:14:46 +0100
committerJohn Wiegley <johnw@newartisans.com>2009-06-02 19:14:46 +0100
commitc79fd9e72de4c2355ddb867bf269973bdd2cfd00 (patch)
treed5dcc657961a3d1b6cfee3d49e7f5169b44fc13b /src/session.h
parente2092d07d85079215a0e068eb46c0d41bbd28a54 (diff)
downloadfork-ledger-c79fd9e72de4c2355ddb867bf269973bdd2cfd00.tar.gz
fork-ledger-c79fd9e72de4c2355ddb867bf269973bdd2cfd00.tar.bz2
fork-ledger-c79fd9e72de4c2355ddb867bf269973bdd2cfd00.zip
Added new debug option --options
This reports which options are in place before invoking a command, and where exactly each option value came from.
Diffstat (limited to 'src/session.h')
-rw-r--r--src/session.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/session.h b/src/session.h
index 1d700d1b..10e5b758 100644
--- a/src/session.h
+++ b/src/session.h
@@ -108,6 +108,17 @@ public:
return CURRENT_DATE();
}
+ void report_options(std::ostream& out)
+ {
+ HANDLER(account_).report(out);
+ HANDLER(download).report(out);
+ HANDLER(leeway_).report(out);
+ HANDLER(file_).report(out);
+ HANDLER(input_date_format_).report(out);
+ HANDLER(price_db_).report(out);
+ HANDLER(strict).report(out);
+ }
+
option_t<session_t> * lookup_option(const char * p);
virtual expr_t::ptr_op_t lookup(const string& name);
@@ -123,7 +134,7 @@ public:
(session_t, leeway_,
CTOR(session_t, leeway_) { value = 24L * 3600L; }
DO_(args) {
- value = args[0].to_long() * 60L;
+ value = args[1].to_long() * 60L;
});
OPTION__
@@ -131,12 +142,12 @@ public:
std::list<path> data_files;
CTOR(session_t, file_) {}
DO_(args) {
- assert(args.size() == 1);
+ assert(args.size() == 2);
if (parent->flush_on_next_data_file) {
data_files.clear();
parent->flush_on_next_data_file = false;
}
- data_files.push_back(args[0].as_string());
+ data_files.push_back(args[1].as_string());
});
OPTION(session_t, input_date_format_);