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

Method print_change

atomic-cli/src/commands/change/command.rs:393–409  ·  view source on GitHub ↗

Print the change in the configured format.

(
        &self,
        change: &Change,
        hash: &Hash,
        sequence: Option<u64>,
        data: &ChangeRenderData,
    )

Source from the content-addressed store, hash-verified

391
392 /// Print the change in the configured format.
393 pub(crate) fn print_change(
394 &self,
395 change: &Change,
396 hash: &Hash,
397 sequence: Option<u64>,
398 data: &ChangeRenderData,
399 ) {
400 let output = match self.format {
401 ChangeFormat::Default => self.format_default(change, hash, sequence, data),
402 ChangeFormat::Short => self.format_short(change, hash, sequence),
403 ChangeFormat::Json => {
404 let ledger = self.load_json_ledger(&data.ledger_graphs);
405 self.format_json(change, hash, sequence, ledger)
406 }
407 };
408 print!("{}", output);
409 }
410}
411
412/// Extract a human-readable one-liner from a provenance node's detail JSON.

Callers 2

changeFunction · 0.80
runMethod · 0.80

Calls 4

load_json_ledgerMethod · 0.80
format_defaultMethod · 0.45
format_shortMethod · 0.45
format_jsonMethod · 0.45

Tested by

no test coverage detected