From 35ddf0b419062de62ca5fb33d6fc69153476cb4c Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Thu, 27 Feb 2020 14:33:33 +0100 Subject: [PATCH] catalog: shell: Introduce clear-selected command. 'clear-selected' allows to clear all the match patterns from the list of patterns for a subsequent restore. Signed-off-by: Christian Ebner --- src/backup/catalog_shell.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/backup/catalog_shell.rs b/src/backup/catalog_shell.rs index 645d7d4d..0b286c13 100644 --- a/src/backup/catalog_shell.rs +++ b/src/backup/catalog_shell.rs @@ -64,6 +64,10 @@ pub fn catalog_shell_cli() -> CommandLineInterface { .arg_param(&["path"]) .completion_cb("path", Shell::complete_path) ) + .insert( + "clear-selected", + CliCommand::new(&API_METHOD_CLEAR_SELECTED_COMMAND) + ) .insert( "restore-selected", CliCommand::new(&API_METHOD_RESTORE_SELECTED_COMMAND) @@ -466,6 +470,15 @@ fn deselect_command(path: String) -> Result<(), Error> { }) } +#[api( input: { properties: { } })] +/// Clear the list of files selected for restore. +fn clear_selected_command() -> Result<(), Error> { + Context::with(|ctx| { + ctx.selected.clear(); + Ok(()) + }) +} + #[api( input: { properties: {