Commit graph

1836 commits

Author SHA1 Message Date
John Wiegley
f2e4f4c6d1 By default, build Ledger with the included gettext 2009-02-22 17:41:01 -04:00
John Wiegley
9e0d66610c Renamed acconf.h to config.h, for included gettext 2009-02-22 16:21:22 -04:00
John Wiegley
81f57ecc41 Correctly accept "false" as a keyword 2009-02-22 04:51:11 -04:00
John Wiegley
e124811d8a Added --exchange (-x) option
This is like -V, except it lets you specify the goal commodity to report
in terms of, for example:

    reg -x CAD
2009-02-22 04:51:11 -04:00
John Wiegley
04fd1ae24c Fixed the way values are justified for printing 2009-02-22 04:51:11 -04:00
John Wiegley
640279c65d Allow balances to be rounded and unrounded 2009-02-22 04:51:11 -04:00
John Wiegley
3e543d187c Changed --colors to --color, to match Git 2009-02-22 04:51:11 -04:00
John Wiegley
2d56d9bc3a Added more option baseline tests 2009-02-22 04:51:11 -04:00
John Wiegley
cebc1da256 Restored the --invert option 2009-02-22 04:51:08 -04:00
John Wiegley
3c5b5fbc0a Fix for systems that don't build with gettext 2009-02-22 01:40:45 -04:00
John Wiegley
348aae7478 Removed unused --totals option
This option was for outputting <total> elements in 2.x's XML output.
2009-02-22 01:29:34 -04:00
John Wiegley
ff68783348 Added more option baseline tests 2009-02-21 22:04:41 -04:00
John Wiegley
eb4aa87843 Added a new --colors option, for terminal fun
The following colors are applied in the balance and register reports:

    GREEN   To a date, if it occurs in the future
    BOLD    If a payee name relates to an uncleared entry
    BLUE    For account names
    RED     For negative values
2009-02-21 22:04:01 -04:00
John Wiegley
8ca91c1196 Allow balance values to be compared < or > 0 2009-02-21 22:00:00 -04:00
John Wiegley
018c812fda Fixed a bug with interactive_t's arg validation 2009-02-21 21:58:53 -04:00
John Wiegley
c6d2420d09 Fixed an accumulator bug that was mangling errors 2009-02-21 21:57:55 -04:00
John Wiegley
4b159527a5 Removed a bash-ism from acprep 2009-02-21 21:51:22 -04:00
John Wiegley
6f6c0d722c And more README updates 2009-02-21 21:08:28 -04:00
John Wiegley
bafb6af93c More README updates 2009-02-21 21:05:23 -04:00
John Wiegley
c57467bee7 Updated dependencies in the README 2009-02-21 20:59:05 -04:00
John Wiegley
57f349ef2e Added excludes necessary for tools/pre-commit 2009-02-21 20:53:38 -04:00
John Wiegley
c7cf9ef0ff Added variant baseline tests relating to --empty 2009-02-21 20:52:51 -04:00
John Wiegley
b902894284 Added support for using GNU gettext 2009-02-21 20:21:13 -04:00
John Wiegley
66c5cd4427 Use a "format accumulator" for error strings
This makes it possible to internationalize strings while still using
I/O streams.  For example:

    std::cout << ACCUM(_("Hello to %1 and %2!") << "me" << "you")
              << std::endl;
2009-02-21 20:20:57 -04:00
John Wiegley
a577e8c48e Added a new --raw option, for use with print 2009-02-21 19:45:13 -04:00
John Wiegley
dc63429785 Removed an unused class: format_entries 2009-02-21 19:22:55 -04:00
John Wiegley
20a3ba0d21 Fixes to tools/myacprep 2009-02-21 19:19:34 -04:00
John Wiegley
6b9c83b156 Use more general scrub valexpr function in formats 2009-02-21 19:05:30 -04:00
Jesse Alama
509f4505fc Bury the report buffer after quitting. 2009-02-21 18:54:35 -04:00
John Wiegley
1f39d4148e Create a new interactive_t helper class
The purpose of this class is much like Emacs' (interactive) form: it
allows a value expression function to declare exactly how many
arguments, and of what type, it intends to receive.  It then offers
type-safe access to theese arguments in a consistent manner.

