summaryrefslogtreecommitdiff
path: root/src/CommandLine.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-12-16 11:05:33 +0100
committerMax Kellermann <max@duempel.org>2015-12-18 01:08:16 +0100
commite6e7d6dbd654b9936b04f27b8153fb4ed945b9d3 (patch)
treeae4f965fd7a24ce01aad50117a5776610c861af6 /src/CommandLine.cxx
parentfe60c52c70705b721bee7fbd6e3aae076a3b99c9 (diff)
fs/io/Reader: use C++ exceptions instead of class Error
Diffstat (limited to 'src/CommandLine.cxx')
-rw-r--r--src/CommandLine.cxx17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/CommandLine.cxx b/src/CommandLine.cxx
index b59a39e40..ce0fa543b 100644
--- a/src/CommandLine.cxx
+++ b/src/CommandLine.cxx
@@ -277,13 +277,7 @@ static void help(void)
class ConfigLoader
{
- Error &error;
- bool result;
public:
- ConfigLoader(Error &_error) : error(_error), result(false) { }
-
- bool GetResult() const { return result; }
-
bool TryFile(const Path path);
bool TryFile(const AllocatedPath &base_path,
PathTraitsFS::const_pointer path);
@@ -292,7 +286,7 @@ public:
bool ConfigLoader::TryFile(Path path)
{
if (FileExists(path)) {
- result = ReadConfigFile(path, error);
+ ReadConfigFile(path);
return true;
}
return false;
@@ -386,15 +380,16 @@ parse_cmdline(int argc, char **argv, struct options *options,
return false;
}
- return ReadConfigFile(Path::FromFS(buffer), error);
+ ReadConfigFile(Path::FromFS(buffer));
#else
- return ReadConfigFile(Path::FromFS(config_file), error);
+ ReadConfigFile(Path::FromFS(config_file));
#endif
+ return true;
}
/* use default configuration file path */
- ConfigLoader loader(error);
+ ConfigLoader loader;
bool found =
#ifdef WIN32
@@ -413,5 +408,5 @@ parse_cmdline(int argc, char **argv, struct options *options,
return false;
}
- return loader.GetResult();
+ return true;
}