chadtmiller.com/knotless

Git hosted in your atproto account, on any stock PDS, fast enough for agents.

git clone knotless://chadtmiller.com/knotless

needs the knotless git helper. set it up

17 lines · 484 B Raw History
use std::io::Read;
use tally::count;

fn main() {
    let path = std::env::args().nth(1);
    let text = match &path {
        Some(path) => std::fs::read_to_string(path).unwrap(),
        None => {
            let mut text = String::new();
            std::io::stdin().read_to_string(&mut text).unwrap();
            text
        }
    };
    let c = count(&text);
    let name = path.as_deref().unwrap_or("-");
    println!("{:>8} {:>8} {:>8} {name}", c.lines, c.words, c.bytes);
}