aboutsummaryrefslogtreecommitdiff
path: root/src/output/mod.rs
blob: 73af5abdfceca9e8c8ebb6cf9bbb422a046bc93b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use super::{FightOutcome, LogResult, Opt};

use std::io;

pub mod formats;
pub mod aggregators;
pub mod pipeline;

pub use self::pipeline::Pipeline;


/// Build an pipeline for the given command line options.
pub fn build_pipeline(opt: &Opt) -> Pipeline {
    let stream = io::stdout();
    let aggregator = aggregators::WriteThrough;

    if opt.file_name_only {
        Pipeline::new(stream, formats::FileOnly, aggregator)
    } else {
        Pipeline::new(stream, formats::HumanReadable, aggregator)
    }
}