diff --git a/cli/src/filters.rs b/cli/src/filters.rs index d44d7da..2b46090 100644 --- a/cli/src/filters.rs +++ b/cli/src/filters.rs @@ -199,11 +199,11 @@ async fn guess_mime(path: &Path) -> Option { impl Filter for Magic { async fn matches(&self, file: &Path) -> bool { match *self { - Magic::Magic { ref bytes, offset } => read_first_bytes(bytes.len(), file, offset) + Self::Magic { ref bytes, offset } => read_first_bytes(bytes.len(), file, offset) .await .map(|read| read == *bytes) .unwrap_or(false), - Magic::Mime(ref mime_type) => guess_mime(file) + Self::Mime(ref mime_type) => guess_mime(file) .await .map(|typ| typ.mime_type() == mime_type) .unwrap_or(false), diff --git a/cli/src/main.rs b/cli/src/main.rs index 5fd63e8..c6c1bd5 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -46,9 +46,15 @@ async fn main() -> Result<()> { .try_collect() .await?; + if !args.execute { + println!("Dry run, to apply changes run with flag `-!`\n"); + } + + //let out = stream::iter(tasks) .flatten() - .for_each_concurrent(None, |(action, path)| action.run(path, args.execute)) + .then(|(action, path)| action.run(path, args.execute)) + .count() .await; Ok(())