summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-01-14 23:19:55 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:40:49 -0400
commitb697424b440d72fa3bf6b5533eb814f9f02bf452 (patch)
tree3aeb297981efc1ced7af5b560e9409e97d4eba61
parentfdac1f14e9004727f55598cdaf3647c519cfb005 (diff)
downloadfork-ledger-b697424b440d72fa3bf6b5533eb814f9f02bf452.tar.gz
fork-ledger-b697424b440d72fa3bf6b5533eb814f9f02bf452.tar.bz2
fork-ledger-b697424b440d72fa3bf6b5533eb814f9f02bf452.zip
(parse): Added "D" directive to ledger files, which allows the user to
specify which commodity is used for the default when none is specified or calculated by the "entry" command.
-rw-r--r--textual.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/textual.cc b/textual.cc
index 33b7971b..c15b7701 100644
--- a/textual.cc
+++ b/textual.cc
@@ -389,6 +389,11 @@ unsigned int textual_parser_t::parse(std::istream& in,
break;
#endif // TIMELOG_SUPPORT
+ case 'D': // a default commodity for "entry"
+ commodity_t::default_commodity =
+ commodity_t::find_commodity(skip_ws(line + 1), true);
+ break;
+
case 'C': // a set of conversions
if (char * p = std::strchr(line + 1, '=')) {
*p++ = '\0';