use std::env;
use std::path::PathBuf;
fn main() {
let mut no_banner = false;
let mut root = None;
for argument in env::args_os().skip(1) {
if argument == "--no-banner" {
no_banner = true;
} else if root.is_none() {
root = Some(PathBuf::from(argument));
}
}
let root = root.unwrap_or_else(|| {
env::current_dir().expect("current directory")
});
let result = jlint::lint_with_options(
&root,
&jlint::LintOptions { no_banner },
);
if result.errors > 0 {
std::process::exit(1);
}
}