(&self)
| 67 | |
| 68 | impl 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 | |
| 98 | impl Show { |
nothing calls this directly
no test coverage detected