5 releases
0.1.16-alpha.0 | Mar 31, 2023 |
---|---|
0.1.14-alpha.0 | Mar 18, 2023 |
0.1.13-alpha.0 | Mar 17, 2023 |
0.1.12-alpha.0 | Jan 18, 2023 |
0.1.10-alpha.0 | Jan 18, 2023 |
#202 in #settings
466 downloads per month
Used in 56 crates
(22 directly)
1MB
4.5K
SLoC
bitcoin-argsman
A Rust crate for managing command-line arguments and configurations for the Bitcoin system. This crate is in the process of being translated from C++ to Rust, and some of the function bodies are still in the process of translation.
This crate provides a set of tools for parsing and interpreting command-line arguments and configuration files, as well as managing and validating settings for the Bitcoin system. The crate contains a number of types and functions that allow for easy management of various configuration options and parameters.
Some of the key features of this crate include:
-
ArgsManager
: A struct for managing command-line arguments and configuration files. -
ArgDescriptor
: A struct for describing a single argument or option. -
OptionsCategory
: A struct for grouping related command-line arguments. -
BaseChainParams
: A struct for managing settings related to the Bitcoin blockchain. -
SectionInfo
: A struct for managing information about a configuration file section. -
ArgsManagerFlags
: A set of bitflags for controlling various aspects ofArgsManager
. -
ArgsManagerCommand
: A struct for defining a subcommand of thebitcoin-argsman
command-line tool.
Some of the mathematical ideas behind this crate include the use of bitflags for efficient storage and manipulation of Boolean flags, as well as the use of structs and functions for managing and manipulating various types of data.
The following are some of the key functions and methods provided by this crate:
-
get_data_dir()
: Returns the path to the Bitcoin data directory. -
get_data_dir_base()
: Returns the base path of the data directory. -
get_data_dir_net()
: Returns the path to the data directory for a specific Bitcoin network. -
get_default_data_dir()
: Returns the default path to the Bitcoin data directory. -
get_home_dir()
: Returns the path to the user's home directory. -
strip_redundant_last_elements_of_path()
: Removes redundant elements from the end of a path. -
parse_parameters()
: Parses command-line arguments into a set ofArgDescriptor
objects. -
read_config_files()
: Reads configuration files into memory and returns them as a vector ofSectionInfo
objects. -
read_config_stream()
: Reads a single configuration file stream into memory and returns it as aSectionInfo
object. -
select_config_network()
: Selects the appropriate configuration network based on the command-line arguments. -
write_settings_file()
: Writes the current settings to a configuration file.
Overall, bitcoin-argsman
provides a powerful and
flexible set of tools for managing and
interpreting command-line arguments and
configuration files for the Bitcoin system.
Dependencies
~90MB
~851K SLoC