chiark / gitweb /
print config value
[hippotat.git] / src / config.rs
index f3dfe4907eb2f7232ec3926e75c45de564320d2c..90f2296145e345811f3f43b3ca12bf72b33af3fb 100644 (file)
@@ -88,10 +88,6 @@ pub struct Opts {
   /// Additional config files or dirs, which can override the others
   #[structopt(long, multiple=true, number_of_values=1)]
   pub extra_config: Vec<PathBuf>,
-  
-  /// Print configuration rather than running
-  #[structopt(long)]
-  pub print_config: bool,
 }
 
 pub trait InspectableConfigValue {
@@ -121,6 +117,13 @@ macro_rules! impl_inspectable_config_value {
   };
 }
 
+pub struct DisplayInspectable<'i>(pub &'i dyn InspectableConfigValue);
+impl<'i> Display for DisplayInspectable<'i> {
+  fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    InspectableConfigValue::fmt(self.0, f)
+  }
+}
+
 impl_inspectable_config_value!{ String as Display }
 impl_inspectable_config_value!{ u16 as Display }
 impl_inspectable_config_value!{ u32 as Display }