mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
Change DB Manager Clap usage to derive (#5898)
* implement clap derive for the db manager * tweak some clap configs * make cli local * add global to help flag * fmt * Merge branch 'unstable' of https://github.com/sigp/lighthouse into HEAD * merge * add enum constraints to flag
This commit is contained in:
@@ -402,7 +402,10 @@ pub fn get_config<E: EthSpec>(
|
||||
client_config.blobs_db_path = Some(PathBuf::from(blobs_db_dir));
|
||||
}
|
||||
|
||||
let (sprp, sprp_explicit) = get_slots_per_restore_point::<E>(cli_args)?;
|
||||
let (sprp, sprp_explicit) = get_slots_per_restore_point::<E>(clap_utils::parse_optional(
|
||||
cli_args,
|
||||
"slots-per-restore-point",
|
||||
)?)?;
|
||||
client_config.store.slots_per_restore_point = sprp;
|
||||
client_config.store.slots_per_restore_point_set_explicitly = sprp_explicit;
|
||||
|
||||
@@ -1476,11 +1479,9 @@ pub fn get_data_dir(cli_args: &ArgMatches) -> PathBuf {
|
||||
///
|
||||
/// Return `(sprp, set_explicitly)` where `set_explicitly` is `true` if the user provided the value.
|
||||
pub fn get_slots_per_restore_point<E: EthSpec>(
|
||||
cli_args: &ArgMatches,
|
||||
slots_per_restore_point: Option<u64>,
|
||||
) -> Result<(u64, bool), String> {
|
||||
if let Some(slots_per_restore_point) =
|
||||
clap_utils::parse_optional(cli_args, "slots-per-restore-point")?
|
||||
{
|
||||
if let Some(slots_per_restore_point) = slots_per_restore_point {
|
||||
Ok((slots_per_restore_point, true))
|
||||
} else {
|
||||
let default = std::cmp::min(
|
||||
|
||||
Reference in New Issue
Block a user