From a5f82e882661c76dca8d9101c87de4a5045962ed Mon Sep 17 00:00:00 2001 From: Alex Burka Date: Tue, 29 Aug 2017 14:36:46 -0400 Subject: [PATCH] ignore: add grouped toggle for standard filters --- ignore/src/walk.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ignore/src/walk.rs b/ignore/src/walk.rs index bd73309..3df7933 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.