soroban-cli 26.0.0

Soroban CLI
Documentation
use crate::config::{address::NetworkName, locator, network, secret};

#[derive(thiserror::Error, Debug)]
pub enum Error {
    #[error(transparent)]
    Secret(#[from] secret::Error),

    #[error(transparent)]
    Config(#[from] locator::Error),
}

#[derive(Debug, clap::Parser, Clone)]
#[group(skip)]
pub struct Cmd {
    /// Name of network
    pub name: NetworkName,

    #[command(flatten)]
    pub network: network::Network,

    #[command(flatten)]
    pub config_locator: locator::Args,
}

impl Cmd {
    pub fn run(&self) -> Result<(), Error> {
        self.config_locator
            .write_network(&self.name, &self.network)?;
        Ok(())
    }
}