fixed output bug when not set option column #577

This commit is contained in:
DustInDark
2022-06-09 01:53:53 +09:00
parent 4f0bd67ca9
commit d716ffb13e

View File

@@ -414,7 +414,15 @@ enum ColPos {
fn _get_serialized_disp_output(dispformat: Option<DisplayFormat>) -> String {
if dispformat.is_none() {
return "Timestamp|Computer|Channel|EventID|Level|RuleTitle|Details|RecordID|RecordInformation\n".to_string();
let mut titles = vec!["Timestamp","Computer","Channel","EventID","Level","RuleTitle","Details"];
let arg_match = &configs::CONFIG.read().unwrap().args;
if arg_match.is_present("display-record-id") {
titles.push("RecordID");
}
if arg_match.is_present("full-data") {
titles.push("RecordInformation");
}
return format!("{}\n", titles.join("|"));
}
let mut disp_serializer = csv::WriterBuilder::new()
.double_quote(false)