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
20#[derive(Subcommand, Debug, Clone)]
22pub enum Command {
23 Check(CheckArgs),
25 Init(InitArgs),
27 Baseline(BaselineArgs),
29 AcceptDefeat(AcceptDefeatArgs),
31}
32
33#[derive(Args, Debug, Clone)]
35pub struct CheckArgs {
36 #[arg(value_name = "PATH", allow_hyphen_values = true)]
38 pub paths: Vec<PathBuf>,
39
40 #[arg(long = "no-cache")]
42 pub no_cache: bool,
43}
44
45#[derive(Args, Debug, Clone)]
47pub struct InitArgs {}
48
49#[derive(Args, Debug, Clone)]
51pub struct BaselineArgs {
52 #[arg(long = "threshold")]
54 pub threshold: Option<usize>,
55
56 #[arg(long = "allow-growth")]
58 pub allow_growth: bool,
59}
60
61#[derive(Args, Debug, Clone)]
63pub struct AcceptDefeatArgs {
64 #[arg(value_name = "FILE")]
66 pub files: Vec<PathBuf>,
67
68 #[arg(long = "buffer", default_value_t = 100)]
70 pub buffer: usize,
71}