From 4d283cad42e259655e8b5d197beb8a216fe3770b Mon Sep 17 00:00:00 2001 From: Manuel Mauro Date: Fri, 18 Oct 2024 11:32:12 +0200 Subject: [PATCH] chore(zkstack_cli): Rename inception to zkstack (#3123) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Rename `Inception` to `ZkStack`, and `InceptionSubcommands` to `ZkStackSubcommands`. ## Why ❔ ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. --- 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 b2e4af21cef..404ac893810 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) {