mirror of
https://github.com/CLIUtils/CLI11.git
synced 2026-01-19 04:52:08 +00:00
This PR should fix #912
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
// [CLI11:public_includes:end]
|
||||
|
||||
#include "Encoding.hpp"
|
||||
#include "Error.hpp"
|
||||
#include "StringTools.hpp"
|
||||
|
||||
@@ -70,7 +70,12 @@ class Config {
|
||||
|
||||
/// Parse a config file, throw an error (ParseError:ConfigParseError or FileError) on failure
|
||||
CLI11_NODISCARD std::vector<ConfigItem> from_file(const std::string &name) const {
|
||||
#if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0
|
||||
std::ifstream input{to_path(name)};
|
||||
#else
|
||||
std::ifstream input{name};
|
||||
#endif
|
||||
|
||||
if(!input.good())
|
||||
throw FileError::Missing(name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user