gitbox 2.1.3

Git toolbox to simplify adoption of conventional commits and semantic version, among other things.
Documentation
use std::io::stdout;
use std::io::Write;

use crate::application::manager::message_egress_manager::MessageEgressManager;

pub struct MessageEgressManagerImpl {}

impl MessageEgressManagerImpl {
    pub fn new() -> MessageEgressManagerImpl {
        MessageEgressManagerImpl {}
    }
}

impl MessageEgressManager for MessageEgressManagerImpl {
    fn output(&self, message: &str) {
        if let Err(e) = writeln!(stdout(), "{}", message) {
            match e.kind() {
                std::io::ErrorKind::BrokenPipe => {}
                _ => self.error(&e.to_string()),
            }
        }
    }

    fn error(&self, error: &str) {
        eprintln!("{}", error);
    }
}