diff options
Diffstat (limited to 'src/util/system.cpp')
-rw-r--r-- | src/util/system.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp index 4ead39dd6c..82770dc665 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -399,6 +399,13 @@ std::optional<unsigned int> ArgsManager::GetArgFlags(const std::string& name) co return std::nullopt; } +fs::path ArgsManager::GetPathArg(std::string pathlike_arg) const +{ + auto result = fs::PathFromString(GetArg(pathlike_arg, "")).lexically_normal(); + // Remove trailing slash, if present. + return result.has_filename() ? result : result.parent_path(); +} + const fs::path& ArgsManager::GetBlocksDirPath() const { LOCK(cs_args); |