Merge pull request #43 from epage/threads

fix: Remove threads flag
This commit is contained in:
Ed Page 2019-07-20 08:24:36 -06:00 committed by GitHub
commit 5b6b5bd9e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,10 +73,6 @@ struct Options {
)] )]
pub format: Format, pub format: Format,
#[structopt(short = "j", long = "threads", default_value = "0")]
/// The approximate number of threads to use.
threads: usize,
#[structopt(long, raw(overrides_with = r#""no-binary""#))] #[structopt(long, raw(overrides_with = r#""no-binary""#))]
/// Search binary files. /// Search binary files.
binary: bool, binary: bool,
@ -132,11 +128,7 @@ struct Options {
} }
impl Options { impl Options {
pub fn infer(mut self) -> Self { pub fn infer(self) -> Self {
if self.path.len() == 1 && self.path[0].is_file() {
self.threads = 1;
}
self self
} }
@ -277,8 +269,7 @@ fn run() -> Result<(), failure::Error> {
for path in &options.path[1..] { for path in &options.path[1..] {
walk.add(path); walk.add(path);
} }
walk.threads(options.threads) walk.hidden(options.ignore_hidden().unwrap_or(true))
.hidden(options.ignore_hidden().unwrap_or(true))
.ignore(options.ignore_dot().unwrap_or(true)) .ignore(options.ignore_dot().unwrap_or(true))
.git_global(options.ignore_global().unwrap_or(true)) .git_global(options.ignore_global().unwrap_or(true))
.git_ignore(options.ignore_vcs().unwrap_or(true)) .git_ignore(options.ignore_vcs().unwrap_or(true))