diff options
author | Alex Burka <alex@alexburka.com> | 2017-08-29 14:36:46 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2017-09-02 12:28:59 -0400 |
commit | a5f82e882661c76dca8d9101c87de4a5045962ed (patch) | |
tree | 2462d39924d545ebd0d27c62ebd86e2fa8afa6e0 /ignore | |
parent | ca6bd648ab11aeb3b3db9cc570db4d3db52f7bb2 (diff) |
ignore: add grouped toggle for standard filters
Diffstat (limited to 'ignore')
-rw-r--r-- | ignore/src/walk.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ignore/src/walk.rs b/ignore/src/walk.rs index bd733095..3df7933a 100644 --- a/ignore/src/walk.rs +++ b/ignore/src/walk.rs @@ -571,6 +571,29 @@ impl WalkBuilder { self } + /// Enables all the standard ignore filters. + /// + /// This toggles, as a group, all the filters that are enabled by default: + /// + /// - [hidden()](#method.hidden) + /// - [parents()](#method.parents) + /// - [ignore()](#method.ignore) + /// - [git_ignore()](#method.git_ignore) + /// - [git_global()](#method.git_global) + /// - [git_exclude()](#method.git_exclude) + /// + /// They may still be toggled individually after calling this function. + /// + /// This is (by definition) enabled by default. + pub fn standard_filters(&mut self, yes: bool) -> &mut WalkBuilder { + self.hidden(yes) + .parents(yes) + .ignore(yes) + .git_ignore(yes) + .git_global(yes) + .git_exclude(yes) + } + /// Enables ignoring hidden files. /// /// This is enabled by default. |