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

Method print_name_status

atomic-cli/src/commands/diff/format.rs:452–475  ·  view source on GitHub ↗

Print file names with status.

(
        &self,
        file_diffs: &[FileDiff],
        config: &DiffOutputConfig,
    )

Source from the content-addressed store, hash-verified

450
451 /// Print file names with status.
452 pub(super) fn print_name_status(
453 &self,
454 file_diffs: &[FileDiff],
455 config: &DiffOutputConfig,
456 ) -> CliResult<()> {
457 for file_diff in file_diffs {
458 let status_char = file_diff.status.status_char();
459 let path = file_diff.display_path();
460
461 if config.color {
462 let status_str = status_char.to_string();
463 let styled_status = match file_diff.status {
464 FileChangeStatus::Added => added(&status_str),
465 FileChangeStatus::Deleted => deleted(&status_str),
466 FileChangeStatus::Modified => modified(&status_str),
467 _ => info(&status_str),
468 };
469 println!("{} {}", styled_status, style_path(path));
470 } else {
471 println!("{} {}", status_char, path);
472 }
473 }
474 Ok(())
475 }
476}

Callers 4

runMethod · 0.80

Calls 6

addedFunction · 0.85
deletedFunction · 0.85
modifiedFunction · 0.85
infoFunction · 0.85
status_charMethod · 0.80
display_pathMethod · 0.80

Tested by

no test coverage detected