[#ArgsManager]
= ArgsManager
:mrdocs:

Parses and stores command&hyphen;line and configuration file arguments&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class ArgsManager;
----

== Types

[cols="1,4"]
|===
| Name| Description
| xref:ArgsManager/Command.adoc[`Command`] 
| A parsed command together with its arguments&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:ArgsManager/Flags.adoc[`Flags`] 
| Flags controlling how config and command line arguments are validated and interpreted&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:ArgsManager/2constructor.adoc[`ArgsManager`]         [.small]#[constructor]#
| Construct an argument manager with no arguments registered&period;
| xref:ArgsManager/2destructor.adoc[`&#126;ArgsManager`] [.small]#[destructor]#
| Destroy the argument manager&period;
| xref:ArgsManager/AddArg.adoc[`AddArg`] 
| Add argument
| xref:ArgsManager/AddCommand.adoc[`AddCommand`] 
| Add command
| xref:ArgsManager/AddHiddenArgs.adoc[`AddHiddenArgs`] 
| Add many hidden arguments
| xref:ArgsManager/CheckCommandOptions.adoc[`CheckCommandOptions`] 
| Check that any command&hyphen;specific options the user specified are valid for the given command&period;
| xref:ArgsManager/CheckMultipleCLIArgs.adoc[`CheckMultipleCLIArgs`] 
| Check CLI command args
| xref:ArgsManager/ClearArgs.adoc[`ClearArgs`] 
| Clear available arguments
| xref:ArgsManager/ClearPathCache.adoc[`ClearPathCache`] 
| Clear cached directory paths
| xref:ArgsManager/ForceSetArg.adoc[`ForceSetArg`] 
| Forces an arg setting&period; Called by SoftSetArg() if the arg hasn&apos;t already been set&period; Also called directly in testing&period;
| xref:ArgsManager/GetArg-0b.adoc[`GetArg`] 
| `GetArg` overloads
| xref:ArgsManager/GetArgFlags.adoc[`GetArgFlags`] 
| Return Flags for known arg&period; Return default flags for unknown arg&period;
| xref:ArgsManager/GetArgs.adoc[`GetArgs`] 
| Return a vector of strings of the given argument
| xref:ArgsManager/GetBlocksDirPath.adoc[`GetBlocksDirPath`] 
| Get blocks directory path
| xref:ArgsManager/GetBoolArg-0d.adoc[`GetBoolArg`] 
| `GetBoolArg` overloads
| xref:ArgsManager/GetChainType.adoc[`GetChainType`] 
| Returns the appropriate chain type from the program arguments&period;
| xref:ArgsManager/GetChainTypeString.adoc[`GetChainTypeString`] 
| Returns the appropriate chain type string from the program arguments&period;
| xref:ArgsManager/GetCommand.adoc[`GetCommand`] 
| Get the command and command args (returns std&colon;&colon;nullopt if no command provided)
| xref:ArgsManager/GetConfigFilePath.adoc[`GetConfigFilePath`] 
| Return config file path (read&hyphen;only)
| xref:ArgsManager/GetDataDirBase.adoc[`GetDataDirBase`] 
| Get data directory path
| xref:ArgsManager/GetDataDirNet.adoc[`GetDataDirNet`] 
| Get data directory path with appended network identifier
| xref:ArgsManager/GetHelpMessage.adoc[`GetHelpMessage`] 
| Get the help string
| xref:ArgsManager/GetIntArg-0e.adoc[`GetIntArg`] 
| `GetIntArg` overloads
| xref:ArgsManager/GetPathArg.adoc[`GetPathArg`] 
| Return path argument or default value
| xref:ArgsManager/GetPersistentSetting.adoc[`GetPersistentSetting`] 
| Get current setting from config file or read&sol;write settings file, ignoring nonpersistent command line or forced settings values&period;
| xref:ArgsManager/GetSetting.adoc[`GetSetting`] 
| Get setting value&period;
| xref:ArgsManager/GetSettingsList.adoc[`GetSettingsList`] 
| Get list of setting values&period;
| xref:ArgsManager/GetSettingsPath.adoc[`GetSettingsPath`] 
| Get settings file path, or return false if read&hyphen;write settings were disabled with &hyphen;nosettings&period;
| xref:ArgsManager/GetUnrecognizedSections.adoc[`GetUnrecognizedSections`] 
| Log warnings for unrecognized section names in the config file&period;
| xref:ArgsManager/GetUnsuitableSectionOnlyArgs.adoc[`GetUnsuitableSectionOnlyArgs`] 
| Log warnings for options in m&lowbar;section&lowbar;only&lowbar;args when they are specified in the default section but not overridden on the command line or in a network&hyphen;specific section in the config file&period;
| xref:ArgsManager/IsArgNegated.adoc[`IsArgNegated`] 
| Return true if the argument was originally passed as a negated option, i&period;e&period; &hyphen;nofoo&period;
| xref:ArgsManager/IsArgSet.adoc[`IsArgSet`] 
| Return true if the given argument has been manually set
| xref:ArgsManager/LockSettings.adoc[`LockSettings`] 
| Access settings with lock held&period;
| xref:ArgsManager/LogArgs.adoc[`LogArgs`] 
| Log the config file options and the command line arguments, useful for troubleshooting&period;
| xref:ArgsManager/ParseParameters.adoc[`ParseParameters`] 
| Parse command&hyphen;line parameters into settings&period;
| xref:ArgsManager/ReadConfigFiles.adoc[`ReadConfigFiles`] 
| Read and interpret the configuration files&period;
| xref:ArgsManager/ReadSettingsFile.adoc[`ReadSettingsFile`] 
| Read settings file&period; Push errors to vector, or log them if null&period;
| xref:ArgsManager/SelectConfigNetwork.adoc[`SelectConfigNetwork`] 
| Select the network in use
| xref:ArgsManager/SetConfigFilePath.adoc[`SetConfigFilePath`] 
| Set the path used for the configuration file&period;
| xref:ArgsManager/SetDefaultFlags.adoc[`SetDefaultFlags`] 
| Set default flags to return for an unknown arg&period;
| xref:ArgsManager/SoftSetArg.adoc[`SoftSetArg`] 
| Set an argument if it doesn&apos;t already have a value
| xref:ArgsManager/SoftSetBoolArg.adoc[`SoftSetBoolArg`] 
| Set a boolean argument if it doesn&apos;t already have a value
| xref:ArgsManager/WriteSettingsFile.adoc[`WriteSettingsFile`] 
| Write settings file or backup settings file&period; Push errors to vector, or log them if null&period;
|===


== Protected Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:ArgsManager/ReadConfigStream.adoc[`ReadConfigStream`] 
| Read and interpret configuration settings from a stream&period;
| xref:ArgsManager/ReadConfigString.adoc[`ReadConfigString`] 
| Read and interpret configuration settings from a string&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:AbsPathForConfigVal.adoc[`AbsPathForConfigVal`]
| Most paths passed as configuration arguments are treated as relative to the datadir if they are not absolute&period;
| xref:AppInitBasicSetup.adoc[`AppInitBasicSetup`]
| Initialize bitcoin core&colon; Basic context setup&period;
| xref:AppInitParameterInteraction.adoc[`AppInitParameterInteraction`]
| Initialization&colon; parameter interaction&period;
| xref:ApplyArgsManOptions.adoc[`ApplyArgsManOptions`]
| Overlay the options set in `argsman` on top of corresponding members in `mempool&lowbar;opts&period;` Returns an error if one was encountered&period;
| xref:BlockPolicyFeeEstPath.adoc[`BlockPolicyFeeEstPath`]
| Path of the block policy fee estimator data file&period;
| xref:CheckDataDirOption.adoc[`CheckDataDirOption`]
| Return true if &hyphen;datadir option points to a valid directory or is not specified&period;
| xref:CreateChainParams.adoc[`CreateChainParams`]
| Creates and returns a std&colon;&colon;unique&lowbar;ptr&lt;CChainParams&gt; of the chosen chain&period;
| xref:DumpPeerAddresses.adoc[`DumpPeerAddresses`]
| Writes the peer address database (peers&period;dat) to disk&period;
| xref:EnsureAnyArgsman.adoc[`EnsureAnyArgsman`]
| Get the argument manager from an opaque RPC context, asserting it is present&period;
| xref:EnsureArgsman.adoc[`EnsureArgsman`]
| Get the argument manager from a node context, asserting it is present&period;
| xref:HasTestOption.adoc[`HasTestOption`]
| Checks if a particular test option is present in &hyphen;test command&hyphen;line arg options
| xref:HelpRequested.adoc[`HelpRequested`]
| Return whether the user asked for help on the command line&period;
| xref:InitLogging.adoc[`InitLogging`]
| Initialize the logging infrastructure
| xref:InitParameterInteraction.adoc[`InitParameterInteraction`]
| Parameter interaction&colon; change current parameters depending on various rules
| xref:MaybeMigrateLegacyFeeEstimates.adoc[`MaybeMigrateLegacyFeeEstimates`]
| Move a legacy fee&lowbar;estimates&period;dat file to the current block policy fee estimator path, if needed&period;
| xref:MempoolPolicyEstimatorPath.adoc[`MempoolPolicyEstimatorPath`]
| Path of the mempool policy estimator data file&period;
| xref:SetupChainParamsBaseOptions.adoc[`SetupChainParamsBaseOptions`]
| Set the arguments for chainparams
| xref:SetupHelpOptions.adoc[`SetupHelpOptions`]
| Add help options to the args manager
| xref:SetupServerArgs.adoc[`SetupServerArgs`]
| Register all arguments with the ArgsManager
| xref:common/InitConfig.adoc[`common&colon;&colon;InitConfig`]
| Read config files, and create datadir and settings&period;json if they don&apos;t exist&period;
| xref:init/AddLoggingArgs.adoc[`init&colon;&colon;AddLoggingArgs`]
| Registers the logging&hyphen;related command&hyphen;line options with the argument manager&period;
| xref:init/SetLoggingCategories.adoc[`init&colon;&colon;SetLoggingCategories`]
| Enables or disables the debug logging categories selected by the arguments&period;
| xref:init/SetLoggingLevel.adoc[`init&colon;&colon;SetLoggingLevel`]
| Sets the global logging severity level selected by the arguments&period;
| xref:init/SetLoggingOptions.adoc[`init&colon;&colon;SetLoggingOptions`]
| Applies the general logging options (log file, timestamps, thread names, and similar flags) parsed from the arguments to the global logger&period;
| xref:init/StartLogging.adoc[`init&colon;&colon;StartLogging`]
| Opens the debug log file and begins writing buffered log messages&period;
| xref:node/ApplyArgsManOptions-06.adoc[`node&colon;&colon;ApplyArgsManOptions`]
| Apply block&hyphen;storage options taken from the argument manager&period;
| xref:node/ApplyArgsManOptions-08.adoc[`node&colon;&colon;ApplyArgsManOptions`]
| Apply peer&hyphen;manager options taken from the argument manager&period;
| xref:node/ApplyArgsManOptions-0e.adoc[`node&colon;&colon;ApplyArgsManOptions`]
| Apply chainstate&hyphen;manager options taken from the argument manager&period;
| xref:node/CalculateCacheSizes.adoc[`node&colon;&colon;CalculateCacheSizes`]
| Split the configured total database cache across the indexes and kernel caches&period;
| xref:node/LogOversizedDbCache.adoc[`node&colon;&colon;LogOversizedDbCache`]
| Log a warning when the configured database cache is larger than available RAM allows&period;
| xref:node/MempoolPath.adoc[`node&colon;&colon;MempoolPath`]
| Return the on&hyphen;disk path used to load and save the persisted mempool&period;
| xref:node/ReadCoinsViewArgs.adoc[`node&colon;&colon;ReadCoinsViewArgs`]
| Read coins&hyphen;view database options from the argument manager&period;
| xref:node/ReadDatabaseArgs.adoc[`node&colon;&colon;ReadDatabaseArgs`]
| Read database options from the argument manager&period;
| xref:node/ReadMiningArgs.adoc[`node&colon;&colon;ReadMiningArgs`]
| Read the mining options set in `args&period;` Returns an error if one was encountered&period;
| xref:node/ReadNotificationArgs.adoc[`node&colon;&colon;ReadNotificationArgs`]
| Apply notification&hyphen;related options from the argument manager&period;
| xref:node/ShouldPersistMempool.adoc[`node&colon;&colon;ShouldPersistMempool`]
| Determine whether the mempool should be persisted across restarts&period;
| xref:wallet/CreateFromDump.adoc[`wallet&colon;&colon;CreateFromDump`]
| Creates a new wallet database from a previously dumped file&period;
| xref:wallet/DumpWallet.adoc[`wallet&colon;&colon;DumpWallet`]
| Dumps the records of a wallet database to a human&hyphen;readable file&period;
| xref:wallet/ReadDatabaseArgs.adoc[`wallet&colon;&colon;ReadDatabaseArgs`]
| Fills database options from command&hyphen;line arguments&period;
| xref:wallet/WalletTool/ExecuteWalletToolFunc.adoc[`wallet&colon;&colon;WalletTool&colon;&colon;ExecuteWalletToolFunc`]
| Runs a wallet&hyphen;tool command such as create, info, or dump&period;
|===


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