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

Method hint_other_views

atomic-cli/src/commands/clone/command.rs:430–453  ·  view source on GitHub ↗

Print a hint listing the other views available on the remote. Best-effort: silent if the server has no inventory endpoint or only the primary view.

(&self, remote: &HttpRemote)

Source from the content-addressed store, hash-verified

428 /// Best-effort: silent if the server has no inventory endpoint or only
429 /// the primary view.
430 async fn hint_other_views(&self, remote: &HttpRemote) {
431 let Ok(remote_views) = remote.list_views().await else {
432 return;
433 };
434 let others: Vec<String> = remote_views
435 .into_iter()
436 .map(|v| v.name)
437 .filter(|name| name != &self.view)
438 .collect();
439 if others.is_empty() {
440 return;
441 }
442
443 print_blank();
444 print_hint(&format!(
445 "This remote has {} other {}: {}",
446 others.len(),
447 if others.len() == 1 { "view" } else { "views" },
448 others.join(", ")
449 ));
450 print_hint(
451 "Clone them too with 'atomic clone --all-views', or list them with 'atomic view list --remote'.",
452 );
453 }
454
455 /// Async implementation of the clone command.
456 ///

Callers 1

run_asyncMethod · 0.80

Calls 5

print_blankFunction · 0.85
print_hintFunction · 0.85
list_viewsMethod · 0.45
into_iterMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected