findit_cli/
cli_args.rs

1use std::path::PathBuf;
2
3use clap::Parser;
4
5/// Find files
6#[derive(Parser, Debug)]
7#[command(version, about, long_about = None)]
8pub struct CliArgs {
9    /// Root to find from, default to current directory
10    pub(crate) root: Option<PathBuf>,
11
12    /// Which files to consider (by default, all of them)
13    #[arg(short = 'w', long = "where", value_name = "FILTER")]
14    pub(crate) filter: Vec<String>,
15
16    /// How to order the files
17    #[arg(short, long, value_name = "ORDER BY")]
18    pub(crate) order_by: Option<String>,
19
20    /// Max depth
21    #[arg(short = 'x', long)]
22    pub(crate) max_depth: Option<usize>,
23
24    /// Min depth
25    #[arg(short = 'n', long)]
26    pub(crate) min_depth: Option<usize>,
27
28    /// Limit the number of files
29    #[arg(short, long)]
30    pub(crate) limit: Option<usize>,
31
32    /// What to display on each file (default will display the path)
33    #[arg(short, long)]
34    pub(crate) display: Option<String>,
35
36    /// Start of string interpolation in the display
37    #[arg(long, default_value = "`")]
38    pub(crate) interpolation_start: String,
39
40    /// End of string interpolation in the display
41    #[arg(long, default_value = "`")]
42    pub(crate) interpolation_end: String,
43
44    /// Consider nodes before their parent
45    #[arg(long, default_value_t = false)]
46    pub(crate) node_first: bool,
47}