uutils / findutils

Rust implementation of findutils
MIT License
314 stars 38 forks source link

Extensible matchers implemented via config struct and predicate lists #431

Open hanbings opened 3 months ago

hanbings commented 3 months ago

Organize the configurations that need to be passed from the argument parser to the matcher.

For example, in the implementation of -follow, we need to use config.follow from the argument parser to pass a follow: bool to TimeMatcher. Can we change it to config: &Config to pass Config directly without repeatedly modifying these parts of the code when adding other options in the future?

And can we centralize these predicate logics by passing a predicate list or maintaining a predicate list in Config? In this way, we don't need to modify Matcher one by one.