Reorder command line options
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Peter · committed by David Peter · parent 70c4865 · Browse files · 1 file·+79 added−78 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+79 added−78 removed
- other:+79 added−78 removed
Provenance
- Commit
12165c7- Tree
689b408- Author
David Peter <mail@david-peter.de>- Committer
David Peter <mail@david-peter.de>- Parent
70c4865
1 file changed+79 added−78 removed
modified:src/cli.rs+79 added-78 removed
276 unmodified lines277 '--min-depth <depth> --max-depth <depth>'.",278 )]279 exact_depth: Option<usize>,280 281+ /// Exclude entries that match the given glob pattern282+ #[arg(283+ long,284+ short = 'E',285+ value_name = "pattern",286+ long_help = "Exclude files/directories that match the given glob pattern. This \287+ overrides any other ignore logic. Multiple exclude patterns can be \288+ specified.\n\n\289+ Examples:\n \290+ --exclude '*.pyc'\n \291+ --exclude node_modules"292+ )]293+ pub exclude: Vec<String>,294+295 /// Do not traverse into directories that match the search criteria. If296 /// you want to exclude specific directories, use the '--exclude=…' option.297 #[arg(long, hide_short_help = true, conflicts_with_all(&["size", "exact_depth"]),298 long_help = "Do not traverse into directories that match the search criteria. If \53 unmodified lines352 you can use the regex '^[^.]+$' as a normal search pattern."353 )]354 pub extensions: Option<Vec<String>>,355 342- #[command(flatten)]343- pub exec: Exec,344-345- /// Max number of arguments to run as a batch size with -X346- #[arg(347- long,348- value_name = "size",349- hide_short_help = true,350- requires("exec_batch"),351- value_parser = value_parser!(usize),352- default_value_t,353- long_help = "Maximum number of arguments to pass to the command given with -X. \354- If the number of results is greater than the given size, \355- the command given with -X is run again with remaining arguments. \356- A batch size of zero means there is no limit (default), but note \357- that batching might still happen due to OS restrictions on the \358- maximum length of command lines.",359- )]360- pub batch_size: usize,361-362- /// Exclude entries that match the given glob pattern363- #[arg(364- long,365- short = 'E',366- value_name = "pattern",367- long_help = "Exclude files/directories that match the given glob pattern. This \368- overrides any other ignore logic. Multiple exclude patterns can be \369- specified.\n\n\370- Examples:\n \371- --exclude '*.pyc'\n \372- --exclude node_modules"373- )]374- pub exclude: Vec<String>,375-376- /// Add a custom ignore-file in '.gitignore' format377- #[arg(378- long,379- value_name = "path",380- hide_short_help = true,381- long_help = "Add a custom ignore-file in '.gitignore' format. These files have a low precedence."382- )]383- pub ignore_file: Vec<PathBuf>,384-385- /// When to use colors386- #[arg(387- long,388- short = 'c',389- value_enum,390- default_value_t = ColorWhen::Auto,391- value_name = "when",392- long_help = "Declare when to use color for the pattern match output",393- )]394- pub color: ColorWhen,395-396- /// Set number of threads to use for searching & executing (default: number397- /// of available CPU cores)398- #[arg(long, short = 'j', value_name = "num", hide_short_help = true, value_parser = 1..)]399- pub threads: Option<u32>,400-356 /// Limit results based on the size of files357 #[arg(long, short = 'S', value_parser = SizeFilter::from_string, allow_hyphen_values = true, verbatim_doc_comment, value_name = "size",358 long_help = "Limit results based on the size of files using the format <+-><NUM><UNIT>.\n \359 '+': file size must be greater than or equal to this\n \13 unmodified lines373 'ti': tebibytes",374 )]375 pub size: Vec<SizeFilter>,376 422- /// Milliseconds to buffer before streaming search results to console423- ///424- /// Amount of time in milliseconds to buffer, before streaming the search425- /// results to the console.426- #[arg(long, hide = true, value_parser = parse_millis)]427- pub max_buffer_time: Option<Duration>,428-377 /// Filter by file modification time (newer than)378 #[arg(379 long,380 alias("change-newer-than"),25 unmodified lines406 --older 2018-10-27"407 )]408 pub changed_before: Option<String>,409 410+ /// Filter by owning user and/or group411+ #[cfg(unix)]412+ #[arg(long, short = 'o', value_parser = OwnerFilter::from_string, value_name = "user:group",413+ long_help = "Filter files by their user and/or group. \414+ Format: [(user|uid)][:(group|gid)]. Either side is optional. \415+ Precede either side with a '!' to exclude files instead.\n\416+ Examples:\n \417+ --owner john\n \418+ --owner :students\n \419+ --owner '!john:students'"420+ )]421+ pub owner: Option<OwnerFilter>,422+423+ #[command(flatten)]424+ pub exec: Exec,425+426+ /// Max number of arguments to run as a batch size with -X427+ #[arg(428+ long,429+ value_name = "size",430+ hide_short_help = true,431+ requires("exec_batch"),432+ value_parser = value_parser!(usize),433+ default_value_t,434+ long_help = "Maximum number of arguments to pass to the command given with -X. \435+ If the number of results is greater than the given size, \436+ the command given with -X is run again with remaining arguments. \437+ A batch size of zero means there is no limit (default), but note \438+ that batching might still happen due to OS restrictions on the \439+ maximum length of command lines.",440+ )]441+ pub batch_size: usize,442+443+ /// Add a custom ignore-file in '.gitignore' format444+ #[arg(445+ long,446+ value_name = "path",447+ hide_short_help = true,448+ long_help = "Add a custom ignore-file in '.gitignore' format. These files have a low precedence."449+ )]450+ pub ignore_file: Vec<PathBuf>,451+452+ /// When to use colors453+ #[arg(454+ long,455+ short = 'c',456+ value_enum,457+ default_value_t = ColorWhen::Auto,458+ value_name = "when",459+ long_help = "Declare when to use color for the pattern match output",460+ )]461+ pub color: ColorWhen,462+463+ /// Set number of threads to use for searching & executing (default: number464+ /// of available CPU cores)465+ #[arg(long, short = 'j', value_name = "num", hide_short_help = true, value_parser = 1..)]466+ pub threads: Option<u32>,467+468+ /// Milliseconds to buffer before streaming search results to console469+ ///470+ /// Amount of time in milliseconds to buffer, before streaming the search471+ /// results to the console.472+ #[arg(long, hide = true, value_parser = parse_millis)]473+ pub max_buffer_time: Option<Duration>,474+475 /// Limit number of search results476 #[arg(477 long,478 value_name = "count",101 unmodified lines580 this flag to disable this behaviour.",581 )]582 pub strip_cwd_prefix: bool,583 571- /// Filter by owning user and/or group572- #[cfg(unix)]573- #[arg(long, short = 'o', value_parser = OwnerFilter::from_string, value_name = "user:group",574- long_help = "Filter files by their user and/or group. \575- Format: [(user|uid)][:(group|gid)]. Either side is optional. \576- Precede either side with a '!' to exclude files instead.\n\577- Examples:\n \578- --owner john\n \579- --owner :students\n \580- --owner '!john:students'"581- )]582- pub owner: Option<OwnerFilter>,584 #[cfg(any(unix, windows))]585 #[arg(long, aliases(&["mount", "xdev"]), hide_short_help = true,586 long_help = "By default, fd will traverse the file system tree as far as other options \587 dictate. With this flag, fd ensures that it does not descend into a \262 unmodified lines