diff options
Diffstat (limited to 'src/cli.rs')
-rw-r--r-- | src/cli.rs | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -1,4 +1,4 @@ -use crate::{Config, SearchPath}; +use crate::{search, Config}; use clap::{Args, Parser}; use figment::{value, Metadata, Profile, Provider}; use serde::{Deserialize, Serialize}; @@ -34,8 +34,16 @@ pub struct Projects { /// /// 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, default_value_t)] + #[arg(long)] hidden: bool, + + /// Match git repositories + #[arg(long, short)] + git: bool, + + /// Match directories containing item named <PATTERN> + #[arg(long, short)] + pattern: Option<String>, } impl Provider for Projects { @@ -54,10 +62,12 @@ impl From<Projects> for Config { .paths .iter() .cloned() - .map(|p| SearchPath { - path: p, + .map(|path_buf| search::entry::Config { + path_buf, hidden: value.hidden, max_depth: value.max_depth, + git: value.git, + pattern: value.pattern.to_owned(), }) .collect(); |