summaryrefslogtreecommitdiffstats
path: root/imag-bookmark
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-07-14 20:49:36 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-07-14 21:08:46 +0200
commitde4c700d6e380128479ed434470f72a2880d7bc9 (patch)
tree568ae656779748105907ed32aee0cd63a6bebc78 /imag-bookmark
parente773294b2ca627321380bae1942472d65f4530a3 (diff)
Impl remove()
Diffstat (limited to 'imag-bookmark')
-rw-r--r--imag-bookmark/src/main.rs11
1 files changed, 10 insertions, 1 deletions
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");
}