(root: &std::path::Path, json: bool)
| 69 | |
| 70 | impl Repo { |
| 71 | fn show(root: &std::path::Path, json: bool) -> CliResult<()> { |
| 72 | let service = Service::open_root(root)?.ok_or_else(|| CliError::InvalidArgument { |
| 73 | message: "repository identity inspection requires a local repository service".into(), |
| 74 | })?; |
| 75 | let record = service.get_project_identity(pb::GetProjectIdentityRequest { |
| 76 | repository: Some(service.reference.clone()), |
| 77 | })?; |
| 78 | if json { |
| 79 | println!( |
| 80 | "{}", |
| 81 | serde_json::to_string_pretty(&serde_json::json!({ |
| 82 | "project": record.project, "urn": record.urn, "created": record.created, |
| 83 | "minted": record.minted, "signed_by": record.signed_by, "hash": record.hash, |
| 84 | })) |
| 85 | .expect("JSON serialization") |
| 86 | ); |
| 87 | } else { |
| 88 | println!( |
| 89 | "project: {}\nurn: {}\ncreated: {}\nminted: {}\nsigned by: {}", |
| 90 | record.project, |
| 91 | record.urn, |
| 92 | record.created, |
| 93 | record.minted, |
| 94 | record.signed_by.as_deref().unwrap_or("unsigned") |
| 95 | ); |
| 96 | } |
| 97 | Ok(()) |
| 98 | } |
| 99 | |
| 100 | /// `repo identity adopt` — fetch the remote binding and force-adopt it. |
| 101 | fn adopt(root: &std::path::Path, remote: Option<&str>, json: bool) -> CliResult<()> { |
nothing calls this directly
no test coverage detected