43 lines
1.3 KiB
Rust
43 lines
1.3 KiB
Rust
// Copyright (c) 2024 Marceline Cramer
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
//
|
|
// This file is part of Saul.
|
|
//
|
|
// Saul is free software: you can redistribute it and/or modify it under the
|
|
// terms of the GNU Affero General Public License as published by the Free
|
|
// Software Foundation, either version 3 of the License, or (at your option) any
|
|
// later version.
|
|
//
|
|
// Saul is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
// details.
|
|
//
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
// along with Saul. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
use std::{fs::File, io::BufReader, path::PathBuf};
|
|
|
|
use clap::Parser;
|
|
|
|
mod parse;
|
|
|
|
#[derive(Debug, Parser)]
|
|
struct Args {
|
|
/// A list of files to validate.
|
|
pub input: Vec<PathBuf>,
|
|
}
|
|
|
|
fn main() {
|
|
let args = Args::parse();
|
|
|
|
for input in args.input {
|
|
let f = File::open(&input).unwrap();
|
|
let mut read = BufReader::new(f);
|
|
let lines = parse::Language::RUST.read_header(&mut read).unwrap();
|
|
let header = parse::Header::parse(lines).unwrap();
|
|
|
|
println!("{:?}: {:#?}", input, header);
|
|
}
|
|
}
|