yggdrasil-cli 0.2.5

Yggdrasil is a project flattener and diff engine that turns any subset of your codebase into a single AI-ready codex (index + contents), or compares snapshots with annotated diffs.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::io::Write;

use crate::types::{FileEntry, GroupedMatches};

pub trait OutputFormatter {
    fn print_preamble(&self, root: &str, out: &mut dyn Write);
    fn print_index(&self, files: &Vec<FileEntry>, out: &mut dyn Write);
    fn print_contents(&self, files: &Vec<FileEntry>, out: &mut dyn Write);
}

pub trait DiffFormatter {
    fn print_preamble(&self, out: &mut dyn Write);
    fn print_index(&self, groups: &Vec<GroupedMatches>, out: &mut dyn Write);
    fn print_contents(&self, groups: &Vec<GroupedMatches>, out: &mut dyn Write);
}