Moved a block of code from report to session, though it's still commented out.
This commit is contained in:
parent
b07451d650
commit
6555f45c9d
2 changed files with 14 additions and 13 deletions
13
src/report.h
13
src/report.h
|
|
@ -231,19 +231,6 @@ public:
|
|||
"The init file '" << path << "' does not exist or is not readable");
|
||||
}
|
||||
|
||||
value_t option_file(call_scope_t& args) { // f:
|
||||
if (std::string(optarg) == "-") {
|
||||
config->data_file = optarg;
|
||||
} else {
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
value_t option_cache(call_scope_t& args) { // :
|
||||
config->cache_file = resolve_path(optarg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -226,7 +226,21 @@ See LICENSE file included with the distribution for details and disclaimer.\n";
|
|||
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
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue