use anyhow::Result;
use clap::{Parser, Subcommand};
use std::process::ExitCode;
pub mod closed_nonempty;
pub mod transfers;
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
pub struct Args {
#[command(subcommand)]
pub lint: LintKind,
}
#[derive(Subcommand, Debug)]
pub enum LintKind {
Transfers(transfers::Args),
ClosedNonempty(closed_nonempty::Args),
}
pub fn run(args: &Args) -> Result<ExitCode> {
match &args.lint {
LintKind::Transfers(t_args) => transfers::run(t_args),
LintKind::ClosedNonempty(c_args) => closed_nonempty::run(c_args),
}
}
pub fn run_with_writer<W: std::io::Write>(args: &Args, out: &mut W) -> Result<ExitCode> {
match &args.lint {
LintKind::Transfers(t_args) => transfers::run_with_writer(t_args, out),
LintKind::ClosedNonempty(c_args) => closed_nonempty::run_with_writer(c_args, out),
}
}