Skip to content

Commit

Permalink
feat: add run_with command for CLI to separate from parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
bhgomes committed Jun 2, 2022
1 parent 1af3c5c commit a46c3d9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a46c3d9

Please sign in to comment.