Commit Graph

74 Commits

Author SHA1 Message Date
sharkdp 50fca2dca2 Disable full-path glob test on Windows 2019-09-15 16:47:38 +02:00
sharkdp 588888112a Adapt full-path glob test for Windows 2019-09-15 16:47:38 +02:00
sharkdp eac20a8132 Add --regex option to override --glob 2019-09-15 16:47:38 +02:00
sharkdp d5da615c17 Implement glob-based searches
closes #284
2019-09-15 16:47:38 +02:00
David Peter 3599a30ee2
Support FILE_ATTRIBUTE_HIDDEN on Windows (#478) 2019-09-15 12:41:04 +02:00
Nathan Moreau 761c445263 Add a non regression test. 2019-09-15 10:57:27 +02:00
Tim Holland 074cfad3d4 Remove deprecated trim_left(_matches)?
warning: use of deprecated item 'core::str::<impl str>::trim_left_matches': superseded by `trim_start_matches`
   --> src/main.rs:222:28
    |
222 |                 .map(|e| e.trim_left_matches('.'))
    |                            ^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(deprecated)] on by default
2019-03-02 08:15:12 +01:00
Alexandru Macovei 051ff5987a [2018 edition] remove all extern crate lines from sources 2019-01-07 12:52:30 +01:00
Alexandru Macovei 64e6ea9fe9 [2018 edition] run cargo fix edition and edition-idioms 2019-01-07 12:52:30 +01:00
kimsnj 6b40a075cd exec-batch: fix a panic with -X "echo {}" and pass stdio to child cmd 2018-11-12 21:11:40 +01:00
kimsnj 45d1b15cff Add support for batch execution of command 2018-11-12 21:11:40 +01:00
sharkdp deea31cbbc Add aliases, change help text 2018-10-27 15:34:10 +02:00
Karim SENHAJI abe8aa55c0 clean-up first implementation of modification date filter 2018-10-10 19:52:37 +02:00
Karim SENHAJI 54c117d72f Add support for --changed-before and --changed-with for modification time based search 2018-10-10 19:52:37 +02:00
sharkdp 27caa33729 cargo fmt 2018-09-27 23:01:38 +02:00
sharkdp aa70c5a446 Add `--type empty`
Add a new `empty`/`e` type to search for empty files and/or directories.

To search for both empty files and directories, use one of the
following:

    fd --type empty
    fd -te

    fd --type empty --type file --type directory

To search for empty files, use

    fd --type empty --type file
    fd -te -tf

To search for empty directories, use

    fd --type empty --type directory
    fd -te -td

