summaryrefslogtreecommitdiff
path: root/src/global.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-06-24 02:44:07 +0100
committerJohn Wiegley <johnw@newartisans.com>2009-06-24 02:44:07 +0100
commit440124eacc9f7fde993e87968ca9e65ffa309f11 (patch)
treec86839186bee5c4951ad98491d02625e9c276669 /src/global.cc
parent72a2eaa38e68b886a567da2afda8f08b1929e3b6 (diff)
downloadfork-ledger-440124eacc9f7fde993e87968ca9e65ffa309f11.tar.gz
fork-ledger-440124eacc9f7fde993e87968ca9e65ffa309f11.tar.bz2
fork-ledger-440124eacc9f7fde993e87968ca9e65ffa309f11.zip
Restored --download, although not done yet
The problem at this point is that it's recording prices in the price database multiple times; it should only need to download a price for each commodity once per day.
Diffstat (limited to 'src/global.cc')
-rw-r--r--src/global.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/global.cc b/src/global.cc
index e8c6f17d..5d5e5836 100644
--- a/src/global.cc
+++ b/src/global.cc
@@ -415,10 +415,21 @@ void global_scope_t::normalize_report_options(const string& verb)
report_t& rep(report());
- // jww (2009-02-09): These global are a hack, but hard to avoid.
+ // jww (2009-02-09): These globals are a hack, but hard to avoid.
item_t::use_effective_date = rep.HANDLED(effective);
rep.session.commodity_pool->keep_base = rep.HANDLED(base);
+ commodity_t::download_quotes = rep.session.HANDLED(download);
+
+ if (rep.session.HANDLED(price_exp_))
+ commodity_t::download_leeway =
+ rep.session.HANDLER(price_exp_).value.as_long();
+
+ if (rep.session.HANDLED(price_db_))
+ commodity_t::price_db = rep.session.HANDLER(price_db_).str();
+ else
+ commodity_t::price_db = none;
+
if (rep.HANDLED(date_format_)) {
output_datetime_format = rep.HANDLER(date_format_).str() + " %H:%M:%S";
output_date_format = rep.HANDLER(date_format_).str();