diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-19 17:55:33 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-08-19 17:55:33 -0400 |
commit | aba3d3037a43f4c244b4065b7fd70a6f1d5656de (patch) | |
tree | eaa48c8cdb91852cd440b0c246f38ed790f7e5ee /config.cc | |
parent | bf923ab33e9951d25611cb7193d6852e9113d929 (diff) | |
download | fork-ledger-aba3d3037a43f4c244b4065b7fd70a6f1d5656de.tar.gz fork-ledger-aba3d3037a43f4c244b4065b7fd70a6f1d5656de.tar.bz2 fork-ledger-aba3d3037a43f4c244b4065b7fd70a6f1d5656de.zip |
added support for parsing QIF files
Diffstat (limited to 'config.cc')
-rw-r--r-- | config.cc | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -59,7 +59,8 @@ Basic options:\n\ -i, --init FILE initialize ledger by loading FILE (def: ~/.ledgerrc)\n\ -f, --file FILE read ledger data from FILE\n\ -o, --output FILE write output to FILE\n\ - -p, --set-price CONV specify a commodity conversion: \"COMM=AMOUNT\"\n\n\ + -p, --set-price CONV specify a commodity conversion: \"COMM=AMOUNT\"\n\ + -a, --account NAME specify the default account (useful with QIF files)\n\n\ Report filtering:\n\ -b, --begin-date DATE set report begin date\n\ -e, --end-date DATE set report end date\n\ @@ -132,13 +133,7 @@ OPT_BEGIN(init, "i:") { } OPT_END(init); OPT_BEGIN(file, "f:") { - char * buf = new char[std::strlen(optarg) + 1]; - std::strcpy(buf, optarg); - for (char * p = std::strtok(buf, ":"); - p; - p = std::strtok(NULL, ":")) - config->files.push_back(p); - delete[] buf; + config->data_file = optarg; } OPT_END(file); OPT_BEGIN(cache, ":") { @@ -157,6 +152,10 @@ OPT_BEGIN(set_price, "p:") { std::cerr << "Error: Invalid price setting: " << optarg << std::endl; } OPT_END(set_price); +OPT_BEGIN(account, "a:") { + config->account = optarg; +} OPT_END(account); + ////////////////////////////////////////////////////////////////////// // // Report filtering |