referrerpolicy=no-referrer-when-downgrade

Function run_with_custom_cli

Source
pub fn run_with_custom_cli<CliConfig, ExtraSubcommand>(
    cmd_config: RunConfig,
) -> Result<()>
where CliConfig: CliConfig, ExtraSubcommand: ExtraSubcommand,
Expand description

Parse command‑line arguments into service configuration and inject an optional extra sub‑command.

run_with_custom_cli builds the base CLI for the node binary, then asks the Extra type for an optional extra sub‑command.

When the user actually invokes that extra sub‑command, Extra::from_arg_matches returns a parsed value which is immediately passed to extra.handle(&cfg) and the process exits. Otherwise control falls through to the normal node‑startup / utility sub‑command match.

§Type Parameters

  • CliConfig – customization trait supplying user‑facing info (name, description, version) for the binary.
  • Extra – an implementation of ExtraSubcommand. Use NoExtraSubcommand if the binary should not expose any extra subcommands.