summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-02-09 05:04:49 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:40:54 -0400
commitd8f35f3152aae177bf0848f6e1e1429600730bb1 (patch)
tree0820aa4275976614bb8cceb9a4919f21d8f159a5
parent9c60361e176241da4448c4f5a55822c39820a99a (diff)
downloadfork-ledger-d8f35f3152aae177bf0848f6e1e1429600730bb1.tar.gz
fork-ledger-d8f35f3152aae177bf0848f6e1e1429600730bb1.tar.bz2
fork-ledger-d8f35f3152aae177bf0848f6e1e1429600730bb1.zip
(parse_and_report): Added new "reconcile" and "output" commands.
Likely not to be documented, as these are intended primarily for future GUI development.
-rw-r--r--main.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/main.cc b/main.cc
index 5139ae37..e7748914 100644
--- a/main.cc
+++ b/main.cc
@@ -238,6 +238,8 @@ int parse_and_report(int argc, char * argv[], char * envp[])
command = "r";
else if (command == "print" || command == "p")
command = "p";
+ else if (command == "output")
+ command = "w";
else if (command == "xml")
command = "X";
else if (command == "entry")
@@ -246,6 +248,8 @@ int parse_and_report(int argc, char * argv[], char * envp[])
command = "E";
else if (command == "prices")
command = "P";
+ else if (command == "reconcile")
+ command = "R";
else
throw error(std::string("Unrecognized command '") + command + "'");
@@ -297,12 +301,14 @@ int parse_and_report(int argc, char * argv[], char * envp[])
format = &config.format_string;
else if (command == "b")
format = &config.balance_format;
- else if (command == "r")
+ else if (command == "r" || command == "R")
format = &config.register_format;
else if (command == "E")
format = &config.equity_format;
else if (command == "P")
format = &config.prices_format;
+ else if (command == "w")
+ format = &config.write_xact_format;
else
format = &config.print_format;
@@ -354,6 +360,10 @@ def vmax(d, val):\n\
walk_transactions(new_entry->transactions, *formatter);
else if (command == "P")
walk_commodities(commodity_t::commodities, *formatter);
+ else if (command == "R")
+ reconcile_account(*journal, *journal->master, value_t(long(0)));
+ else if (command == "w")
+ write_textual_journal(*journal, *arg, *formatter, *out);
else
walk_entries(journal->entries, *formatter);