1use std::path::PathBuf;
4
5use clap::{Args, Parser, Subcommand};
6
7#[derive(Parser, Debug)]
9#[command(name = "loq", version, about = "Enforce file size constraints")]
10pub struct Cli {
11 #[command(subcommand)]
13 pub command: Option<Command>,
14
15 #[arg(short = 'v', long = "verbose", global = true)]
17 pub verbose: bool,
18
19 #[arg(long = "config", value_name = "PATH", global = true)]
21 pub config: Option<PathBuf>,
22}
23
24#[derive(Subcommand, Debug, Clone)]
26pub enum Command {
27 Check(CheckArgs),
29 Init(InitArgs),
31 Baseline(BaselineArgs),
33}
34
35#[derive(Args, Debug, Clone)]
37pub struct CheckArgs {
38 #[arg(value_name = "PATH", allow_hyphen_values = true)]
40 pub paths: Vec<PathBuf>,
41
42 #[arg(long = "no-cache")]
44 pub no_cache: bool,
45}
46
47#[derive(Args, Debug, Clone)]
49pub struct InitArgs {}
50
51#[derive(Args, Debug, Clone)]
53pub struct BaselineArgs {
54 #[arg(long = "threshold")]
56 pub threshold: Option<usize>,
57}