1use clap::{Args, Parser};
2
3#[derive(Args, Clone)]
6pub struct FilterTreeArgs {
7 pub treeish: String,
9
10 #[arg(required = true)]
12 pub patterns: Vec<String>,
13
14 #[arg(short, long, value_enum, default_value = "tree-sha")]
16 pub format: OutputFormat,
17}
18
19#[derive(Parser)]
20#[command(name = "git filter-tree", bin_name = "git filter-tree")]
21#[command(author, version, about = "Filter Git tree entries by gitattributes-style patterns", long_about = None)]
22pub struct Cli {
23 #[command(flatten)]
24 pub args: FilterTreeArgs,
25}
26
27#[derive(Clone, Copy, clap::ValueEnum)]
28pub enum OutputFormat {
29 TreeSha,
31 Entries,
33 Detailed,
35}