Commit graph

31 commits

Author SHA1 Message Date
John Wiegley
394c7bd8df Removed a bunch of empty comments 2009-11-08 14:59:11 -05:00
John Wiegley
78e6770c4c Segregated symbols into 5 separate namespaces
The different namespaces are:

  Function      Value expression functions, which receive a "context"
  Option        Command-line options
  Precommand    Commands which are invoked before reading the journal
  Command       Commands which are invoked after reading the journal
  Directive     Directives that occur at column 0 in a data file

This greatly eases the ability for Python uses to add intercept hooks to
change how the basic Ledger module functions.  An example of what should
be possible soon:

  import ledger

  def my_foo_handler(value):
      print "--foo received:", value

  ledger.add_handler(ledger.Option, "foo=", my_foo_handler)
2009-11-04 20:40:48 -05:00
John Wiegley
4a14f3224b Added value_t::push_front 2009-11-04 20:40:45 -05:00
John Wiegley
4427016b1b Improved arg checking for several valexpr functions 2009-10-31 04:07:33 -04:00
John Wiegley
55f5868380 Setting --date-format in ~/.ledgerrc works again 2009-10-29 00:52:51 -04:00
John Wiegley
588f2ef2f5 Fixed many compiler warnings from g++ 4.4 2009-10-25 05:01:39 -04:00
John Wiegley
d0c47b1bc2 Added debug code "option.names"
Use "--debug option.names" to see all accepted (internal) option names.
2009-06-27 01:48:41 +01:00
John Wiegley
c79fd9e72d Added new debug option --options
This reports which options are in place before invoking a command, and
where exactly each option value came from.
2009-06-02 19:14:46 +01:00
John Wiegley
c11d325712 Reduced the #include dependency tree to a minimum 2009-03-04 23:53:43 -04:00
John Wiegley
238bd7f8a5 Marked all strings needing internationalization
These strings are now collected automagically in the file po/ledger.pot.
If you'd like to produce a translation, just run this command after
building Ledger:

    msginit -l LOCALE -o LANG.po -i po/ledger.pot

Where LOCALE is a string like de or en_GB, and LANG is a short
descriptive word for your language.

Then send me this .po file so I can commit it to the Ledger sources
(alternatively, you could maintain the file in a fork on GitHub), and
setup the build script to format and install your new message catalog
during a "make install".
2009-02-25 03:51:42 -04:00
John Wiegley
ac8e27a4b8 Added a new --depth option 2009-02-25 01:15:53 -04:00
John Wiegley
ea75613760 --exchange option now accepts multiple commodities
They must be separated by a comma, and all whitespace is ignored.
2009-02-22 17:51:11 -04:00
John Wiegley
39bdbbe053 The sequence -M -p 2004 now equals -p 2004 -M 2009-02-19 14:26:08 -04:00
John Wiegley
b9624df86b If an option has been handled, return its value 2009-02-19 01:32:27 -04:00
John Wiegley
5dc8f6bccb Report better errors if options are missing args 2009-02-16 17:30:34 -04:00
John Wiegley
b7f2a95c1f Accept --first/--last as synonyms for --head/--tail 2009-02-16 17:25:19 -04:00
John Wiegley
d0a664d102 Fixed several unused value and param warnings 2009-02-16 16:55:18 -04:00
John Wiegley
780ce4a5d0 Normalized handling of several report options 2009-02-15 21:14:54 -04:00
John Wiegley
5290b6e8aa If an option was given no value, throw an error
The previous behavior was to trigger a confusing assertion.
2009-02-14 04:35:22 -04:00
John Wiegley
bedadd03a0 option_t's copy constructor wasn't copying "wants_arg".
This was causing "reg -p this" to fail in the REPL.
2009-02-10 05:06:16 -04:00
John Wiegley
76ab8cc083 Fixed an issue where --amount EXPR wasn't seeing that it had been "handled". 2009-02-09 00:02:40 -04:00
John Wiegley
ea9330adae Allow value expressions to gain access to option settings.
For example, "ledger eval options.limit" prints 0 (for false), but:
"ledger -l hello eval options.limit" print "hello"s, since the value of
options.limit, once set to a value, is that string.  For flag options,
such as -Y, eval prints 0 if unset, and 1 if set.

This feature allows value expressions to be conditionalized based on the
presence of user options.
2009-02-07 05:47:21 -04:00
John Wiegley
71258f1fe9 Fixed a problem that was causing -l EXPR to trigger on assertion. 2009-02-07 04:55:42 -04:00
John Wiegley
eb98e0da8b More revision to the way options are handled; reworked CSV command. 2009-02-07 04:26:30 -04:00
John Wiegley
73cf3b01fb Added structural support in main() for using a REPL. 2009-02-04 19:55:08 -04:00
John Wiegley
2a0f8d5099 Fixed a misspelled parameter name. 2009-02-02 17:55:41 -04:00
John Wiegley
9540406af1 Simplified error context handling. 2009-02-02 00:24:26 -04:00
John Wiegley
1ece3f8b1c Added documentation stubs for all include files and classes. 2009-01-31 15:28:23 -04:00
John Wiegley
0b9f22b4d2 Redid the way command-line arguments are processed. Before, Ledger used - and
-- to mean special things after the command verb was seen.  But now, what used
to be specified as this:

  ledger -n reg cash -payable -- shell

Is now specified as this:

  ledger reg -n cash not payable @shell

It could also be specified as:

  ledger -n reg \(cash and not payable\) and @shell
2009-01-22 16:27:24 -04:00
John Wiegley
887828a40c Increased copyright range to include 2009. 2009-01-20 01:53:31 -04:00
John Wiegley
f6f4a46cf5 Moved around most of the files so that source code is in src/, documentation
is in doc/, etc.
2008-08-05 18:05:49 -04:00
Renamed from option.h (Browse further)