closes #273
2018-08-19 17:05:04 +02:00
sharkdp c428f52209 Run cargo fmt 2018-08-03 21:20:48 +02:00
sharkdp 59c9901cde Update dependencies, fix #313 2018-08-03 21:20:48 +02:00
sharkdp c1ef68662c Update for new rustfmt 2018-05-14 21:00:00 +02:00
sharkdp a3200204dc Simplifications to --size tests 2018-04-29 22:26:10 +02:00
Jonathan e2b2701965 Add helper method to create sized files, use meaningful names and add kibi and kilo tests. 2018-04-29 21:56:31 +02:00
Jonathan 409cf0c7a1 Remove use (which broke the build) 2018-04-29 21:56:31 +02:00
Jonathan f01685c63f Add tests for SizeFilter (--size) fixes sharkdp/fd#289 2018-04-29 21:56:31 +02:00
sharkdp 6a9f16e159 Run latest version of rustfmt 2018-04-13 23:13:22 +02:00
sharkdp 37483036e0 Implement --ignore-file 2018-03-26 08:28:22 +02:00
David Peter 8c1b037279
Normalize absolute paths, fixes #268 (#270)
* Normalize absolute paths, fixes #268
* Split unit tests into several tests
2018-03-25 23:47:58 +02:00
sharkdp 9d840dd485 Separate unit tests 2018-03-25 19:00:46 +02:00
sharkdp 4f6c43a6dc Unit test for --type x 2018-03-25 18:37:50 +02:00
sharkdp 3386b854b0 Run invalid-utf8 on Linux only 2018-02-26 08:20:31 +01:00
sharkdp 47d95284aa Skip invalid utf8 filenames, closes #250 2018-02-26 08:20:31 +01:00
sharkdp b4be1f161c Add support for .fdignore files 2018-02-21 22:55:26 +01:00
sharkdp 814d37030e Implement -F/--fixed-strings/--literal 2018-02-10 15:55:06 +01:00
Martin Larralde 86fe9977e8 Implement multiple suffixes extension support with tests (#214) 2018-02-10 14:18:37 +01:00
Steve Pentland b4d39270d6 Allow -exec to work as --exec (#226)
* Replace usage of `-exec` by `--exec`, except when it is used as a value that is given to `--exec/-exec/-x`.
* Limit usage of --exec option to single instance.
2018-01-29 20:32:46 +01:00
sharkdp a5f5ad6254 Re-enable code style check 2018-01-01 16:00:32 +01:00
Thejaswi Kadur faf934da4b Added support for filtering by multiple filetypes and extensions (#205)
Closes #177 
Closes #199
2018-01-01 12:09:33 +01:00
Dock 51aea57a6a Add multiple path support (#182)
* Adding support for multiple paths. (panic)

- Started adding multiple file support
- fd panics with multiple files right now

* Moved the ctrlc handler to main.

- Moved the ctrlc handler to main so we can search multiple files

* Tests now allow custom directory setup

- TestEnv::new() now takes two arguments, the directories to create and
the files to create inside those directories.

* rust-fmt changes

* rust-fmt changes

* Moving code around, no need to do everything in one big loop

- PathDisplay was never actually used for anything, removed it during refactor of main
- Removed redundant logic for absolute paths
- Moved code placed needlessly inside a loop in the last commit outside of that loop.

* Moving code around, no need to do everything in one big loop

- PathDisplay was never actually used for anything, removed it during refactor of main
- Removed redundant logic for absolute paths
- Moved code placed needlessly inside a loop in the last commit outside of that loop.

* Removed commented code in testenv

* Refactored walk::scan to accept the path buffer vector. Using the ParallelWalker allows for multithreaded searching of multiple directories

* Moved ctrlc handler back into walker, it is only called once from main now.

* Moved the colored output check back to it's original place

* Removing shell-escape, not sure how it got added...

* Added test for `fd 'a.foo' test1` to show that a.foo is only found in the test1 and not the test2 direcotry

* Removing side effect from walk::scan, `dir_vec` is no longer a mutable reference and an iterator is being used instead.

* Running rustfmt to format code correctly
2017-12-06 14:52:23 -08:00
ptzz 9bd1d12c00 Add --no-ignore-vcs option
When passed, .gitignore files will not be respected.
2017-11-22 23:18:22 +01:00
Matthias Reitinger bc88b8f80e Fix exec tests 2017-11-15 23:18:36 +01:00
sharkdp bba5c4f607 Fix some clippy warnings 2017-10-26 21:13:56 +02:00
J.W 614f576c47 Add TODOs and FIXMEs about Windows 2017-10-26 20:56:32 +02:00
J.W dc29ef70c4 Fix Input::remove_extension and Input::dirname 2017-10-26 20:56:32 +02:00
J.W d702d849ea Test --exec on Unix 2017-10-26 20:56:32 +02:00
sharkdp 5ad69fb2fb Add support for exclude-patterns
* Add `--exclude`/`-E` option.
* Support for multiple exclude patterns

Example:
``` bash
> fd --exclude 'tests/**/*.rs' mod
src/exec/mod.rs
src/fshelper/mod.rs
src/lscolors/mod.rs
```

Closes #89
2017-10-25 22:22:12 +02:00
Antti Keränen 701b8f209b Relicense under MIT/Apache-2.0 2017-10-22 10:36:42 +02:00
J.W 8d85debc12 Refactor path handling (fixes #113)
* Fix path check
* Fix full path matching
* Allow more simple driver names in Windows tests
* Factor out special is_dir() check for "." and ".."
2017-10-18 20:04:34 +02:00
J.W e649c8fa79 Use a uniform output format for searching ../
closes #107, fixes #82 by the way
2017-10-15 15:01:24 +02:00
Matthias Reitinger b441528067 Improve smart case to only consider literal uppercase chars (#103) 2017-10-14 11:03:21 +02:00
sharkdp 8fc3a83d92 Use absolute path to perform search, fixes #81
Previously, we were using the relative path to extract the search
string. For the current directory, the returned relative path was equal
to `""`. This is why the current directory did not show in the search
results (see #81).

This commit also changes the way that `--full-path` works, which was
previously working on relative paths. It seems more useful to search the
absolute path, though. Otherwise, search results could change just by
calling fd (with a given search path) from a different directory.
2017-10-13 18:16:26 +02:00
Antti Keränen 049b9ec06b Format the source code using `rustfmt` 2017-10-12 19:33:14 +02:00