src/bin/proxmox-backup-client.rs - status: only print result[data]
This commit is contained in:
parent
15c847f136
commit
f6ede796ca
@ -285,7 +285,7 @@ fn list_backup_groups(
|
||||
}
|
||||
}
|
||||
|
||||
if output_format != "text" { format_and_print_result(result.into(), &output_format); }
|
||||
if output_format != "text" { format_and_print_result(&(result.into()), &output_format); }
|
||||
|
||||
Ok(Value::Null)
|
||||
}
|
||||
@ -344,7 +344,7 @@ fn list_snapshots(
|
||||
}
|
||||
}
|
||||
|
||||
if output_format != "text" { format_and_print_result(result.into(), &output_format); }
|
||||
if output_format != "text" { format_and_print_result(&result.into(), &output_format); }
|
||||
|
||||
Ok(Value::Null)
|
||||
}
|
||||
@ -796,7 +796,7 @@ fn status(
|
||||
avail,
|
||||
);
|
||||
} else {
|
||||
format_and_print_result(result, &output_format);
|
||||
format_and_print_result(data, &output_format);
|
||||
}
|
||||
|
||||
Ok(Value::Null)
|
||||
|
@ -27,7 +27,7 @@ lazy_static!{
|
||||
/// This is implemented for machine generatable formats 'json' and
|
||||
/// 'json-pretty'. The 'text' format needs to be handled somewhere
|
||||
/// else.
|
||||
pub fn format_and_print_result(result: Value, output_format: &str) {
|
||||
pub fn format_and_print_result(result: &Value, output_format: &str) {
|
||||
|
||||
if output_format == "json-pretty" {
|
||||
println!("{}", serde_json::to_string_pretty(&result).unwrap());
|
||||
|
Loading…
Reference in New Issue
Block a user