From f6c2e3d51eb8cd0892e5beeae59b74f12d14c027 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 30 Sep 2003 11:31:45 +0000 Subject: *** empty log message *** --- main.cc | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'main.cc') diff --git a/main.cc b/main.cc index 2d4f6725..a732ae19 100644 --- a/main.cc +++ b/main.cc @@ -1,8 +1,6 @@ -#include - #include "ledger.h" -#include // Perl regular expression library +#include namespace ledger { extern bool parse_ledger(std::istream& in); @@ -33,19 +31,21 @@ void show_help(std::ostream& out) int main(int argc, char *argv[]) { - // Global defaults - - commodity * usd = new commodity("$", true, false, true, false, 2); - commodities.insert(commodities_entry("USD", usd)); - // Parse the command-line options std::istream * file = NULL; +#ifdef HUQUQULLAH + compute_huquq = true; +#endif + int c; - while (-1 != (c = getopt(argc, argv, "+hwf:"))) { + while (-1 != (c = getopt(argc, argv, "+hHwf:"))) { switch (char(c)) { case 'h': show_help(std::cout); break; +#ifdef HUQUQULLAH + case 'H': compute_huquq = false; break; +#endif case 'w': use_warnings = true; break; case 'f': file = new std::ifstream(optarg); break; } @@ -75,6 +75,20 @@ int main(int argc, char *argv[]) return 1; } + // Global defaults + + commodity * usd = new commodity("$", true, false, true, false, 2); + commodities.insert(commodities_entry("USD", usd)); + +#ifdef HUQUQULLAH + if (compute_huquq) { + new commodity("H", true, true, true, false, 2); + new commodity("mithqal", false, true, true, false, 1); + + read_regexps(".huquq", huquq_categories); + } +#endif + // Parse the ledger char buf[32]; -- cgit v1.2.3