Merge branch 'master' into pr/opposing-options
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Thayne McCombs · committed by Thayne McCombs · parents 37852aa, 1795e0e · Browse files · 10 files·+296 added−105 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+296 added−105 removed
- other:+296 added−105 removed
Provenance
- Commit
8984e57- Tree
7aec774- Author
Thayne McCombs <astrothayne@gmail.com>- Committer
Thayne McCombs <astrothayne@gmail.com>- Parent 1
37852aa- Parent 2
1795e0e
10 files changed+296 added−105 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
53 unmodified lines54 pattern contains an uppercase character (smart case).55 .TP56 .B \-g, \-\-glob57 Perform a glob-based search instead of a regular expression search.58+If combined with the '\-\-full-path' option, '**' can be used to match multiple path components.59 .TP60 .B \-\-regex61 Perform a regular-expression based search (default). This can be used to override --glob.62 .TP153 unmodified lines216 .RE217 .RE218 .TP219 .BI "\-\-changed-within " date|duration219-Filter results based on the file modification time. The argument can be provided as a specific220-point in time (\fIYYYY-MM-DD HH:MM:SS\fR) or as a duration (\fI10h, 1d, 35min\fR).220+Filter results based on the file modification time.221+Files with modification times greater than or equal to the argument will be returned.222+The argument can be provided as a duration (\fI10h, 1d, 35min\fR) or as a specific point223+in time in either full RFC3339 format with time zone, or as a date or datetime in the224+local time zone (\fIYYYY-MM-DD\fR or \fIYYYY-MM-DD HH:MM:SS\fR).225 .B --change-newer-than226 can be used as an alias.227 228 Examples:229 \-\-changed-within 2weeks230 \-\-change-newer-than "2018-10-27 10:00:00"231 .TP232 .BI "\-\-changed-before " date|duration229-Filter results based on the file modification time. The argument can be provided as a specific230-point in time (\fIYYYY-MM-DD HH:MM:SS\fR) or as a duration (\fI10h, 1d, 35min\fR).233+Filter results based on the file modification time.234+Files with modification times less than or equal to the argument will be returned.235+The argument can be provided as a duration (\fI10h, 1d, 35min\fR) or as a specific point236+in time in either full RFC3339 format with time zone, or as a date or datetime in the237+local time zone (\fIYYYY-MM-DD\fR or \fIYYYY-MM-DD HH:MM:SS\fR).238 .B --change-older-than239 can be used as an alias.240 241 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+157 added-52 removed
29 unmodified lines30 ]31 32 [[package]]33 name = "anyhow"34-version = "1.0.42"34+version = "1.0.31"35 source = "registry+https://github.com/rust-lang/crates.io-index"36-checksum = "595d3cfa7a60d4555cb5067b99f07142a08ea778de5cf993f7b75c7d8fabc486"36+checksum = "85bb70cc08ec97ca5450e6eba421deeea5f172c0fc61f78b5357b2a8e8be195f"37 38 [[package]]39+name = "arrayref"40+version = "0.3.6"41+source = "registry+https://github.com/rust-lang/crates.io-index"42+checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"43+44+[[package]]45+name = "arrayvec"46+version = "0.5.1"47+source = "registry+https://github.com/rust-lang/crates.io-index"48+checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8"49+50+[[package]]51 name = "atty"52 version = "0.2.14"53 source = "registry+https://github.com/rust-lang/crates.io-index"54 checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"4 unmodified lines59 ]60 61 [[package]]62 name = "autocfg"51-version = "1.0.1"63+version = "1.0.0"64 source = "registry+https://github.com/rust-lang/crates.io-index"53-checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"65+checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"66 67 [[package]]68+name = "base64"69+version = "0.11.0"70+source = "registry+https://github.com/rust-lang/crates.io-index"71+checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7"72+73+[[package]]74 name = "bitflags"75 version = "1.2.1"76 source = "registry+https://github.com/rust-lang/crates.io-index"77 checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"78 79 [[package]]80+name = "blake2b_simd"81+version = "0.5.10"82+source = "registry+https://github.com/rust-lang/crates.io-index"83+checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a"84+dependencies = [85+ "arrayref",86+ "arrayvec",87+ "constant_time_eq",88+]89+90+[[package]]91 name = "bstr"63-version = "0.2.14"92+version = "0.2.13"93 source = "registry+https://github.com/rust-lang/crates.io-index"65-checksum = "473fc6b38233f9af7baa94fb5852dca389e3d95b8e21c8e3719301462c5d9faf"94+checksum = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931"95 dependencies = [96 "memchr",97 ]98 99 [[package]]100 name = "cc"72-version = "1.0.66"101+version = "1.0.53"102 source = "registry+https://github.com/rust-lang/crates.io-index"74-checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48"103+checksum = "404b1fe4f65288577753b17e3b36a04596ee784493ec249bf81c7f2d2acd751c"104 105 [[package]]106 name = "cfg-if"107 version = "0.1.10"6 unmodified lines114 source = "registry+https://github.com/rust-lang/crates.io-index"115 checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"116 117 [[package]]118+name = "chrono"119+version = "0.4.19"120+source = "registry+https://github.com/rust-lang/crates.io-index"121+checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"122+dependencies = [123+ "libc",124+ "num-integer",125+ "num-traits",126+ "time",127+ "winapi",128+]129+130+[[package]]131 name = "clap"90-version = "2.33.3"132+version = "2.33.1"133 source = "registry+https://github.com/rust-lang/crates.io-index"92-checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"134+checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129"135 dependencies = [136 "ansi_term 0.11.0",137 "atty",138 "bitflags",4 unmodified lines143 "vec_map",144 ]145 146 [[package]]147+name = "constant_time_eq"148+version = "0.1.5"149+source = "registry+https://github.com/rust-lang/crates.io-index"150+checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"151+152+[[package]]153 name = "crossbeam-utils"106-version = "0.8.1"154+version = "0.7.2"155 source = "registry+https://github.com/rust-lang/crates.io-index"108-checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d"156+checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"157 dependencies = [158 "autocfg",111- "cfg-if 1.0.0",159+ "cfg-if 0.1.10",160 "lazy_static",161 ]162 163 [[package]]164 name = "ctrlc"117-version = "3.1.9"165+version = "3.1.4"166 source = "registry+https://github.com/rust-lang/crates.io-index"119-checksum = "232295399409a8b7ae41276757b5a1cc21032848d42bff2352261f958b3ca29a"167+checksum = "7a4ba686dff9fa4c1c9636ce1010b0cf98ceb421361b0bb3d6faeec43bd217a7"168 dependencies = [169 "nix",170 "winapi",171 ]15 unmodified lines187 ]188 189 [[package]]190 name = "dirs-sys-next"143-version = "0.1.1"191+version = "0.1.0"192 source = "registry+https://github.com/rust-lang/crates.io-index"145-checksum = "99de365f605554ae33f115102a02057d4fc18b01f3284d6870be0938743cfe7d"193+checksum = "9c60f7b8a8953926148223260454befb50c751d3c50e1c178c4fd1ace4083c9a"194 dependencies = [195 "libc",196 "redox_users",197 "winapi",5 unmodified lines203 dependencies = [204 "ansi_term 0.12.1",205 "anyhow",206 "atty",207+ "chrono",208 "clap",209 "ctrlc",210 "diff",211 "dirs-next",34 unmodified lines246 checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"247 248 [[package]]249 name = "fs_extra"201-version = "1.2.0"250+version = "1.1.0"251 source = "registry+https://github.com/rust-lang/crates.io-index"203-checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"252+checksum = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674"253 254 [[package]]255 name = "fuchsia-cprng"256 version = "0.1.1"1 unmodified line258 checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"259 260 [[package]]261 name = "getrandom"213-version = "0.1.15"262+version = "0.1.14"263 source = "registry+https://github.com/rust-lang/crates.io-index"215-checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"264+checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb"265 dependencies = [266 "cfg-if 0.1.10",267 "libc",219- "wasi",268+ "wasi 0.9.0+wasi-snapshot-preview1",269 ]270 271 [[package]]272 name = "globset"224-version = "0.4.8"273+version = "0.4.5"274 source = "registry+https://github.com/rust-lang/crates.io-index"226-checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd"275+checksum = "7ad1da430bd7281dde2576f44c84cc3f0f7b475e7202cd503042dff01a8c8120"276 dependencies = [277 "aho-corasick",278 "bstr",279 "fnv",2 unmodified lines282 ]283 284 [[package]]285 name = "hermit-abi"237-version = "0.1.17"286+version = "0.1.13"287 source = "registry+https://github.com/rust-lang/crates.io-index"239-checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"288+checksum = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71"289 dependencies = [290 "libc",291 ]292 293 [[package]]294 name = "humantime"246-version = "2.0.1"295+version = "2.0.0"296 source = "registry+https://github.com/rust-lang/crates.io-index"248-checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a"297+checksum = "b9b6c53306532d3c8e8087b44e6580e10db51a023cf9b433cea2ac38066b92da"298 299 [[package]]300 name = "ignore"252-version = "0.4.17"301+version = "0.4.15"302 source = "registry+https://github.com/rust-lang/crates.io-index"254-checksum = "b287fb45c60bb826a0dc68ff08742b9d88a2fea13d6e0c286b3172065aaf878c"303+checksum = "128b9e89d15a3faa642ee164c998fd4fae3d89d054463cddb2c25a7baad3a352"304 dependencies = [305 "crossbeam-utils",306 "globset",307 "lazy_static",34 unmodified lines342 checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"343 344 [[package]]345 name = "libc"297-version = "0.2.98"346+version = "0.2.70"347 source = "registry+https://github.com/rust-lang/crates.io-index"299-checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"348+checksum = "3baa92041a6fec78c687fa0cc2b3fae8884f743d672cf551bed1d6dac6988d0f"349 350 [[package]]351 name = "log"303-version = "0.4.11"352+version = "0.4.8"353 source = "registry+https://github.com/rust-lang/crates.io-index"305-checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"354+checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"355 dependencies = [356 "cfg-if 0.1.10",357 ]358 359 [[package]]360 name = "lscolors"312-version = "0.7.1"361+version = "0.7.0"362 source = "registry+https://github.com/rust-lang/crates.io-index"314-checksum = "d24b894c45c9da468621cdd615a5a79ee5e5523dd4f75c76ebc03d458940c16e"363+checksum = "1f77452267149eac960ded529fe5f5460ddf792845a1d71b5d0cfcee5642e47e"364 dependencies = [365 "ansi_term 0.12.1",366 ]367 4 unmodified lines372 checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc"373 374 [[package]]375 name = "nix"327-version = "0.20.0"376+version = "0.17.0"377 source = "registry+https://github.com/rust-lang/crates.io-index"329-checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a"378+checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363"379 dependencies = [380 "bitflags",381 "cc",333- "cfg-if 1.0.0",382+ "cfg-if 0.1.10",383 "libc",384+ "void",385 ]386 387 [[package]]388 name = "normpath"4 unmodified lines393 "winapi",394 ]395 396 [[package]]397+name = "num-integer"398+version = "0.1.43"399+source = "registry+https://github.com/rust-lang/crates.io-index"400+checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b"401+dependencies = [402+ "autocfg",403+ "num-traits",404+]405+406+[[package]]407+name = "num-traits"408+version = "0.2.12"409+source = "registry+https://github.com/rust-lang/crates.io-index"410+checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611"411+dependencies = [412+ "autocfg",413+]414+415+[[package]]416 name = "num_cpus"417 version = "1.13.0"418 source = "registry+https://github.com/rust-lang/crates.io-index"419 checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"58 unmodified lines478 ]479 480 [[package]]481 name = "redox_syscall"413-version = "0.1.57"482+version = "0.1.56"483 source = "registry+https://github.com/rust-lang/crates.io-index"415-checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"484+checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84"485 486 [[package]]487 name = "redox_syscall"488 version = "0.2.10"4 unmodified lines493 ]494 495 [[package]]496 name = "redox_users"428-version = "0.3.5"497+version = "0.3.4"498 source = "registry+https://github.com/rust-lang/crates.io-index"430-checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d"499+checksum = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431"500 dependencies = [501 "getrandom",433- "redox_syscall 0.1.57",502+ "redox_syscall 0.1.56",503+ "rust-argon2",504 ]505 506 [[package]]507 name = "regex"13 unmodified lines521 checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"522 523 [[package]]524 name = "remove_dir_all"455-version = "0.5.3"525+version = "0.5.2"526 source = "registry+https://github.com/rust-lang/crates.io-index"457-checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"527+checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e"528 dependencies = [529 "winapi",530 ]531 532 [[package]]533+name = "rust-argon2"534+version = "0.7.0"535+source = "registry+https://github.com/rust-lang/crates.io-index"536+checksum = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017"537+dependencies = [538+ "base64",539+ "blake2b_simd",540+ "constant_time_eq",541+ "crossbeam-utils",542+]543+544+[[package]]545 name = "same-file"546 version = "1.0.6"547 source = "registry+https://github.com/rust-lang/crates.io-index"548 checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"70 unmodified lines619 "lazy_static",620 ]621 622 [[package]]623+name = "time"624+version = "0.1.44"625+source = "registry+https://github.com/rust-lang/crates.io-index"626+checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"627+dependencies = [628+ "libc",629+ "wasi 0.10.0+wasi-snapshot-preview1",630+ "winapi",631+]632+633+[[package]]634 name = "unicode-width"542-version = "0.1.8"635+version = "0.1.7"636 source = "registry+https://github.com/rust-lang/crates.io-index"544-checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"637+checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479"638 639 [[package]]640 name = "unicode-xid"641 version = "0.2.2"17 unmodified lines659 checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"660 661 [[package]]662 name = "version_check"570-version = "0.9.3"663+version = "0.9.1"664 source = "registry+https://github.com/rust-lang/crates.io-index"572-checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"665+checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce"666 667 [[package]]668+name = "void"669+version = "1.0.2"670+source = "registry+https://github.com/rust-lang/crates.io-index"671+checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"672+673+[[package]]674 name = "walkdir"675 version = "2.3.1"676 source = "registry+https://github.com/rust-lang/crates.io-index"677 checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"9 unmodified lines687 source = "registry+https://github.com/rust-lang/crates.io-index"688 checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"689 690 [[package]]691+name = "wasi"692+version = "0.10.0+wasi-snapshot-preview1"693+source = "registry+https://github.com/rust-lang/crates.io-index"694+checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"695+696+[[package]]697 name = "winapi"593-version = "0.3.9"698+version = "0.3.8"699 source = "registry+https://github.com/rust-lang/crates.io-index"595-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"700+checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"701 dependencies = [702 "winapi-i686-pc-windows-gnu",703 "winapi-x86_64-pc-windows-gnu",704 ]21 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