[Base] Fix path parsing from commandline.
This commit is contained in:
parent
637a8464a7
commit
b37579fad2
|
@ -104,16 +104,33 @@ template <class T>
|
|||
void CommandVar<T>::AddToLaunchOptions(cxxopts::Options* options) {
|
||||
options->add_options()(name_, description_, cxxopts::value<T>());
|
||||
}
|
||||
template <>
|
||||
inline void CommandVar<std::filesystem::path>::AddToLaunchOptions(
|
||||
cxxopts::Options* options) {
|
||||
options->add_options()(name_, description_, cxxopts::value<std::string>());
|
||||
}
|
||||
template <class T>
|
||||
void ConfigVar<T>::AddToLaunchOptions(cxxopts::Options* options) {
|
||||
options->add_options(category_)(this->name_, this->description_,
|
||||
cxxopts::value<T>());
|
||||
}
|
||||
template <>
|
||||
inline void ConfigVar<std::filesystem::path>::AddToLaunchOptions(
|
||||
cxxopts::Options* options) {
|
||||
options->add_options(category_)(this->name_, this->description_,
|
||||
cxxopts::value<std::string>());
|
||||
}
|
||||
template <class T>
|
||||
void CommandVar<T>::LoadFromLaunchOptions(cxxopts::ParseResult* result) {
|
||||
T value = (*result)[name_].template as<T>();
|
||||
SetCommandLineValue(value);
|
||||
}
|
||||
template <>
|
||||
inline void CommandVar<std::filesystem::path>::LoadFromLaunchOptions(
|
||||
cxxopts::ParseResult* result) {
|
||||
std::string value = (*result)[name_].template as<std::string>();
|
||||
SetCommandLineValue(value);
|
||||
}
|
||||
template <class T>
|
||||
void ConfigVar<T>::LoadConfigValue(std::shared_ptr<cpptoml::base> result) {
|
||||
SetConfigValue(*cpptoml::get_impl<T>(result));
|
||||
|
|
Loading…
Reference in New Issue