git_set_attr/cli.rs
1use clap::Parser;
2use std::path::PathBuf;
3
4#[derive(Parser)]
5#[command(name = "git set-attr", bin_name = "git set-attr")]
6#[command(author, version, about = "Set Git attributes via code, or from the command-line.", long_about = None)]
7pub struct Cli {
8 /// Gitattributes-style pattern (e.g. "*.txt", "path/to/*.bin")
9 pub pattern: String,
10
11 /// Attributes to set (e.g. "diff", "-text", "filter=lfs")
12 #[arg(required = true)]
13 pub attributes: Vec<String>,
14
15 /// Path to the .gitattributes file to modify
16 #[arg(short, long)]
17 pub file: Option<PathBuf>,
18}