From 0f05499e304989e1eab0e50ffd8079e1198387e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveira?= Date: Fri, 22 Sep 2023 12:00:51 +0000 Subject: [PATCH] Fix cli options (#4772) ## Issue Addressed Fixes breaking change introduced on https://github.com/sigp/lighthouse/pull/4674/ that doesn't allow multiple `http_enabled` `ArgGroup` flags --- beacon_node/src/cli.rs | 2 +- lighthouse/tests/beacon_node.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/beacon_node/src/cli.rs b/beacon_node/src/cli.rs index dacff79f6ca..15f8f565516 100644 --- a/beacon_node/src/cli.rs +++ b/beacon_node/src/cli.rs @@ -1273,5 +1273,5 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .default_value("64") .takes_value(true) ) - .group(ArgGroup::with_name("enable_http").args(&["http", "gui", "staking"])) + .group(ArgGroup::with_name("enable_http").args(&["http", "gui", "staking"]).multiple(true)) } diff --git a/lighthouse/tests/beacon_node.rs b/lighthouse/tests/beacon_node.rs index cb51dffdced..bc6b6284e5a 100644 --- a/lighthouse/tests/beacon_node.rs +++ b/lighthouse/tests/beacon_node.rs @@ -2337,6 +2337,18 @@ fn gui_flag() { }); } +#[test] +fn multiple_http_enabled_flags() { + CommandLineTest::new() + .flag("gui", None) + .flag("http", None) + .flag("staking", None) + .run_with_zero_port() + .with_config(|config| { + assert!(config.http_api.enabled); + }); +} + #[test] fn optimistic_finalized_sync_default() { CommandLineTest::new()