From a4b1e7c5ab70fc846b0ec4762f2e9f8ee242ca11 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 11 Nov 2009 02:01:24 -0500 Subject: Added a --prepend-format option This lets you, for example, debug registers that cull data from many different sources, without having to change the basic formatting string. You can locate each posting's location with this: ledger reg --prepend-format='%-25(filename + ":" + beg_line)' --- src/output.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/output.h') diff --git a/src/output.h b/src/output.h index fedd08ff..778a9335 100644 --- a/src/output.h +++ b/src/output.h @@ -60,13 +60,15 @@ protected: format_t first_line_format; format_t next_lines_format; format_t between_format; + format_t prepend_format; xact_t * last_xact; post_t * last_post; bool print_raw; public: format_posts(report_t& _report, const string& format, - bool _print_raw = false); + bool _print_raw = false, + const optional& _prepend_format = none); virtual ~format_posts() { TRACE_DTOR(format_posts); } @@ -82,12 +84,14 @@ protected: format_t account_line_format; format_t total_line_format; format_t separator_format; + format_t prepend_format; predicate_t disp_pred; std::list posted_accounts; public: - format_accounts(report_t& _report, const string& _format); + format_accounts(report_t& _report, const string& _format, + const optional& _prepend_format = none); virtual ~format_accounts() { TRACE_DTOR(format_accounts); } -- cgit v1.2.3