An example value expression function definition in C++:

    value_t fn_foo(call_scope_t& scope) {
      // We expect a string, an integer, and an optional date
      interactive_t args(scope, "sl&d");

      std::cout << "String  = " << args.get<string>(0)
                << "Integer = " << args.get<long>(1) << std::endl;

      if (args.has(2)) // was a date provided?
        std::cout << "Date    = " << args.get<date_t>(2) << std::endl;

      return NULL_VALUE;
    }

There is also an in_context_t<T> template, which finds the context type
T in the current scope hierarchy.  The in_context_t then also acts as a
smart pointer to reference this context object, in addition to serving
the same duty as interactive_t.  This combination of intent is solely
for the sake of brevity.

    value_t fn_bar(call_scope_t& scope) {
      in_context_t<account_t> env(scope, "sl&d");
      std::cout << "Account name = " << env->fullname()
                << "String arg   = " << env.get<string>(0)
                << std::endl;
      return NULL_VALUE;
    }

As you can see here, 'env' acts as a smart pointer to the required
context, and an object to extract the typed arguments.
2009-02-21 18:49:43 -04:00
John Wiegley
45e41b023a Added all current value expressions to man page 2009-02-21 16:51:35 -04:00
John Wiegley
c2b9d5ea73 Fixed a script typo 2009-02-21 16:51:07 -04:00
John Wiegley
f4b270a1b8 acprep --gprof now passes -g -pg to the linker 2009-02-21 16:46:59 -04:00
John Wiegley
3ab52e74b1 Tools changes to build for multiple targets
This makes it easier for me to build a version of ledger with
optimizations, one for coverage analysis, one for profiling, etc.
2009-02-21 16:45:19 -04:00
John Wiegley
3d326956ef Improved the pre-commit hook 2009-02-21 16:27:32 -04:00
John Wiegley
067f512e94 The --help (-h, -H) options now visit the man page 2009-02-21 16:24:10 -04:00
John Wiegley
37097e6008 Added an automake rule for installing the man page 2009-02-21 14:34:48 -04:00
John Wiegley
5c80c459cc Made --leeway a synonym for --price-exp 2009-02-21 14:31:54 -04:00
John Wiegley
dcb53e67dc Began creation of an Nroff-formatted man page 2009-02-21 14:30:19 -04:00
John Wiegley
014a4bdbf3 Run regression and baseline tests using --verify 2009-02-21 04:12:52 -04:00
John Wiegley
6548da04cd Fixed another memory bug in by_payee_xacts 2009-02-21 04:12:10 -04:00
John Wiegley
aeea1cb3e1 Fixed a memory leak in value_t::storage_t 2009-02-21 03:48:02 -04:00
John Wiegley
5d50d895bf Added several more baseline tests 2009-02-21 02:24:41 -04:00
John Wiegley
7bede3ac76 Fixed the spelling of some option exceptions 2009-02-21 02:23:06 -04:00
John Wiegley
f4e13f3458 Added --start-of-week option, used with --weekly
For example, --start-of-week=monday can be used to report weeks that
begin on Mondays.
2009-02-21 02:20:08 -04:00
John Wiegley
13812346b6 Handle reporting widths that are too small 2009-02-21 02:17:03 -04:00
John Wiegley
d0ac3a2e4e Added a new --exact option
The purpose of this option is that usually when you do a --monthly
periodic report, you see dates ranges from the first day of each month,
to the last day.  With --exact, the first day of each range will be the
date of the first transaction found in that range, and likewise with the
end of the range.  Essentially it "contracts" the reported period dates
to reflect the exact begin and end dates.
2009-02-21 02:14:53 -04:00
John Wiegley
a93111470d Greatly improved the way "weeks" are iterated 2009-02-21 02:10:02 -04:00
John Wiegley
4ff8087815 Restored the --deviation option 2009-02-21 00:48:12 -04:00
John Wiegley
4fe4a33bf8 Justify integers correctly when printing 2009-02-21 00:45:54 -04:00