ArgsManager::GetPathArg

Return path argument or default value

Synopsis

Declared in <common/args.h>

[[requires_capability(0x7f2e381ad4a8)]]
fs::path
GetPathArg(
    std::string arg,
    fs::path const& default_value = {}) const;

Return Value

normalized path if argument is set, with redundant "." and ".." path components and trailing separators removed (see patharg unit test for examples or implementation for details). If argument is empty or not set, default_value is returned unchanged.

Parameters

NameDescription
argArgument to get a path from (e.g., "-datadir", "-blocksdir" or "-walletdir")
default_valueOptional default value to return instead of the empty path.