changed "Results Summary:" color to Green #595
This commit is contained in:
@@ -3,7 +3,7 @@ use crate::detections::configs::TERM_SIZE;
|
||||
use crate::detections::print;
|
||||
use crate::detections::print::{AlertMessage, IS_HIDE_RECORD_ID};
|
||||
use crate::detections::utils;
|
||||
use crate::detections::utils::write_color_buffer;
|
||||
use crate::detections::utils::{write_color_buffer, get_writable_color};
|
||||
use bytesize::ByteSize;
|
||||
use chrono::{DateTime, Local, TimeZone, Utc};
|
||||
use csv::QuoteStyle;
|
||||
@@ -380,9 +380,7 @@ fn emit_csv<W: std::io::Write>(
|
||||
};
|
||||
|
||||
disp_wtr_buf.clear();
|
||||
disp_wtr_buf.set_color(ColorSpec::new().set_fg(None)).ok();
|
||||
writeln!(disp_wtr_buf, "Results Summary:").ok();
|
||||
disp_wtr.print(&disp_wtr_buf).ok();
|
||||
write_color_buffer(disp_wtr, get_writable_color(Color::Green), "Results Summary:").ok();
|
||||
|
||||
let terminal_width = match *TERM_SIZE {
|
||||
Some((Width(w), _)) => w as usize,
|
||||
|
||||
@@ -252,6 +252,15 @@ pub fn write_color_buffer(
|
||||
wtr.print(&buf)
|
||||
}
|
||||
|
||||
/// no-colorのオプションの指定があるかを確認し、指定されている場合はNoneをかえし、指定されていない場合は引数で指定されたColorをSomeでラップして返す関数
|
||||
pub fn get_writable_color(color: Color) -> Option<Color> {
|
||||
if configs::CONFIG.read().unwrap().args.no_color {
|
||||
None
|
||||
} else {
|
||||
Some(color)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* CSVのrecord infoカラムに出力する文字列を作る
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user