From 0b9f22b4d24e8fa545af2d7d448ddfe9fb3736ba Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 22 Jan 2009 16:27:24 -0400 Subject: Redid the way command-line arguments are processed. Before, Ledger used - and -- to mean special things after the command verb was seen. But now, what used to be specified as this: ledger -n reg cash -payable -- shell Is now specified as this: ledger reg -n cash not payable @shell It could also be specified as: ledger -n reg \(cash and not payable\) and @shell --- src/session.h | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'src/session.h') diff --git a/src/session.h b/src/session.h index bef9b580..a0637b2e 100644 --- a/src/session.h +++ b/src/session.h @@ -224,27 +224,12 @@ See LICENSE file included with the distribution for details and disclaimer.\n"; // Option handlers // - value_t option_file_(call_scope_t& args) { + value_t option_file_(call_scope_t& args) { // f assert(args.size() == 1); - // jww (2008-08-13): Add support for multiple files, but not between - // -f and LEDGER_FILE - if (data_file.empty()) { - data_file = args[0].as_string(); - use_cache = false; - -#if 0 - // jww (2008-08-14): Should we check whether the file exists - // before we accept it, or is this done later on? - if (! data_file.string() == "-") { - std::string path = resolve_path(optarg); - if (access(path.c_str(), R_OK) != -1) - config->data_file = path; - else - throw_(std::invalid_argument, - "The ledger file '" << path << "' does not exist or is not readable"); - } -#endif - } + + // jww (2008-08-13): Add support for multiple files + data_file = args[0].as_string(); + use_cache = false; return true; } -- cgit v1.2.3