[#ArgsManager] = ArgsManager :mrdocs: Parses and stores command‐line and configuration file arguments. == Synopsis Declared in `<common/args.h>` [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. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:ArgsManager/Flags.adoc[`Flags`] | Flags controlling how config and command line arguments are validated and interpreted. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:ArgsManager/2constructor.adoc[`ArgsManager`] [.small]#[constructor]# | Construct an argument manager with no arguments registered. | xref:ArgsManager/2destructor.adoc[`~ArgsManager`] [.small]#[destructor]# | Destroy the argument manager. | 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‐specific options the user specified are valid for the given command. | 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. Called by SoftSetArg() if the arg hasn't already been set. Also called directly in testing. | xref:ArgsManager/GetArg-0b.adoc[`GetArg`] | `GetArg` overloads | xref:ArgsManager/GetArgFlags.adoc[`GetArgFlags`] | Return Flags for known arg. Return default flags for unknown arg. | 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. | xref:ArgsManager/GetChainTypeString.adoc[`GetChainTypeString`] | Returns the appropriate chain type string from the program arguments. | xref:ArgsManager/GetCommand.adoc[`GetCommand`] | Get the command and command args (returns std::nullopt if no command provided) | xref:ArgsManager/GetConfigFilePath.adoc[`GetConfigFilePath`] | Return config file path (read‐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/write settings file, ignoring nonpersistent command line or forced settings values. | xref:ArgsManager/GetSetting.adoc[`GetSetting`] | Get setting value. | xref:ArgsManager/GetSettingsList.adoc[`GetSettingsList`] | Get list of setting values. | xref:ArgsManager/GetSettingsPath.adoc[`GetSettingsPath`] | Get settings file path, or return false if read‐write settings were disabled with ‐nosettings. | xref:ArgsManager/GetUnrecognizedSections.adoc[`GetUnrecognizedSections`] | Log warnings for unrecognized section names in the config file. | xref:ArgsManager/GetUnsuitableSectionOnlyArgs.adoc[`GetUnsuitableSectionOnlyArgs`] | Log warnings for options in m_section_only_args when they are specified in the default section but not overridden on the command line or in a network‐specific section in the config file. | xref:ArgsManager/IsArgNegated.adoc[`IsArgNegated`] | Return true if the argument was originally passed as a negated option, i.e. ‐nofoo. | 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. | xref:ArgsManager/LogArgs.adoc[`LogArgs`] | Log the config file options and the command line arguments, useful for troubleshooting. | xref:ArgsManager/ParseParameters.adoc[`ParseParameters`] | Parse command‐line parameters into settings. | xref:ArgsManager/ReadConfigFiles.adoc[`ReadConfigFiles`] | Read and interpret the configuration files. | xref:ArgsManager/ReadSettingsFile.adoc[`ReadSettingsFile`] | Read settings file. Push errors to vector, or log them if null. | xref:ArgsManager/SelectConfigNetwork.adoc[`SelectConfigNetwork`] | Select the network in use | xref:ArgsManager/SetConfigFilePath.adoc[`SetConfigFilePath`] | Set the path used for the configuration file. | xref:ArgsManager/SetDefaultFlags.adoc[`SetDefaultFlags`] | Set default flags to return for an unknown arg. | xref:ArgsManager/SoftSetArg.adoc[`SoftSetArg`] | Set an argument if it doesn't already have a value | xref:ArgsManager/SoftSetBoolArg.adoc[`SoftSetBoolArg`] | Set a boolean argument if it doesn't already have a value | xref:ArgsManager/WriteSettingsFile.adoc[`WriteSettingsFile`] | Write settings file or backup settings file. Push errors to vector, or log them if null. |=== == Protected Member Functions [cols="1,4"] |=== | Name| Description | xref:ArgsManager/ReadConfigStream.adoc[`ReadConfigStream`] | Read and interpret configuration settings from a stream. | xref:ArgsManager/ReadConfigString.adoc[`ReadConfigString`] | Read and interpret configuration settings from a string. |=== == 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. | xref:AppInitBasicSetup.adoc[`AppInitBasicSetup`] | Initialize bitcoin core: Basic context setup. | xref:AppInitParameterInteraction.adoc[`AppInitParameterInteraction`] | Initialization: parameter interaction. | xref:ApplyArgsManOptions.adoc[`ApplyArgsManOptions`] | Overlay the options set in `argsman` on top of corresponding members in `mempool_opts.` Returns an error if one was encountered. | xref:BlockPolicyFeeEstPath.adoc[`BlockPolicyFeeEstPath`] | Path of the block policy fee estimator data file. | xref:CheckDataDirOption.adoc[`CheckDataDirOption`] | Return true if ‐datadir option points to a valid directory or is not specified. | xref:CreateChainParams.adoc[`CreateChainParams`] | Creates and returns a std::unique_ptr<CChainParams> of the chosen chain. | xref:DumpPeerAddresses.adoc[`DumpPeerAddresses`] | Writes the peer address database (peers.dat) to disk. | xref:EnsureAnyArgsman.adoc[`EnsureAnyArgsman`] | Get the argument manager from an opaque RPC context, asserting it is present. | xref:EnsureArgsman.adoc[`EnsureArgsman`] | Get the argument manager from a node context, asserting it is present. | xref:HasTestOption.adoc[`HasTestOption`] | Checks if a particular test option is present in ‐test command‐line arg options | xref:HelpRequested.adoc[`HelpRequested`] | Return whether the user asked for help on the command line. | xref:InitLogging.adoc[`InitLogging`] | Initialize the logging infrastructure | xref:InitParameterInteraction.adoc[`InitParameterInteraction`] | Parameter interaction: change current parameters depending on various rules | xref:MaybeMigrateLegacyFeeEstimates.adoc[`MaybeMigrateLegacyFeeEstimates`] | Move a legacy fee_estimates.dat file to the current block policy fee estimator path, if needed. | xref:MempoolPolicyEstimatorPath.adoc[`MempoolPolicyEstimatorPath`] | Path of the mempool policy estimator data file. | 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::InitConfig`] | Read config files, and create datadir and settings.json if they don't exist. | xref:init/AddLoggingArgs.adoc[`init::AddLoggingArgs`] | Registers the logging‐related command‐line options with the argument manager. | xref:init/SetLoggingCategories.adoc[`init::SetLoggingCategories`] | Enables or disables the debug logging categories selected by the arguments. | xref:init/SetLoggingLevel.adoc[`init::SetLoggingLevel`] | Sets the global logging severity level selected by the arguments. | xref:init/SetLoggingOptions.adoc[`init::SetLoggingOptions`] | Applies the general logging options (log file, timestamps, thread names, and similar flags) parsed from the arguments to the global logger. | xref:init/StartLogging.adoc[`init::StartLogging`] | Opens the debug log file and begins writing buffered log messages. | xref:node/ApplyArgsManOptions-06.adoc[`node::ApplyArgsManOptions`] | Apply block‐storage options taken from the argument manager. | xref:node/ApplyArgsManOptions-08.adoc[`node::ApplyArgsManOptions`] | Apply peer‐manager options taken from the argument manager. | xref:node/ApplyArgsManOptions-0e.adoc[`node::ApplyArgsManOptions`] | Apply chainstate‐manager options taken from the argument manager. | xref:node/CalculateCacheSizes.adoc[`node::CalculateCacheSizes`] | Split the configured total database cache across the indexes and kernel caches. | xref:node/LogOversizedDbCache.adoc[`node::LogOversizedDbCache`] | Log a warning when the configured database cache is larger than available RAM allows. | xref:node/MempoolPath.adoc[`node::MempoolPath`] | Return the on‐disk path used to load and save the persisted mempool. | xref:node/ReadCoinsViewArgs.adoc[`node::ReadCoinsViewArgs`] | Read coins‐view database options from the argument manager. | xref:node/ReadDatabaseArgs.adoc[`node::ReadDatabaseArgs`] | Read database options from the argument manager. | xref:node/ReadMiningArgs.adoc[`node::ReadMiningArgs`] | Read the mining options set in `args.` Returns an error if one was encountered. | xref:node/ReadNotificationArgs.adoc[`node::ReadNotificationArgs`] | Apply notification‐related options from the argument manager. | xref:node/ShouldPersistMempool.adoc[`node::ShouldPersistMempool`] | Determine whether the mempool should be persisted across restarts. | xref:wallet/CreateFromDump.adoc[`wallet::CreateFromDump`] | Creates a new wallet database from a previously dumped file. | xref:wallet/DumpWallet.adoc[`wallet::DumpWallet`] | Dumps the records of a wallet database to a human‐readable file. | xref:wallet/ReadDatabaseArgs.adoc[`wallet::ReadDatabaseArgs`] | Fills database options from command‐line arguments. | xref:wallet/WalletTool/ExecuteWalletToolFunc.adoc[`wallet::WalletTool::ExecuteWalletToolFunc`] | Runs a wallet‐tool command such as create, info, or dump. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#