src/backup/catalog_shell.rs: sort output of list-selected

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
Christian Ebner 2019-12-10 13:01:38 +01:00 committed by Dietmar Maurer
parent 6d04612955
commit f084505ec5

View File

@ -418,8 +418,11 @@ fn restore_selected_command(target: String) -> Result<(), Error> {
/// List entries currently selected for restore.
fn list_selected_command() -> Result<(), Error> {
Context::with(|ctx| {
let mut list = ctx.selected.iter().collect::<Vec<&Vec<u8>>>();
list.sort();
let mut out = std::io::stdout();
for entry in &ctx.selected {
for entry in list {
out.write_all(entry)?;
out.write_all(&[b'\n'])?;
}