diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-31 03:07:15 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-31 03:07:15 -0400 |
commit | b0f12c600c8080d11d8f514aa7d4149323da6803 (patch) | |
tree | 1d295ceb2b49308184848a754d8572bb2376de41 /src/filters.cc | |
parent | 451b0e9b767d67cb116549b6fb508ace83af7d60 (diff) | |
download | fork-ledger-b0f12c600c8080d11d8f514aa7d4149323da6803.tar.gz fork-ledger-b0f12c600c8080d11d8f514aa7d4149323da6803.tar.bz2 fork-ledger-b0f12c600c8080d11d8f514aa7d4149323da6803.zip |
Added a --forecast-years option
This sets how many years of forecasting Ledger will do before it
terminates the attempt.
Diffstat (limited to 'src/filters.cc')
-rw-r--r-- | src/filters.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/filters.cc b/src/filters.cc index 814cf276..fe8761a5 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -871,9 +871,11 @@ void forecast_posts::flush() date_t next = *(*least).first.next; assert(next > begin); - if ((next - last).days() > 365 * 5) { + if (static_cast<std::size_t>((next - last).days()) > + static_cast<std::size_t>(365U) * forecast_years) { DEBUG("filters.forecast", - "Forecast transaction exceeds 5 years beyond today"); + "Forecast transaction exceeds " << forecast_years + << " years beyond today"); pending_posts.erase(least); continue; } |