Lints and suggestions for the Nix programming language
1use clap::Parser;
2
3#[rustfmt::skip]
4use statix::{
5 config::{Opts, SubCommand},
6 err::StatixErr,
7 lint, fix, explain, dump, list,
8};
9
10fn main_() -> Result<(), StatixErr> {
11 let opts = Opts::parse();
12 match opts.cmd {
13 SubCommand::Check(config) => lint::main::main(&config),
14 SubCommand::Fix(config) => fix::main::all(&config),
15 SubCommand::Single(config) => fix::main::single(&config),
16 SubCommand::Explain(config) => explain::main::main(&config),
17 SubCommand::Dump(_) => dump::main::main(),
18 SubCommand::List(_) => list::main::main(),
19 }
20}
21
22fn main() {
23 if let Err(e) = main_() {
24 eprintln!("{e}");
25 }
26}