1use clap::{Parser, Subcommand};
2use std::path::PathBuf;
3
4#[derive(Parser)]
5#[command(name = "flop")]
6#[command(about = "Interactively flip debug output statements")]
7#[command(long_about = "\
8Interactively flip debug output statements
9
10EXAMPLES:
11 flop on Disable all output (interactive)
12 flop on -d Disable debug output only (interactive)
13 flop on -y Disable all output (batch, with confirmation)
14 flop on -dy Disable debug output only (batch)
15 flop off -p Preview what would be enabled
16 flop delete -d src/ Delete debug statements in src/ (interactive)
17
18COMMON OPTIONS:
19 -d, --debug Only process output statements containing 'debug' keyword
20 -y, --yes Skip interactive selection (batch mode, confirmation still required)
21 -p, --preview Preview mode - show what would be changed without modifying files
22")]
23pub struct Cli {
24 #[command(subcommand)]
25 pub command: Commands,
26}
27
28#[derive(Subcommand)]
29pub enum Commands {
30 Off {
32 path: Option<PathBuf>,
34 #[arg(short, long)]
36 debug: bool,
37 #[arg(short, long)]
39 yes: bool,
40 #[arg(short, long)]
42 preview: bool,
43 },
44 On {
46 path: Option<PathBuf>,
48 #[arg(short, long)]
50 debug: bool,
51 #[arg(short, long)]
53 yes: bool,
54 #[arg(short, long)]
56 preview: bool,
57 },
58 Delete {
60 path: Option<PathBuf>,
62 #[arg(short, long)]
64 debug: bool,
65 #[arg(short, long)]
67 yes: bool,
68 #[arg(short, long)]
70 preview: bool,
71 },
72}