use clap::Parser;
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
path: String,
#[arg(short, long, default_value = "*")]
matching: String,
#[arg(short, long)]
subfolders: usize,
#[arg(short, long, default_value = "group")]
prefix: String,
#[arg(long, default_value = "numbers")]
suffix: String,
#[arg(short, long)]
recursive: bool,
#[arg(long)]
dry_run: bool,
#[arg(short, long)]
force: bool,
}
fn main() -> anyhow::Result<()> {
let args = Args::parse();
if args.subfolders == 0 {
anyhow::bail!("--subfolders must be greater than zero");
}
refolder::run(
&args.path,
&args.matching,
args.subfolders,
&args.prefix,
&args.suffix,
args.recursive,
args.dry_run,
args.force,
)
}