From 091564458b53eaa1b421ca4ae801cc4ab03b2f77 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 29 Mar 2020 15:32:52 +0200 Subject: WIP Signed-off-by: Matthias Beyer --- bin/core/imag-link/src/lib.rs | 2 ++ bin/core/imag-link/src/ui.rs | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/bin/core/imag-link/src/lib.rs b/bin/core/imag-link/src/lib.rs index d4054429..676063fe 100644 --- a/bin/core/imag-link/src/lib.rs +++ b/bin/core/imag-link/src/lib.rs @@ -138,6 +138,8 @@ fn link_from_to<'a, I>(rt: &'a Runtime, from: &'a str, to: I) -> Result<()> where I: Iterator { let directional = rt.cli().is_present("directional"); + let chain = rt.cli().is_present("chain"); + let mesh = rt.cli().is_present("mesh"); let mut from_entry = get_entry_by_name(rt, from)?.ok_or_else(|| anyhow!("No 'from' entry"))?; for entry in to { diff --git a/bin/core/imag-link/src/ui.rs b/bin/core/imag-link/src/ui.rs index 90aa2506..2ad63d32 100644 --- a/bin/core/imag-link/src/ui.rs +++ b/bin/core/imag-link/src/ui.rs @@ -116,6 +116,22 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .help("When creating links, make them directional") .requires_all(&["from", "to"])) + .arg(Arg::with_name("chain") + .long("chain") + .takes_value(false) + .required(false) + .multiple(false) + .help("When creating links for more than two entries, make a chain rather than a mesh") + .conflicts_with("mesh")) + + .arg(Arg::with_name("mesh") + .long("mesh") + .takes_value(false) + .required(false) + .multiple(false) + .help("When creating links for more than two entries, make a mesh rather than a chain") + .conflicts_with("chain")) + } /// PathProvider -- cgit v1.2.3