nix setup

This commit is contained in:
Robin Appelman 2024-07-20 17:11:20 +02:00
commit 20464a8f68
8 changed files with 46 additions and 140 deletions

View file

@ -1,19 +1,13 @@
use clap::Parser;
use logging_extractor::error::Error;
use logging_extractor::extract_dir;
use std::env::args;
use std::fs::canonicalize;
use std::io::stdout;
use std::path::PathBuf;
#[derive(Parser, Debug)]
struct Args {
root: PathBuf,
}
fn main() -> Result<(), Error> {
let args = Args::parse();
let root = canonicalize(&args.root).map_err(|err| Error::RealPath {
path: args.root,
let root = args().nth(1).expect("no root provided");
let root = canonicalize(&root).map_err(|err| Error::RealPath {
path: root.into(),
err,
})?;
let root = root.to_str().expect("non utf8 root path");