MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / run

Method run

atomic-cli/src/commands/identity/show.rs:69–95  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

67
68impl Command for Show {
69 fn run(&self) -> CliResult<()> {
70 // Open the identity store
71 let store = IdentityStore::open_default().map_err(|e| {
72 CliError::Internal(anyhow::anyhow!("Failed to open identity store: {}", e))
73 })?;
74
75 // Load the identity by name
76 let identity = store
77 .load_by_name(&self.name)
78 .map_err(|_| CliError::IdentityNotFound(self.name.clone()))?;
79
80 // Check if this is the default identity
81 let is_default = store
82 .get_default()
83 .ok()
84 .flatten()
85 .map(|d| d.id == identity.id)
86 .unwrap_or(false);
87
88 // Output based on format
89 match self.format.to_lowercase().as_str() {
90 "json" => self.output_json(&identity, is_default),
91 _ => self.output_default(&identity, is_default),
92 }
93
94 Ok(())
95 }
96}
97
98impl Show {

Callers

nothing calls this directly

Calls 6

load_by_nameMethod · 0.80
cloneMethod · 0.45
get_defaultMethod · 0.45
as_strMethod · 0.45
output_jsonMethod · 0.45
output_defaultMethod · 0.45

Tested by

no test coverage detected