diff options
author | John Wiegley <johnw@newartisans.com> | 2003-09-30 11:31:45 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2003-09-30 11:31:45 +0000 |
commit | f6c2e3d51eb8cd0892e5beeae59b74f12d14c027 (patch) | |
tree | d8c9f649d32f95386ca0a34657d99aa707a42f0a /main.cc | |
parent | 30aef588bf32419718a4d0ea0488ed8a074ff784 (diff) | |
download | fork-ledger-f6c2e3d51eb8cd0892e5beeae59b74f12d14c027.tar.gz fork-ledger-f6c2e3d51eb8cd0892e5beeae59b74f12d14c027.tar.bz2 fork-ledger-f6c2e3d51eb8cd0892e5beeae59b74f12d14c027.zip |
*** empty log message ***
Diffstat (limited to 'main.cc')
-rw-r--r-- | main.cc | 32 |
1 files changed, 23 insertions, 9 deletions
@@ -1,8 +1,6 @@ -#include <fstream> - #include "ledger.h" -#include <pcre.h> // Perl regular expression library +#include <fstream> 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]; |