report: use '$' instead of '#' for showing commands

since some files can contain '#' character for comments. (i.e.,
/etc/hosts)

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
This commit is contained in:
Oguz Bektas 2020-11-10 16:01:46 +01:00 committed by Thomas Lamprecht
parent 94ffca10a2
commit 57f472d9bb
1 changed files with 3 additions and 3 deletions

View File

@ -57,7 +57,7 @@ pub fn generate_report() -> String {
Ok(None) => String::from("# file does not exist"), Ok(None) => String::from("# file does not exist"),
Err(err) => err.to_string(), Err(err) => err.to_string(),
}; };
format!("# cat '{}'\n{}", file_name, content) format!("$ cat '{}'\n{}", file_name, content)
}) })
.collect::<Vec<String>>() .collect::<Vec<String>>()
.join("\n\n"); .join("\n\n");
@ -73,14 +73,14 @@ pub fn generate_report() -> String {
Ok(output) => String::from_utf8_lossy(&output.stdout).to_string(), Ok(output) => String::from_utf8_lossy(&output.stdout).to_string(),
Err(err) => err.to_string(), Err(err) => err.to_string(),
}; };
format!("# `{} {}`\n{}", command, args.join(" "), output) format!("$ `{} {}`\n{}", command, args.join(" "), output)
}) })
.collect::<Vec<String>>() .collect::<Vec<String>>()
.join("\n\n"); .join("\n\n");
let function_outputs = function_calls() let function_outputs = function_calls()
.iter() .iter()
.map(|(desc, function)| format!("# {}\n{}", desc, function())) .map(|(desc, function)| format!("$ {}\n{}", desc, function()))
.collect::<Vec<String>>() .collect::<Vec<String>>()
.join("\n\n"); .join("\n\n");