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.
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 afollow: bool
toTimeMatcher
. Can we change it toconfig: &Config
to passConfig
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 modifyMatcher
one by one.