Merge branch 'pr/opposing-options' of https://github.com/Asha20/fd into pr/opposing-options
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Vukašin Stepanović · committed by Vukašin Stepanović · parents 668af05, 9bc8fab · Browse files · 10 files·+241 added−109 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
10 files+241 added−109 removed
- other:+241 added−109 removed
Provenance
- Commit
8da936a- Tree
029a8c5- Author
Vukašin Stepanović <vukasintepanovic@gmail.com>- Committer
Vukašin Stepanović <vukasintepanovic@gmail.com>- Parent 1
668af05- Parent 2
9bc8fab
10 files changed+241 added−109 removed
modified:.github/workflows/CICD.yml+8 added-8 removed
14 unmodified lines15 16 jobs:17 min_version:18 name: Minimum supported rust version19- runs-on: ubuntu-18.0419+ runs-on: ubuntu-20.0420 steps:21 - name: Checkout source code22 uses: actions/checkout@v223 20 unmodified lines44 strategy:45 fail-fast: false46 matrix:47 job:48- - { os: ubuntu-18.04, target: arm-unknown-linux-gnueabihf , use-cross: true }49- - { os: ubuntu-18.04, target: arm-unknown-linux-musleabihf, use-cross: true }50- - { os: ubuntu-18.04, target: aarch64-unknown-linux-gnu , use-cross: true }51- - { os: ubuntu-18.04, target: i686-unknown-linux-gnu , use-cross: true }52- - { os: ubuntu-18.04, target: i686-unknown-linux-musl , use-cross: true }53- - { os: ubuntu-18.04, target: x86_64-unknown-linux-gnu }54- - { os: ubuntu-18.04, target: x86_64-unknown-linux-musl , use-cross: true }48+ - { os: ubuntu-20.04, target: arm-unknown-linux-gnueabihf , use-cross: true }49+ - { os: ubuntu-20.04, target: arm-unknown-linux-musleabihf, use-cross: true }50+ - { os: ubuntu-20.04, target: aarch64-unknown-linux-gnu , use-cross: true }51+ - { os: ubuntu-20.04, target: i686-unknown-linux-gnu , use-cross: true }52+ - { os: ubuntu-20.04, target: i686-unknown-linux-musl , use-cross: true }53+ - { os: ubuntu-20.04, target: x86_64-unknown-linux-gnu }54+ - { os: ubuntu-20.04, target: x86_64-unknown-linux-musl , use-cross: true }55 - { os: macos-10.15 , target: x86_64-apple-darwin }56 # - { os: windows-2019, target: i686-pc-windows-gnu } ## disabled; error: linker `i686-w64-mingw32-gcc` not found57 - { os: windows-2019, target: i686-pc-windows-msvc }58 - { os: windows-2019, target: x86_64-pc-windows-gnu }275 unmodified linesmodified:doc/fd.1+11 added-4 removed
55 unmodified lines56 pattern contains an uppercase character (smart case).57 .TP58 .B \-g, \-\-glob59 Perform a glob-based search instead of a regular expression search.60+If combined with the '\-\-full-path' option, '**' can be used to match multiple path components.61 .TP62 .B \-\-regex63 Perform a regular-expression based search (default). This can be used to override --glob.64 .TP154 unmodified lines219 .RE220 .RE221 .TP222 .BI "\-\-changed-within " date|duration222-Filter results based on the file modification time. The argument can be provided as a specific223-point in time (\fIYYYY-MM-DD HH:MM:SS\fR) or as a duration (\fI10h, 1d, 35min\fR).223+Filter results based on the file modification time.224+Files with modification times greater than or equal to the argument will be returned.225+The argument can be provided as a duration (\fI10h, 1d, 35min\fR) or as a specific point226+in time in either full RFC3339 format with time zone, or as a date or datetime in the227+local time zone (\fIYYYY-MM-DD\fR or \fIYYYY-MM-DD HH:MM:SS\fR).228 .B --change-newer-than229 can be used as an alias.230 231 Examples:232 \-\-changed-within 2weeks233 \-\-change-newer-than "2018-10-27 10:00:00"234 .TP235 .BI "\-\-changed-before " date|duration232-Filter results based on the file modification time. The argument can be provided as a specific233-point in time (\fIYYYY-MM-DD HH:MM:SS\fR) or as a duration (\fI10h, 1d, 35min\fR).236+Filter results based on the file modification time.237+Files with modification times less than or equal to the argument will be returned.238+The argument can be provided as a duration (\fI10h, 1d, 35min\fR) or as a specific point239+in time in either full RFC3339 format with time zone, or as a date or datetime in the240+local time zone (\fIYYYY-MM-DD\fR or \fIYYYY-MM-DD HH:MM:SS\fR).241 .B --change-older-than242 can be used as an alias.243 244 Examples:143 unmodified linesmodified:src/filter/time.rs+54 added-3 removed
1+use chrono::{offset::TimeZone, DateTime, Local, NaiveDate};2+3 use std::time::SystemTime;4 5 /// Filter based on time ranges.6 #[derive(Debug, PartialEq)]5 unmodified lines12 impl TimeFilter {13 fn from_str(ref_time: &SystemTime, s: &str) -> Option<SystemTime> {14 humantime::parse_duration(s)15 .map(|duration| *ref_time - duration)14- .or_else(|_| humantime::parse_rfc3339_weak(s))15- .or_else(|_| humantime::parse_rfc3339_weak(&(s.to_owned() + " 00:00:00")))16 .ok()17+ .or_else(|| {18+ DateTime::parse_from_rfc3339(s)19+ .map(|dt| dt.into())20+ .ok()21+ .or_else(|| {22+ NaiveDate::parse_from_str(s, "%F")23+ .map(|nd| nd.and_hms(0, 0, 0))24+ .ok()25+ .and_then(|ndt| Local.from_local_datetime(&ndt).single())26+ })27+ .or_else(|| Local.datetime_from_str(s, "%F %T").ok())28+ .map(|dt| dt.into())29+ })30 }31 32 pub fn before(ref_time: &SystemTime, s: &str) -> Option<TimeFilter> {33 TimeFilter::from_str(ref_time, s).map(TimeFilter::Before)17 unmodified lines51 use std::time::Duration;52 53 #[test]54 fn is_time_filter_applicable() {42- let ref_time = humantime::parse_rfc3339("2010-10-10T10:10:10Z").unwrap();55+ let ref_time = Local56+ .datetime_from_str("2010-10-10 10:10:10", "%F %T")57+ .unwrap()58+ .into();59+60 assert!(TimeFilter::after(&ref_time, "1min")61 .unwrap()62 .applies_to(&ref_time));63 assert!(!TimeFilter::before(&ref_time, "1min")28 unmodified lines92 .applies_to(&ref_time));93 assert!(!TimeFilter::after(&ref_time, t10s_before)94 .unwrap()95 .applies_to(&t1m_ago));96+97+ let same_day = "2010-10-10";98+ assert!(!TimeFilter::before(&ref_time, same_day)99+ .unwrap()100+ .applies_to(&ref_time));101+ assert!(!TimeFilter::before(&ref_time, same_day)102+ .unwrap()103+ .applies_to(&t1m_ago));104+105+ assert!(TimeFilter::after(&ref_time, same_day)106+ .unwrap()107+ .applies_to(&ref_time));108+ assert!(TimeFilter::after(&ref_time, same_day)109+ .unwrap()110+ .applies_to(&t1m_ago));111+112+ let ref_time = DateTime::parse_from_rfc3339("2010-10-10T10:10:10+00:00")113+ .unwrap()114+ .into();115+ let t1m_ago = ref_time - Duration::from_secs(60);116+ let t10s_before = "2010-10-10T10:10:00+00:00";117+ assert!(!TimeFilter::before(&ref_time, t10s_before)118+ .unwrap()119+ .applies_to(&ref_time));120+ assert!(TimeFilter::before(&ref_time, t10s_before)121+ .unwrap()122+ .applies_to(&t1m_ago));123+124+ assert!(TimeFilter::after(&ref_time, t10s_before)125+ .unwrap()126+ .applies_to(&ref_time));127+ assert!(!TimeFilter::after(&ref_time, t10s_before)128+ .unwrap()129+ .applies_to(&t1m_ago));130 }131 }modified:src/filetypes.rs+28 added
1+use crate::filesystem;2+use crate::walk;3+4 /// Whether or not to show5 pub struct FileTypes {6 pub files: bool,7 pub directories: bool,16 unmodified lines24 empty_only: false,25 }26 }27 }28+29+impl FileTypes {30+ pub fn should_ignore(&self, entry: &walk::DirEntry) -> bool {31+ if let Some(ref entry_type) = entry.file_type() {32+ (!self.files && entry_type.is_file())33+ || (!self.directories && entry_type.is_dir())34+ || (!self.symlinks && entry_type.is_symlink())35+ || (!self.sockets && filesystem::is_socket(*entry_type))36+ || (!self.pipes && filesystem::is_pipe(*entry_type))37+ || (self.executables_only38+ && !entry39+ .metadata()40+ .map(|m| filesystem::is_executable(&m))41+ .unwrap_or(false))42+ || (self.empty_only && !filesystem::is_empty(&entry))43+ || !(entry_type.is_file()44+ || entry_type.is_dir()45+ || entry_type.is_symlink()46+ || filesystem::is_socket(*entry_type)47+ || filesystem::is_pipe(*entry_type))48+ } else {49+ true50+ }51+ }52+}modified:src/main.rs+5 added-3 removed
208 unmodified lines209 let color_arg = ["--color=", color].concat();210 211 #[allow(unused)]212 let gnu_ls = |command_name| {213+ // Note: we use short options here (instead of --long-options) to support more214+ // platforms (like BusyBox).215 vec![216 command_name,215- "-l", // long listing format216- "--human-readable", // human readable file sizes217- "--directory", // list directories themselves, not their contents217+ "-l", // long listing format218+ "-h", // human readable file sizes219+ "-d", // list directories themselves, not their contents220 &color_arg,221 ]222 };223 274 unmodified linesmodified:src/walk.rs+9 added-35 removed
356 unmodified lines357 {358 DirEntry::BrokenSymlink(path)359 }360 _ => {361- match tx_thread.send(WorkerResult::Error(ignore::Error::WithPath {361+ return match tx_thread.send(WorkerResult::Error(ignore::Error::WithPath {362 path,363 err: inner_err,364 })) {365- Ok(_) => {366- return ignore::WalkState::Continue;367- }368- Err(_) => {369- return ignore::WalkState::Quit;370- }365+ Ok(_) => ignore::WalkState::Continue,366+ Err(_) => ignore::WalkState::Quit,367 }368 }369 },374- Err(err) => match tx_thread.send(WorkerResult::Error(err)) {375- Ok(_) => {376- return ignore::WalkState::Continue;370+ Err(err) => {371+ return match tx_thread.send(WorkerResult::Error(err)) {372+ Ok(_) => ignore::WalkState::Continue,373+ Err(_) => ignore::WalkState::Quit,374 }378- Err(_) => {379- return ignore::WalkState::Quit;380- }375+ }381- },376 };377 378 if let Some(min_depth) = config.min_depth {379 if entry.depth().map_or(true, |d| d < min_depth) {35 unmodified lines415 }416 417 // Filter out unwanted file types.418 if let Some(ref file_types) = config.file_types {425- if let Some(ref entry_type) = entry.file_type() {426- if (!file_types.files && entry_type.is_file())427- || (!file_types.directories && entry_type.is_dir())428- || (!file_types.symlinks && entry_type.is_symlink())429- || (!file_types.sockets && filesystem::is_socket(*entry_type))430- || (!file_types.pipes && filesystem::is_pipe(*entry_type))431- || (file_types.executables_only432- && !entry433- .metadata()434- .map(|m| filesystem::is_executable(&m))435- .unwrap_or(false))436- || (file_types.empty_only && !filesystem::is_empty(&entry))437- || !(entry_type.is_file()438- || entry_type.is_dir()439- || entry_type.is_symlink()440- || filesystem::is_socket(*entry_type)441- || filesystem::is_pipe(*entry_type))442- {443- return ignore::WalkState::Continue;444- }445- } else {419+ if file_types.should_ignore(&entry) {420 return ignore::WalkState::Continue;421 }422 }423 64 unmodified linesmodified:Cargo.lock+102 added-56 removed
58 unmodified lines59 checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"60 61 [[package]]62 name = "bstr"63-version = "0.2.14"63+version = "0.2.16"64 source = "registry+https://github.com/rust-lang/crates.io-index"65-checksum = "473fc6b38233f9af7baa94fb5852dca389e3d95b8e21c8e3719301462c5d9faf"65+checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279"66 dependencies = [67 "memchr",68 ]69 70 [[package]]71 name = "cc"72-version = "1.0.66"72+version = "1.0.69"73 source = "registry+https://github.com/rust-lang/crates.io-index"74-checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48"74+checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2"75 76 [[package]]77 name = "cfg-if"78-version = "0.1.10"78+version = "1.0.0"79 source = "registry+https://github.com/rust-lang/crates.io-index"80-checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"80+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"81 82 [[package]]83-name = "cfg-if"84-version = "1.0.0"83+name = "chrono"84+version = "0.4.19"85 source = "registry+https://github.com/rust-lang/crates.io-index"86-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"86+checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"87+dependencies = [88+ "libc",89+ "num-integer",90+ "num-traits",91+ "time",92+ "winapi",93+]94 95 [[package]]96 name = "clap"97 version = "2.33.3"11 unmodified lines109 ]110 111 [[package]]112 name = "crossbeam-utils"106-version = "0.8.1"113+version = "0.8.5"114 source = "registry+https://github.com/rust-lang/crates.io-index"108-checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d"115+checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db"116 dependencies = [110- "autocfg",111- "cfg-if 1.0.0",117+ "cfg-if",118 "lazy_static",119 ]120 121 [[package]]122 name = "ctrlc"117-version = "3.1.9"123+version = "3.2.0"124 source = "registry+https://github.com/rust-lang/crates.io-index"119-checksum = "232295399409a8b7ae41276757b5a1cc21032848d42bff2352261f958b3ca29a"125+checksum = "377c9b002a72a0b2c1a18c62e2f3864bdfea4a015e3683a96e24aa45dd6c02d1"126 dependencies = [127 "nix",128 "winapi",129 ]9 unmodified lines139 version = "2.0.0"140 source = "registry+https://github.com/rust-lang/crates.io-index"141 checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"142 dependencies = [137- "cfg-if 1.0.0",143+ "cfg-if",144 "dirs-sys-next",145 ]146 147 [[package]]148 name = "dirs-sys-next"143-version = "0.1.1"149+version = "0.1.2"150 source = "registry+https://github.com/rust-lang/crates.io-index"145-checksum = "99de365f605554ae33f115102a02057d4fc18b01f3284d6870be0938743cfe7d"151+checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"152 dependencies = [153 "libc",154 "redox_users",155 "winapi",5 unmodified lines161 dependencies = [162 "ansi_term 0.12.1",163 "anyhow",164 "atty",165+ "chrono",166 "clap",167 "ctrlc",168 "diff",169 "dirs-next",16 unmodified lines186 ]187 188 [[package]]189 name = "filetime"183-version = "0.2.14"190+version = "0.2.15"191 source = "registry+https://github.com/rust-lang/crates.io-index"185-checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8"192+checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98"193 dependencies = [187- "cfg-if 1.0.0",194+ "cfg-if",195 "libc",189- "redox_syscall 0.2.10",196+ "redox_syscall",197 "winapi",198 ]199 200 [[package]]15 unmodified lines216 checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"217 218 [[package]]219 name = "getrandom"213-version = "0.1.15"220+version = "0.2.3"221 source = "registry+https://github.com/rust-lang/crates.io-index"215-checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"222+checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"223 dependencies = [217- "cfg-if 0.1.10",224+ "cfg-if",225 "libc",226 "wasi",227 ]228 11 unmodified lines240 ]241 242 [[package]]243 name = "hermit-abi"237-version = "0.1.17"244+version = "0.1.19"245 source = "registry+https://github.com/rust-lang/crates.io-index"239-checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"246+checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"247 dependencies = [248 "libc",249 ]250 251 [[package]]252 name = "humantime"246-version = "2.0.1"253+version = "2.1.0"254 source = "registry+https://github.com/rust-lang/crates.io-index"248-checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a"255+checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"256 257 [[package]]258 name = "ignore"252-version = "0.4.17"259+version = "0.4.18"260 source = "registry+https://github.com/rust-lang/crates.io-index"254-checksum = "b287fb45c60bb826a0dc68ff08742b9d88a2fea13d6e0c286b3172065aaf878c"261+checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d"262 dependencies = [263 "crossbeam-utils",264 "globset",265 "lazy_static",34 unmodified lines300 checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"301 302 [[package]]303 name = "libc"297-version = "0.2.98"304+version = "0.2.99"305 source = "registry+https://github.com/rust-lang/crates.io-index"299-checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"306+checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765"307 308 [[package]]309 name = "log"303-version = "0.4.11"310+version = "0.4.14"311 source = "registry+https://github.com/rust-lang/crates.io-index"305-checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"312+checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"313 dependencies = [307- "cfg-if 0.1.10",314+ "cfg-if",315 ]316 317 [[package]]318 name = "lscolors"10 unmodified lines329 source = "registry+https://github.com/rust-lang/crates.io-index"330 checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc"331 332 [[package]]333+name = "memoffset"334+version = "0.6.4"335+source = "registry+https://github.com/rust-lang/crates.io-index"336+checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9"337+dependencies = [338+ "autocfg",339+]340+341+[[package]]342 name = "nix"327-version = "0.20.0"343+version = "0.22.0"344 source = "registry+https://github.com/rust-lang/crates.io-index"329-checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a"345+checksum = "cf1e25ee6b412c2a1e3fcb6a4499a5c1bfe7f43e014bdce9a6b6666e5aa2d187"346 dependencies = [347 "bitflags",348 "cc",333- "cfg-if 1.0.0",349+ "cfg-if",350 "libc",351+ "memoffset",352 ]353 354 [[package]]355 name = "normpath"4 unmodified lines360 "winapi",361 ]362 363 [[package]]364+name = "num-integer"365+version = "0.1.44"366+source = "registry+https://github.com/rust-lang/crates.io-index"367+checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"368+dependencies = [369+ "autocfg",370+ "num-traits",371+]372+373+[[package]]374+name = "num-traits"375+version = "0.2.14"376+source = "registry+https://github.com/rust-lang/crates.io-index"377+checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"378+dependencies = [379+ "autocfg",380+]381+382+[[package]]383 name = "num_cpus"384 version = "1.13.0"385 source = "registry+https://github.com/rust-lang/crates.io-index"386 checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"2 unmodified lines389 "libc",390 ]391 392 [[package]]393+name = "once_cell"394+version = "1.8.0"395+source = "registry+https://github.com/rust-lang/crates.io-index"396+checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"397+398+[[package]]399 name = "proc-macro2"400 version = "1.0.28"401 source = "registry+https://github.com/rust-lang/crates.io-index"402 checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"48 unmodified lines451 ]452 453 [[package]]454 name = "redox_syscall"413-version = "0.1.57"414-source = "registry+https://github.com/rust-lang/crates.io-index"415-checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"416-417-[[package]]418-name = "redox_syscall"455 version = "0.2.10"456 source = "registry+https://github.com/rust-lang/crates.io-index"457 checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"458 dependencies = [1 unmodified line460 ]461 462 [[package]]463 name = "redox_users"428-version = "0.3.5"464+version = "0.4.0"465 source = "registry+https://github.com/rust-lang/crates.io-index"430-checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d"466+checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"467 dependencies = [468 "getrandom",433- "redox_syscall 0.1.57",469+ "redox_syscall",470 ]471 472 [[package]]473 name = "regex"72 unmodified lines546 version = "1.2.0"547 source = "registry+https://github.com/rust-lang/crates.io-index"548 checksum = "3b114ece25254e97bf48dd4bfc2a12bad0647adacfe4cae1247a9ca6ad302cec"549 dependencies = [514- "cfg-if 1.0.0",550+ "cfg-if",551 "proc-macro2",552 "quote",553 "syn",554 "version_check",10 unmodified lines565 ]566 567 [[package]]568 name = "thread_local"533-version = "1.0.1"569+version = "1.1.3"570 source = "registry+https://github.com/rust-lang/crates.io-index"535-checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"571+checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd"572 dependencies = [537- "lazy_static",573+ "once_cell",574 ]575 576 [[package]]577+name = "time"578+version = "0.1.43"579+source = "registry+https://github.com/rust-lang/crates.io-index"580+checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"581+dependencies = [582+ "libc",583+ "winapi",584+]585+586+[[package]]587 name = "unicode-width"588 version = "0.1.8"589 source = "registry+https://github.com/rust-lang/crates.io-index"590 checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"27 unmodified lines618 checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"619 620 [[package]]621 name = "walkdir"576-version = "2.3.1"622+version = "2.3.2"623 source = "registry+https://github.com/rust-lang/crates.io-index"578-checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"624+checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"625 dependencies = [626 "same-file",627 "winapi",628 "winapi-util",629 ]630 631 [[package]]632 name = "wasi"587-version = "0.9.0+wasi-snapshot-preview1"633+version = "0.10.2+wasi-snapshot-preview1"634 source = "registry+https://github.com/rust-lang/crates.io-index"589-checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"635+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"636 637 [[package]]638 name = "winapi"639 version = "0.3.9"27 unmodified linesmodified:Cargo.toml+1 added
46 unmodified lines47484950515253545522 unmodified lines46 unmodified linesglobset = "0.4"anyhow = "1.0"dirs-next = "2.0"normpath = "0.3"chrono = "0.4"
[dependencies.clap]version = "2.31.2"features = ["suggestions", "color", "wrap_help"]22 unmodified linesmodified:CHANGELOG.md+2 added
8 unmodified lines9 - Set default path separator to `/` in MSYS, see #537 and #730 (@aswild)10 - fd cannot search files under a RAM disk, see #75211 - fd doesn't show substituted drive on Windows, see #36512 - Properly handle write errors to devices that are full, see #73713+- Use local time zone for time functions (`--change-newer-than`, `--change-older-than`), see #631 (@jacobmischka)14+- Support `--list-details` on more platforms (like BusyBox), see #78315 16 ## Changes17 18 - Apply custom `--path-separator` to commands run with `--exec(-batch)` and `--list-details`, see #697 (@aswild)509 unmodified linesmodified:README.md+21 added
113 unmodified lines114 src/lscolors/mod.rs115 tests/testenv/mod.rs116 ```117 118+### Searching for a particular file name119+120+ To find files with exactly the provided search pattern, use the `-g` (or `--glob`) option:121+``` bash122+> fd -g libc.so /usr123+/usr/lib32/libc.so124+/usr/lib/libc.so125+```126+127 ### Hidden and ignored files128 By default, *fd* does not search hidden directories and does not show hidden files in the129 search results. To disable this behavior, we can use the `-H` (or `--hidden`) option:130 ``` bash13 unmodified lines144 145 To really search *all* files and directories, simply combine the hidden and ignore features to show146 everything (`-HI`).147 148+### Matching the full path149+By default, *fd* only matches the filename of each file. However, using the `--full-path` or `-p` option,150+you can match against the full path.151+152+```bash153+> fd -p -g '**/.git/config'154+> fd -p '.*/lesson-\d+/[a-z]+.(jpg|png)'155+```156+157 ### Command execution158 159 Instead of just showing the search results, you often want to *do something* with them. `fd`160 provides two ways to execute external commands for each of your search results:479 unmodified lines640 cargo install fd-find641 ```642 Note that rust version *1.42.0* or later is required.643 644+`make` is also needed for the build.645+646 ### From binaries647 648 The [release page](https://github.com/sharkdp/fd/releases) includes precompiled binaries for Linux, macOS and Windows. Statically-linked binaries are also available: look for archives with `musl` in the file name.649 16 unmodified lines666 667 - [sharkdp](https://github.com/sharkdp)668 - [tmccombs](https://github.com/tmccombs)669 - [tavianator](https://github.com/tavianator)670+- [pemistahl](https://github.com/pemistahl/)671 672 ## License673 674 Copyright (c) 2017-2021 The fd developers4 unmodified lines