Execute the command specified in the options.
(opts: &Options)
| 61 | |
| 62 | /// Execute the command specified in the options. |
| 63 | pub async fn exec(opts: &Options) -> anyhow::Result<()> { |
| 64 | match &opts.command { |
| 65 | Commands::Config(args) => args.exec(settings(opts)?).await, |
| 66 | Commands::Debug(args) => args.exec(()).await, |
| 67 | Commands::Run(args) => args.exec(settings(opts)?).await, |
| 68 | Commands::Key(args) => args.exec(()).await, |
| 69 | Commands::Genesis(args) => args.exec(()).await, |
| 70 | Commands::Rpc(args) => args.exec(()).await, |
| 71 | Commands::Eth(args) => args.exec(settings(opts)?.eth).await, |
| 72 | Commands::Materializer(args) => args.exec(()).await, |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | /// Try to parse the settings in the configuration directory. |
| 77 | fn settings(opts: &Options) -> anyhow::Result<Settings> { |