MCPcopy Create free account
hub / github.com/emwalker/digraph / main

Function main

backend/src/bin/show.rs:134–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

132
133#[tokio::main]
134async 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}

Callers

nothing calls this directly

Calls 5

parse_pathFunction · 0.85
acceptMethod · 0.80
as_bytesMethod · 0.80
parse_argsFunction · 0.70
fetchMethod · 0.45

Tested by

no test coverage detected