From a46c3d95184581e8ab516b552f6b3e47c06f5bdb Mon Sep 17 00:00:00 2001 From: "Brandon H. Gomes" Date: Wed, 1 Jun 2022 22:10:50 -0400 Subject: [PATCH] feat: add run_with command for CLI to separate from parsing --- node/src/command.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/node/src/command.rs b/node/src/command.rs index 7c0a55cd0..51ccb84fc 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -245,9 +245,7 @@ macro_rules! construct_async_run { } /// Parse command line arguments into service configuration. -pub fn run() -> Result<()> { - let cli = Cli::from_args(); - +pub fn run_with(cli: Cli) -> Result<()> { match &cli.subcommand { Some(Subcommand::BuildSpec(cmd)) => { let runner = cli.create_runner(cmd)?; @@ -469,6 +467,11 @@ pub fn run() -> Result<()> { } } +/// Parse command line arguments into service configuration. +pub fn run() -> Result<()> { + run_with(Cli::from_args()) +} + impl DefaultConfigurationValues for RelayChainCli { fn p2p_listen_port() -> u16 { 30334