[#ArgsManager-GetPathArg]
= xref:ArgsManager.adoc[ArgsManager]::GetPathArg
:relfileprefix: ../
:mrdocs:

Return path argument or default value

== Synopsis

Declared in `&lt;common&sol;args&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f2e381ad4a8)&rsqb;&rsqb;
xref:fs/path.adoc[fs::path]
GetPathArg(
    std::string arg,
    xref:fs/path.adoc[fs::path] const& default&lowbar;value = &lcub;&rcub;) const;
----

== Return Value

normalized path if argument is set, with redundant &quot;&period;&quot; and &quot;&period;&period;&quot; path components and trailing separators removed (see patharg unit test for examples or implementation for details)&period; If argument is empty or not set, default&lowbar;value is returned unchanged&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *arg*
| Argument to get a path from (e&period;g&period;, &quot;&hyphen;datadir&quot;, &quot;&hyphen;blocksdir&quot; or &quot;&hyphen;walletdir&quot;)
| *default&lowbar;value*
| Optional default value to return instead of the empty path&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
