From de4c700d6e380128479ed434470f72a2880d7bc9 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 14 Jul 2016 20:49:36 +0200 Subject: [PATCH] Impl remove() --- imag-bookmark/src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/imag-bookmark/src/main.rs b/imag-bookmark/src/main.rs index b00efd32..758c52d5 100644 --- a/imag-bookmark/src/main.rs +++ b/imag-bookmark/src/main.rs @@ -65,6 +65,15 @@ fn list(rt: &Runtime) { } fn remove(rt: &Runtime) { - unimplemented!() + let scmd = rt.cli().subcommand_matches("remove").unwrap(); + let coll = scmd.value_of("collection").unwrap(); // enforced by clap + + BookmarkCollection::get(rt.store(), coll) + .map(|mut collection| { + for url in scmd.values_of("urls").unwrap() { // enforced by clap + collection.remove_link(BookmarkLink::from(url)).map_err(|e| trace_error(&e)); + } + }); + info!("Ready"); }