summaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/config.rs b/src/config.rs
index b87f88d..aa9a6c4 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -6,24 +6,29 @@ use tracing::{metadata::LevelFilter, Level};
#[derive(Debug, Clone, Default, Parser)]
#[command(author, version, about)]
pub struct Config {
- /// Directories to search.
- ///
- /// Directories are searched recursively based on `--max-depth`.
- pub paths: Vec<PathBuf>,
+ #[command(flatten)]
+ pub search: Search,
- /// (UNIMPLEMENTED) Additional directories to add to the sorted output.
+ #[command(flatten)]
+ pub parsers: Projects,
+
+ /// Add arbitrary directories
+ ///
+ /// Directories added by this flag are still filtered and sorted based on supplied options.
#[arg(long = "project", short = 'P')]
pub projects: Vec<PathBuf>,
#[command(flatten)]
- pub search: Search,
-
- #[command(flatten)]
pub verbosity: Verbosity,
}
#[derive(Debug, Default, Clone, Args)]
pub struct Search {
+ /// Directories to search.
+ ///
+ /// Directories are searched recursively based on `--max-depth`.
+ pub paths: Vec<PathBuf>,
+
/// Recurse into hidden directories.
///
/// Traverse into hidden directories while searching. A directory is considered hidden
@@ -36,24 +41,26 @@ pub struct Search {
/// MAX_DEPTH of 0 will only return the supplied PATHS.
#[arg(short = 'd', long, default_value = "1")]
pub max_depth: Option<usize>,
-
- #[command(flatten)]
- pub parsers: Parsers,
}
#[derive(Debug, Default, Clone, Args)]
-pub struct Parsers {
+pub struct Projects {
/// Match all child directories.
+ ///
+ /// Uses the directory mtime as the timestamp.
#[arg(short, long)]
pub all: bool,
/// Match directories containing <PATTERN>.
///
- /// PATTERN should be a path relative to the searched directory.
+ /// Uses the directory mtime as the timestamp. PATTERN should be a path relative to the
+ /// searched directory.
#[arg(long, short)]
pub pattern: Option<String>,
/// Match git repositories.
+ ///
+ /// Uses the most recient commit as the timestamp.
#[cfg(feature = "git")]
#[arg(long, short)]
pub git: bool,