chiark / gitweb /
otter cli: Make space for SubcommandProperties
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 2 Jun 2021 00:10:15 +0000 (01:10 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 2 Jun 2021 00:30:25 +0000 (01:30 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/bin/otter.rs

index 8a29c76287a8a79c2d02ea755eb6d2164a29b9cf..4e472add616eafd902f963df69aae85d02148a4c 100644 (file)
@@ -145,13 +145,18 @@ impl MainOpts {
 struct NoArgs { }
 fn noargs(_sa: &mut NoArgs) -> ArgumentParser { ArgumentParser::new() }
 
-struct Subcommand {
-  verb: &'static str,
-  help: &'static str,
-  call: fn(SubCommandCallArgs) -> Result<(),E>,
+pub struct Subcommand {
+  pub verb: &'static str,
+  pub help: &'static str,
+  pub call: fn(SubCommandCallArgs) -> Result<(),E>,
+  pub props: SubcommandProperties,
 }
 inventory::collect!(Subcommand);
 
+#[derive(Default)]
+pub struct SubcommandProperties {
+}
+
 pub struct SubCommandCallArgs {
   sc:   &'static Subcommand,
   out:  CookedStdout,
@@ -768,6 +773,7 @@ macro_rules! ordinary_subcmd {
       verb: $verb,
       help: $help,
       call,
+      props: default(),
     }}
   }
 }