summaryrefslogtreecommitdiff
path: root/src/session.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-08-13 03:12:25 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-08-13 03:12:25 -0400
commitb588dc4caf3e4a00460fb3e0f6524e6e44bf3d23 (patch)
tree07cf2eea21e0534c63ea7992e1bbdc489d69f418 /src/session.cc
parentb134a98e1e86bed00f291c1eb2b6505b4d9a6b64 (diff)
downloadfork-ledger-b588dc4caf3e4a00460fb3e0f6524e6e44bf3d23.tar.gz
fork-ledger-b588dc4caf3e4a00460fb3e0f6524e6e44bf3d23.tar.bz2
fork-ledger-b588dc4caf3e4a00460fb3e0f6524e6e44bf3d23.zip
Changed the default output date format in register reports from 2008-08-13 to
08-Aug-13. This allows for the account name to be one character wider, while the century was never significant in people's minds, whereas the change in months between two transactions sometimes is.
Diffstat (limited to 'src/session.cc')
-rw-r--r--src/session.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/session.cc b/src/session.cc
index fea379d6..232773dc 100644
--- a/src/session.cc
+++ b/src/session.cc
@@ -71,12 +71,12 @@ void release_session_context()
session_t::session_t()
: register_format
- ("%-.10D %-.20P %-.22A %!12(print_balance(fmt_t, 12, 67)) "
+ ("%-.9D %-.20P %-.23A %!12(print_balance(fmt_t, 12, 67)) "
"%!12(print_balance(fmt_T, 12, 80, true))\n%/"
"%32|%-.22A %!12(print_balance(fmt_t, 12, 67)) "
"%!12(print_balance(fmt_T, 12, 80, true))\n"),
wide_register_format
- ("%-.10D %-.35P %-.38A %22.108t %!22.132T\n%/"
+ ("%-.9D %-.35P %-.39A %22.108t %!22.132T\n%/"
"%48|%-.38A %22.108t %!22.132T\n"),
print_format
("\n%d %Y%C%P\n %-34W %12o%n\n%/ %-34W %12o%n\n"),
@@ -161,7 +161,12 @@ void session_t::read_init()
ifstream init(*init_file);
- // jww (2006-09-15): Read initialization options here!
+ journal_t temp(this);
+ if (read_journal(temp, *init_file) > 0 ||
+ temp.auto_entries.size() > 0 ||
+ temp.period_entries.size() > 0)
+ throw_(parse_error, "Entries found in initialization file '" <<
+ init_file << "'");
}
std::size_t session_t::read_data(journal_t& journal,
@@ -174,6 +179,8 @@ std::size_t session_t::read_data(journal_t& journal,
std::size_t entry_count = 0;
+ read_init();
+
DEBUG("ledger.cache", "3. use_cache = " << use_cache);
if (use_cache && cache_file) {