options.rs
This file
Path
src/options.rs
102 lines · 3.4 KiB · Rust
Last changed by
Add global fdignore supportBobbie Soedirgobefore adoption79d5a5b
History of this fileTake it
Clean up include ordersharkdpbefore adoption53557ef
lines 1–5why, one step back1use std::{path::PathBuf, sync::Arc, time::Duration};23use lscolors::LsColors;4use regex::bytes::RegexSet;5Move FdOptions to Optionssharkdpbefore adoption65096a6
lines 6–7why, one step back6use crate::exec::CommandTemplate;7use crate::filetypes::FileTypes;[ownership] add --owner arg parsing and storageAlexandru Macoveibefore adoption4f9a024
lines 8–9why, one step back8#[cfg(unix)]9use crate::filter::OwnerFilter;Move FdOptions to Optionssharkdpbefore adoption65096a6
lines 10–29why, one step back10use crate::filter::{SizeFilter, TimeFilter};1112/// Configuration options for *fd*.13pub struct Options {14 /// Whether the search is case-sensitive or case-insensitive.15 pub case_sensitive: bool,1617 /// Whether to search within the full file path or just the base name (filename or directory18 /// name).19 pub search_full_path: bool,2021 /// Whether to ignore hidden files and directories (or not).22 pub ignore_hidden: bool,2324 /// Whether to respect `.fdignore` files or not.25 pub read_fdignore: bool,2627 /// Whether to respect VCS ignore files (`.gitignore`, ..) or not.28 pub read_vcsignore: bool,29Add global fdignore supportBobbie Soedirgobefore adoption79d5a5b
lines 30–32why, one step back30 /// Whether to respect the global ignore file or not.31 pub read_global_ignore: bool,32Move FdOptions to Optionssharkdpbefore adoption65096a6
lines 33–47why, one step back33 /// Whether to follow symlinks or not.34 pub follow_links: bool,3536 /// Whether to limit the search to starting file system or not.37 pub one_file_system: bool,3839 /// Whether elements of output should be separated by a null character40 pub null_separator: bool,4142 /// The maximum search depth, or `None` if no maximum search depth should be set.43 ///44 /// A depth of `1` includes all files under the current directory, a depth of `2` also includes45 /// all files under subdirectories of the current directory, etc.46 pub max_depth: Option<usize>,47Add --min-depth and --exact-depthsharkdpbefore adoptiond63c63b
lines 48–50why, one step back48 /// The minimum depth for reported entries, or `None`.49 pub min_depth: Option<usize>,50Move FdOptions to Optionssharkdpbefore adoption65096a6
lines 51–62why, one step back51 /// The number of threads to use.52 pub threads: usize,5354 /// Time to buffer results internally before streaming to the console. This is useful to55 /// provide a sorted output, in case the total execution time is shorter than56 /// `max_buffer_time`.57 pub max_buffer_time: Option<Duration>,5859 /// `None` if the output should not be colorized. Otherwise, a `LsColors` instance that defines60 /// how to style different filetypes.61 pub ls_colors: Option<LsColors>,62Print path as raw bytes, allowing invalid UTF-8 filenames to be passed to other processessharkdpbefore adoption6c9e743
lines 63–65why, one step back63 /// Whether or not we are writing to an interactive terminal64 pub interactive_terminal: bool,65Move FdOptions to Optionssharkdpbefore adoption65096a6
lines 66–88why, one step back66 /// The type of file to search for. If set to `None`, all file types are displayed. If67 /// set to `Some(..)`, only the types that are specified are shown.68 pub file_types: Option<FileTypes>,6970 /// The extension to search for. Only entries matching the extension will be included.71 ///72 /// The value (if present) will be a lowercase string without leading dots.73 pub extensions: Option<RegexSet>,7475 /// If a value is supplied, each item found will be used to generate and execute commands.76 pub command: Option<Arc<CommandTemplate>>,7778 /// A list of glob patterns that should be excluded from the search.79 pub exclude_patterns: Vec<String>,8081 /// A list of custom ignore files.82 pub ignore_files: Vec<PathBuf>,8384 /// The given constraints on the size of returned files85 pub size_constraints: Vec<SizeFilter>,8687 /// Constraints on last modification time of files88 pub time_constraints: Vec<TimeFilter>,[ownership] add --owner arg parsing and storageAlexandru Macoveibefore adoption4f9a024
lines 89–92why, one step back8990 #[cfg(unix)]91 /// User/group ownership constraint92 pub owner_constraint: Option<OwnerFilter>,Move FdOptions to Optionssharkdpbefore adoption65096a6
lines 93–102why, one step back9394 /// Whether or not to display filesystem errors95 pub show_filesystem_errors: bool,9697 /// The separator used to print file paths.98 pub path_separator: Option<String>,99100 /// The maximum number of search results101 pub max_results: Option<usize>,102}