chiark / gitweb /
Config inspection: --dump-config experimental option
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 10 Jan 2023 01:25:50 +0000 (01:25 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 11 Jan 2023 02:12:41 +0000 (02:12 +0000)
This is going to go away, actually, since I don't like it.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
client/client.rs

index c1acdd2482fe510f05433a7eaa3ea6b0f49f01dd..cf7a935cb8a56b1f0a891d46496d50d819ec6a2f 100644 (file)
@@ -28,6 +28,9 @@ pub struct Opts {
   /// `link`: the link name including the `[ ]`.
   #[clap(long)]
   print_config: Option<String>,
+
+  #[clap(long, required(false))]
+  dump_config: bool,
 }
 
 type OutstandingRequest<'r> = Pin<Box<
@@ -334,6 +337,12 @@ async fn main() {
   let opts = <Opts as clap::Parser>::parse();
   let (ics,) = config::startup("hippotat", LinkEnd::Client,
                                &opts.config, &opts.log, |ics| {
+    if opts.dump_config {
+      for ic in &ics {
+        println!("{:#?}", ic);
+      }
+      process::exit(0);
+    }
     if let Some(arg) = &opts.print_config {
       for ic in &ics {
         implement_print_config(arg, &|k| Some(match k {