mojique 0.1.1

A safe Rust wrapper and pool implementation around libmagic
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::path::PathBuf;

use mojique::{Config, DefaultConfig};

fn main() -> anyhow::Result<()> {
    let path: PathBuf = std::env::args_os()
        .nth(1)
        .ok_or_else(|| anyhow::anyhow!("no path given as a command line argument"))?
        .into();

    let mut handle = DefaultConfig::default().build_handle()?;
    let desc = handle.file(path)?;

    println!("{desc}");

    Ok(())
}