miniconf-parser 0.1.3

Pest-powered parser and CLI for the MiniConf configuration format.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::env;
use std::fs;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let path = env::args().nth(1).expect("provide a file path");
    let contents = fs::read_to_string(&path)?;
    let document = miniconf_parser::parse_str(&contents)?;

    println!("Parsed sections:");
    for (name, section) in document.sections() {
        println!("[{name}] ({} entries)", section.entries.len());
    }

    Ok(())
}