ent_tree/
cli.rs

1use clap::{Parser, ValueEnum};
2
3
4
5#[derive(Parser, Debug, Clone, Default)]
6pub struct Cli {
7
8    /// Path to the directory to search. Defaults to the current working directory
9    pub path: Option<String>,
10
11    /// Maximum depth to search
12    #[clap(short, long)]
13    pub depth: Option<usize>,
14
15    /// Show all
16    #[clap(short, long, conflicts_with_all = &["dirs_only", "files_only"])]
17    pub all: bool,
18
19    /// Show only directories
20    #[clap(short = 'D', long = "dirs-only")]
21    pub dirs_only: bool,
22
23    /// Show only files
24    #[clap(short = 'F', long = "files-only")]
25    pub files_only: bool,
26
27    /// Show ignored files
28    #[clap(short, long)]
29    pub ignored: bool,
30
31    /// Show hidden files and directories in tree
32    #[clap(short = 'H', long)]
33    pub hidden: bool,
34
35    /// Export tree as a file
36    #[clap(short, long, value_enum)]
37    pub export: Option<Format>,
38}
39
40#[derive(Parser, Debug, Clone, ValueEnum)]
41pub enum Format {
42    Json,
43}