()
| 132 | |
| 133 | #[tokio::main] |
| 134 | async fn main() -> Result<()> { |
| 135 | let opts = parse_args(); |
| 136 | let (root_directory, repo_id, oid) = parse_path(&opts.filename)?; |
| 137 | |
| 138 | let actor = Arc::new(Viewer::service_account()); |
| 139 | let mut git = Client::new(actor, &root_directory, Timespec); |
| 140 | let object = git.fetch(repo_id, &oid); |
| 141 | if object.is_none() { |
| 142 | return Err(Error::NotFound(format!( |
| 143 | "{root_directory} does not contain {repo_id}/{oid}" |
| 144 | ))); |
| 145 | } |
| 146 | let object = object.unwrap(); |
| 147 | |
| 148 | let mut output = ConsoleOutput { |
| 149 | buf: String::new(), |
| 150 | git: &mut git, |
| 151 | repo_id, |
| 152 | }; |
| 153 | |
| 154 | object.accept(&mut output)?; |
| 155 | io::stdout().write_all(output.as_bytes())?; |
| 156 | |
| 157 | Ok(()) |
| 158 | } |
nothing calls this directly
no test coverage detected