aboutsummaryrefslogtreecommitdiff
path: root/src/output/mod.rs
diff options
context:
space:
mode:
authorDaniel <kingdread@gmx.de>2020-08-28 15:49:12 +0200
committerDaniel <kingdread@gmx.de>2020-08-28 15:59:17 +0200
commit09e1f9c330ec99de06c834b2de95c378bc6d00d3 (patch)
tree387d58df01ef305245cc58eb456d3e7731dbfc16 /src/output/mod.rs
parentea60bea5854976e45cee5026c5bdc21d19c0dc0f (diff)
downloadraidgrep-09e1f9c330ec99de06c834b2de95c378bc6d00d3.tar.gz
raidgrep-09e1f9c330ec99de06c834b2de95c378bc6d00d3.tar.bz2
raidgrep-09e1f9c330ec99de06c834b2de95c378bc6d00d3.zip
add --count/-n flag
Diffstat (limited to 'src/output/mod.rs')
-rw-r--r--src/output/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/output/mod.rs b/src/output/mod.rs
index c1cd787..e0b28cc 100644
--- a/src/output/mod.rs
+++ b/src/output/mod.rs
@@ -14,7 +14,9 @@ use self::{aggregators::Aggregator, formats::Format};
/// Build an pipeline for the given command line options.
pub fn build_pipeline(opt: &Opt) -> Pipeline {
let stream = io::stdout();
- let aggregator: Box<dyn Aggregator> = if let Some(sorting) = &opt.sorting {
+ let aggregator: Box<dyn Aggregator> = if opt.count {
+ Box::new(aggregators::CountingOutput::new())
+ } else if let Some(sorting) = &opt.sorting {
Box::new(aggregators::SortedOutput::new(sorting.clone()))
} else {
Box::new(aggregators::WriteThrough)