summaryrefslogtreecommitdiff
path: root/src/report.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-06-21 19:06:07 +0100
committerJohn Wiegley <johnw@newartisans.com>2009-06-21 19:06:07 +0100
commit8cb80185d515fe158a1858dd832ff9bc0f96e4a0 (patch)
tree51a29c09cb0b928bde19e389ec5cada3c83e753d /src/report.h
parentc1307445c1ca691ef2d4df53d8b36c6ba6639d45 (diff)
downloadfork-ledger-8cb80185d515fe158a1858dd832ff9bc0f96e4a0.tar.gz
fork-ledger-8cb80185d515fe158a1858dd832ff9bc0f96e4a0.tar.bz2
fork-ledger-8cb80185d515fe158a1858dd832ff9bc0f96e4a0.zip
Restored the --truncate option, added baseline test
Diffstat (limited to 'src/report.h')
-rw-r--r--src/report.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/report.h b/src/report.h
index 45d4f11a..5a9fb8a5 100644
--- a/src/report.h
+++ b/src/report.h
@@ -52,6 +52,7 @@
#include "stream.h"
#include "option.h"
#include "commodity.h"
+#include "format.h"
namespace ledger {
@@ -755,18 +756,18 @@ public:
OPTION(report_t, total_data);
- OPTION_(report_t, truncate_, DO() {
-#if 0
+ OPTION_(report_t, truncate_, DO_(args) {
string style(args[1].to_string());
if (style == "leading")
- format_t::elision_style = format_t::TRUNCATE_LEADING;
+ format_t::default_style = format_t::TRUNCATE_LEADING;
else if (style == "middle")
- format_t::elision_style = format_t::TRUNCATE_MIDDLE;
+ format_t::default_style = format_t::TRUNCATE_MIDDLE;
else if (style == "trailing")
- format_t::elision_style = format_t::TRUNCATE_TRAILING;
- else if (style == "abbrev")
- format_t::elision_style = format_t::ABBREVIATE;
-#endif
+ format_t::default_style = format_t::TRUNCATE_TRAILING;
+ else
+ throw_(std::invalid_argument,
+ _("Unrecognized truncation style: '%1'") << style);
+ format_t::default_style_changed = true;
});
OPTION_(report_t, unbudgeted, DO() {