[#common-InitConfig]
= xref:common.adoc[common]::InitConfig
:relfileprefix: ../
:mrdocs:

Read config files, and create datadir and settings&period;json if they don&apos;t exist&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::optional&lt;ConfigError&gt;
InitConfig(
    xref:ArgsManager.adoc[ArgsManager]& args,
    xref:common/SettingsAbortFn.adoc[SettingsAbortFn] settings&lowbar;abort&lowbar;fn = nullptr);
----

== Return Value

A ConfigError if initialization failed, or std&colon;&colon;nullopt on success&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *args*
| The argument manager holding parsed command&hyphen;line and config values&period;
| *settings&lowbar;abort&lowbar;fn*
| Callback invoked to decide whether to abort when settings&period;json cannot be parsed&period;
|===


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