Commit Graph

5 Commits

Author SHA1 Message Date
Jeremy Smart c5ff1bbb6b implement locate and updatedb (#536)
---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2026-06-06 10:10:44 +02:00
Tavian Barnes 36cc88e159 find/matchers: Implement POSIX-compliant globs
The glob crate exposes .gitignore style globs with recursive (**)
matching and other features.  find should implement globs exactly as
specified by POSIX.  Do this by translating them to POSIX Basic Regular
Expressions.

Fixes #140.
2022-02-23 21:08:04 -05:00
Ryan Gonzalez 3a1c42123f Add an initial implementation of xargs
This includes much of the core xargs functionality, with the following
notable exceptions:

- Parallel execution (`-P`): This option currently just does
  nothing, that way anything that passes -P can at least run without a
  notable behavior shift (other than simply being slower).
- Replacement strings (`-I`): This can easily be worked around via an
  intermediate shell invocation (e.g. `xargs -L1 sh -c 'do-things-with
  $@' --`).
- EOF strings (`-E`): I've honestly never seen this actually used,
  though it would not be particularly difficult to implement given the
  current architecture.

Closes #37

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2022-01-22 20:22:01 -06:00
Sylvestre Ledru f9e736d194 replace tempdir by tempfile 2021-09-07 10:36:07 +02:00
mcharsley 3198ff3b82 Initial dump of my code (#1)
* Initial checkin. Supports -name, -name -print and a subset of -type

Has unit tests, but no system tests

* Corrected usage text

* Added ability to replace stdout with a fake. Moved and_matcher to
logical_matchers

* Significant refactoring to allow tests for the arg-parsing code

* Added tests for the argument parsing code.

* Added support for or operator

* Added change missing form last commit

* Added AUTHORS and (MIT) LICENSE

* Added support for lists (i.e. the comma operand)

* Added support for parentheses

* Cleaned up names of some Or/And/List matcher methods

* Added support for depth-first searching

* Added initial support for max_depth, min_depth and depth arguments.

* Cleaned up a surfeit of Box::new's and change the [Or|And|List]Matchers
to use builders, so submatchers can't be added later on.

* Added support for -a

* Added support for prune

* Added prune

* Refactored the way we fake stdoutput.

Will allowing for easy expansion for stderr, clocks etc.

* Renamed side effects to matcherio

* Removed leftover tracing println call

* Tidied up use statements

* Switched to using walkdir

* Added support for -newer

* renamed new_sideeffetcs to new_matcher_io

* Implemented ctime, atime and mtime

* merged name_matcher and caseless_name_matcher into one module

* Added support for -size

* Minor tweaks based on code review

* Switched Config struct to implement Default

* Replaced try! with ?

* Added copyright headers
2017-03-08 14:39:37 +00:00