From fc7b27871225b04ab98e7c8b3a10e2a380616d22 Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Thu, 17 Oct 2024 15:18:16 +0200 Subject: [PATCH] refactor: rename inception to zkstack --- zkstack_cli/crates/zkstack/src/main.rs | 46 ++++++++++++-------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/zkstack_cli/crates/zkstack/src/main.rs b/zkstack_cli/crates/zkstack/src/main.rs index 987de555ecf..177ddc11260 100644 --- a/zkstack_cli/crates/zkstack/src/main.rs +++ b/zkstack_cli/crates/zkstack/src/main.rs @@ -32,15 +32,15 @@ mod utils; version = version_message(env!("CARGO_PKG_VERSION")), about )] -struct Inception { +struct ZkStack { #[command(subcommand)] - command: InceptionSubcommands, + command: ZkStackSubcommands, #[clap(flatten)] - global: InceptionGlobalArgs, + global: ZkStackGlobalArgs, } #[derive(Subcommand, Debug)] -pub enum InceptionSubcommands { +pub enum ZkStackSubcommands { /// Ecosystem related commands #[command(subcommand, alias = "e")] Ecosystem(Box), @@ -80,7 +80,7 @@ pub enum InceptionSubcommands { #[derive(Parser, Debug)] #[clap(next_help_heading = "Global options")] -struct InceptionGlobalArgs { +struct ZkStackGlobalArgs { /// Verbose mode #[clap(short, long, global = true)] verbose: bool, @@ -98,7 +98,7 @@ 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 = Inception::parse(); + let inception_args = ZkStack::parse(); init_prompt_theme(); @@ -123,26 +123,24 @@ async fn main() -> anyhow::Result<()> { Ok(()) } -async fn run_subcommand(inception_args: Inception, shell: &Shell) -> anyhow::Result<()> { +async fn run_subcommand(inception_args: ZkStack, shell: &Shell) -> anyhow::Result<()> { match inception_args.command { - InceptionSubcommands::Ecosystem(args) => commands::ecosystem::run(shell, *args).await?, - InceptionSubcommands::Chain(args) => commands::chain::run(shell, *args).await?, - InceptionSubcommands::Dev(args) => commands::dev::run(shell, args).await?, - InceptionSubcommands::Prover(args) => commands::prover::run(shell, args).await?, - InceptionSubcommands::Server(args) => commands::server::run(shell, args)?, - InceptionSubcommands::Containers(args) => commands::containers::run(shell, args)?, - InceptionSubcommands::ExternalNode(args) => { - commands::external_node::run(shell, args).await? - } - InceptionSubcommands::ContractVerifier(args) => { + ZkStackSubcommands::Ecosystem(args) => commands::ecosystem::run(shell, *args).await?, + ZkStackSubcommands::Chain(args) => commands::chain::run(shell, *args).await?, + ZkStackSubcommands::Dev(args) => commands::dev::run(shell, args).await?, + ZkStackSubcommands::Prover(args) => commands::prover::run(shell, args).await?, + ZkStackSubcommands::Server(args) => commands::server::run(shell, args)?, + ZkStackSubcommands::Containers(args) => commands::containers::run(shell, args)?, + ZkStackSubcommands::ExternalNode(args) => commands::external_node::run(shell, args).await?, + ZkStackSubcommands::ContractVerifier(args) => { commands::contract_verifier::run(shell, args).await? } - InceptionSubcommands::Explorer(args) => commands::explorer::run(shell, args).await?, - InceptionSubcommands::Consensus(cmd) => cmd.run(shell).await?, - InceptionSubcommands::Portal => commands::portal::run(shell).await?, - InceptionSubcommands::Update(args) => commands::update::run(shell, args).await?, - InceptionSubcommands::Markdown => { - clap_markdown::print_help_markdown::(); + ZkStackSubcommands::Explorer(args) => commands::explorer::run(shell, args).await?, + ZkStackSubcommands::Consensus(cmd) => cmd.run(shell).await?, + ZkStackSubcommands::Portal => commands::portal::run(shell).await?, + ZkStackSubcommands::Update(args) => commands::update::run(shell, args).await?, + ZkStackSubcommands::Markdown => { + clap_markdown::print_help_markdown::(); } } Ok(()) @@ -150,7 +148,7 @@ async fn run_subcommand(inception_args: Inception, shell: &Shell) -> anyhow::Res fn init_global_config_inner( shell: &Shell, - inception_args: &InceptionGlobalArgs, + inception_args: &ZkStackGlobalArgs, ) -> anyhow::Result<()> { if let Some(name) = &inception_args.chain { if let Ok(config) = EcosystemConfig::from_file(shell) {