MCPcopy Create free account
hub / github.com/bitfield/up2code / main

Function main

src/main.rs:5–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3use up2code::{diff, listings};
4
5fn main() -> anyhow::Result<()> {
6 let paths: Vec<String> = env::args().skip(1).collect();
7 if paths.is_empty() {
8 eprintln!("Usage: up2code [PATH, ...]");
9 return Ok(());
10 }
11 for path in paths {
12 for listing in listings(&path)? {
13 let listing = listing.check()?;
14 if let Some(diff) = diff(&listing.local, &listing.remote) {
15 println!("{path}: {} - {}", listing.title, listing.url);
16 println!("{diff}");
17 }
18 // Sleep to avoid hitting GitHub API rate limit
19 thread::sleep(Duration::from_secs(1));
20 }
21 }
22 Ok(())
23}

Callers

nothing calls this directly

Calls 3

listingsFunction · 0.85
diffFunction · 0.85
checkMethod · 0.80

Tested by

no test coverage detected