summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-04 20:46:45 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-04 20:46:45 -0400
commit7d628d88ff54ac08df499406bb87b87c3f8989a3 (patch)
treedff9bc75f6830425754a0bdc011a28b7c291bde5 /src
parent863b5d814443eb791c2dd07250ac0ae29054adb0 (diff)
downloadfork-ledger-7d628d88ff54ac08df499406bb87b87c3f8989a3.tar.gz
fork-ledger-7d628d88ff54ac08df499406bb87b87c3f8989a3.tar.bz2
fork-ledger-7d628d88ff54ac08df499406bb87b87c3f8989a3.zip
Moved the --pager option to the session object, rather than the report object.
Diffstat (limited to 'src')
-rw-r--r--src/report.cc2
-rw-r--r--src/report.h6
-rw-r--r--src/session.cc5
-rw-r--r--src/session.h6
-rw-r--r--src/work.cc2
5 files changed, 12 insertions, 9 deletions
diff --git a/src/report.cc b/src/report.cc
index 6a75632d..de13d048 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -403,8 +403,6 @@ expr_t::ptr_op_t report_t::lookup(const string& name)
return MAKE_FUNCTOR(report_t::option_price);
else if (std::strcmp(p, "price_db_") == 0)
return MAKE_FUNCTOR(report_t::option_price_db_);
- else if (std::strcmp(p, "pager_") == 0)
- return MAKE_FUNCTOR(report_t::option_pager_);
break;
case 'q':
diff --git a/src/report.h b/src/report.h
index e7e2ac0e..ff7d1343 100644
--- a/src/report.h
+++ b/src/report.h
@@ -151,7 +151,6 @@ public:
keep_details_t what_to_keep;
string account;
- optional<path> pager_path;
bool raw_mode;
@@ -450,11 +449,6 @@ public:
return true;
}
- value_t option_pager_(call_scope_t& args) { // :
- pager_path = args[0].as_string();
- return true;
- }
-
#if 0
value_t option_truncate(call_scope_t& args) { // :
std::string style(optarg);
diff --git a/src/session.cc b/src/session.cc
index 25acd821..64c320e9 100644
--- a/src/session.cc
+++ b/src/session.cc
@@ -385,6 +385,11 @@ expr_t::ptr_op_t session_t::lookup(const string& name)
return MAKE_FUNCTOR(session_t::option_file_);
break;
+ case 'p':
+ if (std::strcmp(p, "pager_") == 0)
+ return MAKE_FUNCTOR(session_t::option_pager_);
+ break;
+
case 't':
if (std::strcmp(p, "trace_") == 0)
return MAKE_FUNCTOR(session_t::option_trace_);
diff --git a/src/session.h b/src/session.h
index 3c441ef1..c7633a88 100644
--- a/src/session.h
+++ b/src/session.h
@@ -71,6 +71,7 @@ public:
optional<path> init_file;
optional<path> cache_file;
optional<path> price_db;
+ optional<path> pager_path;
bool next_price_db_from_command_line;
bool saw_price_db_from_command_line;
@@ -234,6 +235,11 @@ See LICENSE file included with the distribution for details and disclaimer.";
data_files.push_back(args[0].as_string());
return true;
}
+
+ value_t option_pager_(call_scope_t& args) { // :
+ pager_path = args[0].as_string();
+ return true;
+ }
};
/**
diff --git a/src/work.cc b/src/work.cc
index e4cee9e6..06dae001 100644
--- a/src/work.cc
+++ b/src/work.cc
@@ -225,7 +225,7 @@ void normalize_report_options(report_t& report, const string& verb)
void create_output_stream(report_t& report)
{
- report.output_stream.initialize(report.output_file, report.pager_path);
+ report.output_stream.initialize(report.output_file, report.session.pager_path);
}
void invoke_command_verb(report_t& report,