From 5da4fb25f9bb72771c7f2798daa6339be0bc3900 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Thu, 4 May 2023 19:43:08 -0500 Subject: refactor: join iterators into a single walk --- src/config.rs | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 61a0778..b87f88d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -12,21 +12,24 @@ pub struct Config { pub paths: Vec, /// (UNIMPLEMENTED) Additional directories to add to the sorted output. - #[arg(long)] - pub add: Vec, + #[arg(long = "project", short = 'P')] + pub projects: Vec, #[command(flatten)] - pub filters: Filters, + pub search: Search, #[command(flatten)] pub verbosity: Verbosity, } #[derive(Debug, Default, Clone, Args)] -pub struct Filters { - /// Match all child directories. - #[arg(short, long)] - pub all: bool, +pub struct Search { + /// Recurse into hidden directories. + /// + /// Traverse into hidden directories while searching. A directory is considered hidden + /// if its name starts with a `.` sign (dot). If `--max-depth` is 0, this has no effect. + #[arg(long)] + pub hidden: bool, /// Max depth to recurse. /// @@ -34,12 +37,15 @@ pub struct Filters { #[arg(short = 'd', long, default_value = "1")] pub max_depth: Option, - /// Recurse into hidden directories. - /// - /// Traverse into hidden directories while searching. A directory is considered hidden - /// if its name starts with a `.` sign (dot). If `--max-depth` is 0, this has no effect. - #[arg(long)] - pub hidden: bool, + #[command(flatten)] + pub parsers: Parsers, +} + +#[derive(Debug, Default, Clone, Args)] +pub struct Parsers { + /// Match all child directories. + #[arg(short, long)] + pub all: bool, /// Match directories containing . /// -- cgit v1.2.3-70-g09d2