Skip to content

Commit

Permalink
Merge branch 'main' into reupload
Browse files Browse the repository at this point in the history
  • Loading branch information
sisuresh authored May 1, 2024
2 parents 4bd13e3 + 8c04c94 commit 967cd15
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 372 deletions.
22 changes: 1 addition & 21 deletions cmd/soroban-cli/src/commands/config/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::path::PathBuf;

use clap::{arg, command, Parser};
use clap::{arg, command};
use serde::{Deserialize, Serialize};

use crate::Pwd;
Expand All @@ -12,16 +12,6 @@ use super::{keys, network};
pub mod locator;
pub mod secret;

#[derive(Debug, Parser)]
pub enum Cmd {
/// Configure different networks. Depraecated, use `soroban network` instead.
#[command(subcommand)]
Network(network::Cmd),
/// Identity management. Deprecated, use `soroban keys` instead.
#[command(subcommand)]
Identity(keys::Cmd),
}

#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error(transparent)]
Expand All @@ -34,16 +24,6 @@ pub enum Error {
Config(#[from] locator::Error),
}

impl Cmd {
pub async fn run(&self) -> Result<(), Error> {
match &self {
Cmd::Identity(identity) => identity.run().await?,
Cmd::Network(network) => network.run().await?,
}
Ok(())
}
}

#[derive(Debug, clap::Args, Clone, Default)]
#[group(skip)]
pub struct Args {
Expand Down
9 changes: 4 additions & 5 deletions cmd/soroban-cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ impl Root {
Cmd::Contract(contract) => contract.run(&self.global_args).await?,
Cmd::Events(events) => events.run().await?,
Cmd::Lab(lab) => lab.run()?,
Cmd::Xdr(xdr) => xdr.run()?,
Cmd::Network(network) => network.run().await?,
Cmd::Version(version) => version.run(),
Cmd::Keys(id) => id.run().await?,
Cmd::Config(c) => c.run().await?,
};
Ok(())
}
Expand All @@ -118,9 +118,6 @@ pub enum Cmd {
/// Print shell completion code for the specified shell.
#[command(long_about = completion::LONG_ABOUT)]
Completion(completion::Cmd),
/// Deprecated, use `soroban keys` and `soroban network` instead
#[command(subcommand)]
Config(config::Cmd),
/// Tools for smart contract developers
#[command(subcommand)]
Contract(contract::Cmd),
Expand All @@ -132,6 +129,8 @@ pub enum Cmd {
/// Experiment with early features and expert tools
#[command(subcommand)]
Lab(lab::Cmd),
/// Decode and encode XDR
Xdr(stellar_xdr::cli::Root),
/// Start and configure networks
#[command(subcommand)]
Network(network::Cmd),
Expand All @@ -151,7 +150,7 @@ pub enum Error {
#[error(transparent)]
Lab(#[from] lab::Error),
#[error(transparent)]
Config(#[from] config::Error),
Xdr(#[from] stellar_xdr::cli::Error),
#[error(transparent)]
Clap(#[from] clap::error::Error),
#[error(transparent)]
Expand Down
Loading

0 comments on commit 967cd15

Please sign in to comment.