diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-07-14 21:04:11 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-07-14 21:08:46 +0200 |
commit | dec6a27900684497d9cb29eaddba6df3994198b7 (patch) | |
tree | f10793ad21d03c44090605ece8c57da3eea0cd5b /imag-bookmark | |
parent | 803806ea77374c8ce1b6c7579d20a5f46dd4688e (diff) |
Impl list()
Diffstat (limited to 'imag-bookmark')
-rw-r--r-- | imag-bookmark/src/main.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/imag-bookmark/src/main.rs b/imag-bookmark/src/main.rs index dc24b6f8..2d003463 100644 --- a/imag-bookmark/src/main.rs +++ b/imag-bookmark/src/main.rs @@ -83,7 +83,26 @@ fn collection(rt: &Runtime) { } fn list(rt: &Runtime) { - unimplemented!() + let scmd = rt.cli().subcommand_matches("list").unwrap(); + let coll = scmd.value_of("collection").unwrap(); // enforced by clap + + BookmarkCollection::get(rt.store(), coll) + .map(|collection| { + match collection.links() { + Ok(links) => { + debug!("Listing..."); + for (i, link) in links.iter().enumerate() { + println!("{: >3}: {}", i, link); + }; + debug!("... ready with listing"); + }, + Err(e) => { + trace_error(&e); + exit(1); + }, + } + }); + info!("Ready"); } fn remove(rt: &Runtime) { |