Skip to main content

soroban_cli/commands/keys/
unset.rs

1use crate::{commands::global, config::locator, print::Print};
2
3#[derive(thiserror::Error, Debug)]
4pub enum Error {
5    #[error(transparent)]
6    Config(#[from] locator::Error),
7}
8
9#[derive(Debug, clap::Parser, Clone)]
10#[group(skip)]
11pub struct Cmd {
12    #[command(flatten)]
13    pub config_locator: locator::Args,
14}
15
16impl Cmd {
17    pub fn run(&self, global_args: &global::Args) -> Result<(), Error> {
18        let printer = Print::new(global_args.quiet);
19
20        self.config_locator.unset_default_identity()?;
21
22        printer.infoln("The default source account has been unset".to_string());
23
24        Ok(())
25    }
26}