nondestructive 0.0.28

Nondestructive editing over various file formats.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::env;
use std::fs;

use anyhow::{Context, Result};

use nondestructive::yaml;

fn main() -> Result<()> {
    let mut args = env::args().skip(1);
    let path = args.next().context("Missing path argument")?;

    let bytes = fs::read(&path).with_context(|| path.clone())?;
    let doc = yaml::from_slice(bytes).with_context(|| path.clone())?;

    print!("{doc}");
    Ok(())
}