run_cli!() { /* proc-macro */ }
Expand description

run_cli!(command, app_mutator, make_ctx, exit_fn)

  • this function does not return
  • command: path to an rpc command (with the #[command] attribute)
  • app_mutator (optional): an expression that returns a mutated app.
    • example: app => app.arg(Arg::with_name("port").long("port"))
    • default: app => app
  • make_ctx (optional): an expression that takes &ArgMatches and returns the Context used by command.
    • example: matches => matches.value_of("port")
    • default: matches => matches
  • exit_fn (optional): a function that takes a JSON RPC error code (i32) and returns an Exit code (i32)
    • default: |code| code