From b172bc61b04263ac1e75cec0cd03a86336abacb3 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 18 Oct 2024 16:14:07 +0200 Subject: [PATCH] refactor: rename inception_args to zkstack_args --- zkstack_cli/crates/zkstack/src/main.rs | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/zkstack_cli/crates/zkstack/src/main.rs b/zkstack_cli/crates/zkstack/src/main.rs index ccfa4dc35733..3ebe26a4fa21 100644 --- a/zkstack_cli/crates/zkstack/src/main.rs +++ b/zkstack_cli/crates/zkstack/src/main.rs @@ -103,9 +103,9 @@ async fn main() -> anyhow::Result<()> { // We must parse arguments before printing the intro, because some autogenerated // Clap commands (like `--version` would look odd otherwise). - let inception_args = ZkStack::parse(); + let zkstack_args = ZkStack::parse(); - match run_subcommand(inception_args).await { + match run_subcommand(zkstack_args).await { Ok(_) => {} Err(error) => { log_error(error); @@ -116,7 +116,7 @@ async fn main() -> anyhow::Result<()> { Ok(()) } -async fn run_subcommand(inception_args: ZkStack) -> anyhow::Result<()> { +async fn run_subcommand(zkstack_args: ZkStack) -> anyhow::Result<()> { init_prompt_theme(); logger::new_empty_line(); @@ -124,13 +124,13 @@ async fn run_subcommand(inception_args: ZkStack) -> anyhow::Result<()> { let shell = Shell::new().unwrap(); - init_global_config_inner(&shell, &inception_args.global)?; + init_global_config_inner(&shell, &zkstack_args.global)?; if !global_config().ignore_prerequisites { check_general_prerequisites(&shell); } - match inception_args.command { + match zkstack_args.command { ZkStackSubcommands::Autocomplete(args) => commands::autocomplete::run(args)?, ZkStackSubcommands::Ecosystem(args) => commands::ecosystem::run(&shell, *args).await?, ZkStackSubcommands::Chain(args) => commands::chain::run(&shell, *args).await?, @@ -155,11 +155,8 @@ async fn run_subcommand(inception_args: ZkStack) -> anyhow::Result<()> { Ok(()) } -fn init_global_config_inner( - shell: &Shell, - inception_args: &ZkStackGlobalArgs, -) -> anyhow::Result<()> { - if let Some(name) = &inception_args.chain { +fn init_global_config_inner(shell: &Shell, zkstack_args: &ZkStackGlobalArgs) -> anyhow::Result<()> { + if let Some(name) = &zkstack_args.chain { if let Ok(config) = EcosystemConfig::from_file(shell) { let chains = config.list_of_chains(); if !chains.contains(name) { @@ -172,9 +169,9 @@ fn init_global_config_inner( } } init_global_config(GlobalConfig { - verbose: inception_args.verbose, - chain_name: inception_args.chain.clone(), - ignore_prerequisites: inception_args.ignore_prerequisites, + verbose: zkstack_args.verbose, + chain_name: zkstack_args.chain.clone(), + ignore_prerequisites: zkstack_args.ignore_prerequisites, }); Ok(()) }