1use clap::Parser;
2use std::path::PathBuf;
3
4#[derive(Parser, Debug)]
5#[command(
6 name = "anon-flatten",
7 about = "一个简单的文件目录扁平化工具,让复杂的嵌套文件夹结构变得和爱音一样平 | A simple file directory flattening tool",
8 version,
9 after_help = "\x1b[38;2;255;136;153m🎸 让你的文件夹像千早爱音一样,简单直接,一马平川!\x1b[0m"
10)]
11pub struct Args {
12 #[arg(short = 'i', long = "input")]
14 pub input: PathBuf,
15
16 #[arg(short = 'o', long = "output")]
18 pub output: PathBuf,
19
20 #[arg(short = 'p', long = "preview")]
22 pub preview: bool,
23
24 #[arg(short = 'x', long = "cut")]
26 pub cut: bool,
27
28 #[arg(
32 short = 'e',
33 long = "exclude",
34 value_name = "EXT",
35 value_delimiter = ','
36 )]
37 pub exclude: Vec<String>,
38}
39
40impl Args {
41 pub fn parse_args() -> Self {
42 Self::parse()
43 }
44}