(&self)
| 90 | |
| 91 | impl Command for List { |
| 92 | fn run(&self) -> CliResult<()> { |
| 93 | // Open the identity store |
| 94 | let store = IdentityStore::open_default().map_err(|e| { |
| 95 | CliError::Internal(anyhow::anyhow!("Failed to open identity store: {}", e)) |
| 96 | })?; |
| 97 | |
| 98 | // Get the default identity ID for marking |
| 99 | let default_id = store.get_default().ok().flatten().map(|i| i.id); |
| 100 | |
| 101 | // List identities with filter |
| 102 | let filter = self.build_filter(); |
| 103 | let identities = store |
| 104 | .list_filtered(&filter) |
| 105 | .map_err(|e| CliError::Internal(anyhow::anyhow!("Failed to list identities: {}", e)))?; |
| 106 | |
| 107 | if identities.is_empty() { |
| 108 | print_info("No identities found"); |
| 109 | println!(); |
| 110 | print_hint("Create a new identity with: atomic identity new <name> --email <email>"); |
| 111 | return Ok(()); |
| 112 | } |
| 113 | |
| 114 | // Output based on format |
| 115 | match self.format.to_lowercase().as_str() { |
| 116 | "json" => self.output_json(&identities, default_id.as_ref()), |
| 117 | _ => self.output_table(&identities, default_id.as_ref()), |
| 118 | } |
| 119 | |
| 120 | Ok(()) |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | impl List { |
nothing calls this directly
no test coverage detected