/// Print a config item, do not actually run
///
- /// One line is output for each association
+ /// One line is output for each association.
+ /// Additional pseudo-config-keys are recognised:
+ /// `client`: our client virtual IP address;
+ /// `server`: server's logical name in the config;
+ /// `link`: the link name including the `[ ]`.
#[clap(long)]
print_config: Option<String>,
}
&opts.config, &opts.log, |ics| {
if let Some(arg) = &opts.print_config {
for ic in &ics {
- implement_print_config(arg, &|k| ic.inspect_key(k))?;
+ implement_print_config(arg, &|k| Some(match k {
+ "link" => &ic.link,
+ "server" => &ic.link.server,
+ "client" => &ic.link.client,
+ k => return ic.inspect_key(k),
+ }))?;
}
process::exit(0);
}
}
impl_inspectable_config_value!{ String as Display }
+impl_inspectable_config_value!{ ServerName as Display }
+impl_inspectable_config_value!{ ClientName as Display }
impl_inspectable_config_value!{ u16 as Display }
impl_inspectable_config_value!{ u32 as Display }
impl_inspectable_config_value!{ hyper::Uri as Display }