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

Method output_default

atomic-cli/src/commands/identity/show.rs:100–164  ·  view source on GitHub ↗

Output identity details in human-readable format.

(&self, identity: &atomic_identity::Identity, is_default: bool)

Source from the content-addressed store, hash-verified

98impl Show {
99 /// Output identity details in human-readable format.
100 fn output_default(&self, identity: &atomic_identity::Identity, is_default: bool) {
101 print_section(&format!("Identity: {}", identity.name));
102 println!();
103
104 // Basic info
105 println!(" ID: {}", identity.id.to_base32());
106
107 if let Some(email) = &identity.email {
108 println!(" Email: {}", email);
109 }
110
111 println!(
112 " Type: {}",
113 super::format_identity_type(&identity.identity_type)
114 );
115 println!(" Usage: {}", super::format_usage(&identity.usage));
116
117 // Metadata
118 println!(
119 " Created: {}",
120 identity.metadata.created_at.format("%Y-%m-%d %H:%M:%S UTC")
121 );
122
123 if let Some(modified) = identity.metadata.modified_at {
124 println!(
125 " Modified: {}",
126 modified.format("%Y-%m-%d %H:%M:%S UTC")
127 );
128 }
129
130 if let Some(expires) = identity.metadata.expires_at {
131 let expired = identity.is_expired();
132 println!(
133 " Expires: {} {}",
134 expires.format("%Y-%m-%d %H:%M:%S UTC"),
135 if expired { "(EXPIRED)" } else { "" }
136 );
137 }
138
139 if let Some(description) = &identity.metadata.description {
140 println!(" Description: {}", description);
141 }
142
143 // Delegation info
144 if let Some(delegated_by) = &identity.delegated_by {
145 println!(" Delegated by: {}", delegated_by.short());
146 }
147
148 // Public key
149 println!();
150 if self.show_public_key {
151 println!(" Public Key: {}", identity.public_key_base32());
152 } else {
153 println!(
154 " Public Key: {}... (use --show-public-key for full key)",
155 &identity.public_key_base32()[..24]
156 );
157 }

Callers 1

runMethod · 0.45

Calls 3

print_sectionFunction · 0.85
print_infoFunction · 0.85
is_expiredMethod · 0.45

Tested by

no test coverage detected