Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(zkstack_cli): Rename inception to zkstack #3123

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 22 additions & 24 deletions zkstack_cli/crates/zkstack/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<EcosystemCommands>),
Expand Down Expand Up @@ -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,
Expand All @@ -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();

Expand All @@ -123,34 +123,32 @@ 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::<Inception>();
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::<ZkStack>();
}
}
Ok(())
}

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) {
Expand Down
Loading