lsmem: Fix JSON output to be matching util-linux
This commit is contained in:
parent
f609546109
commit
afd27bdcaf
@ -526,7 +526,10 @@ fn print_json(lsmem: &Lsmem, opts: &Options) {
|
|||||||
memory: create_table_rows(lsmem, opts),
|
memory: create_table_rows(lsmem, opts),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut table_json_string = serde_json::to_string_pretty(&table_json).unwrap();
|
let mut table_json_string = serde_json::to_string_pretty(&table_json)
|
||||||
|
.unwrap()
|
||||||
|
.replace(" ", " ") // Ident 3 spaces
|
||||||
|
.replace("},\n {", "},{"); // Remove newlines between '}, {'
|
||||||
table_json_string = table_json_string.replace("\"yes\"", "true");
|
table_json_string = table_json_string.replace("\"yes\"", "true");
|
||||||
table_json_string = table_json_string.replace("\"no\"", "false");
|
table_json_string = table_json_string.replace("\"no\"", "false");
|
||||||
println!("{table_json_string}");
|
println!("{table_json_string}");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user