use kbdgen::{Load, ProjectBundle};
use snafu::ErrorCompat;

fn main() {
    let path = std::env::args()
        .nth(1)
        .expect("Pass path to `.kbdgen` bundle as argument");

    match ProjectBundle::load(&path) {
        Ok(bundle) => eprintln!("{:#?}", bundle),
        Err(e) => {
            eprintln!("An error occurred: {}", e);
            if let Some(backtrace) = ErrorCompat::backtrace(&e) {
                println!("{}", backtrace);
            }
        }
    }
}

Add example to load and print bundle
Add example to load and print bundle

Also allows quick testing if local kbdgen bundles can be parsed, e.g.
like this:

    fd -0 .kbdgen ../giellalt/ | xargs -0 -I % cargo r --example load_bundle -- %
