diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-12-05 15:55:08 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2017-01-25 09:54:17 +0100 |
commit | 69d5c69eea9cd4d2dd73e4e96d501c04c2651b14 (patch) | |
tree | a91895cb15f4475f094463fa886c0fb3c5c4e9c9 /imag-link/src/main.rs | |
parent | 64c611847b6abfb8c70a160e97d6666ca82b2692 (diff) |
Provide flag to still list external links
Diffstat (limited to 'imag-link/src/main.rs')
-rw-r--r-- | imag-link/src/main.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/imag-link/src/main.rs b/imag-link/src/main.rs index d583d5ca..37887915 100644 --- a/imag-link/src/main.rs +++ b/imag-link/src/main.rs @@ -84,7 +84,7 @@ fn main() { fn handle_internal_linking(rt: &Runtime) { use libimagentrylink::internal::InternalLinker; - use libimagentrylink::external::iter::NoExternalIter; + use libimagentrylink::external::is_external_link_storeid; debug!("Handle internal linking call"); let cmd = rt.cli().subcommand_matches("internal").unwrap(); @@ -97,7 +97,13 @@ fn handle_internal_linking(rt: &Runtime) { match get_entry_by_name(rt, entry) { Ok(Some(e)) => { e.get_internal_links() - .map(NoExternalIter::new) + .map(|iter| { + if cmd.is_present("list-externals-too") { + iter.filter(|_| true) + } else { + iter.filter(|id| !is_external_link_storeid(&id)) + } + }) .map(|links| { let i = links .filter_map(|l| { |