From e0c247966250611646875286f1ece44fe922270a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 2 Jun 2021 01:10:15 +0100 Subject: [PATCH] otter cli: Make space for SubcommandProperties Signed-off-by: Ian Jackson --- src/bin/otter.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/bin/otter.rs b/src/bin/otter.rs index 8a29c762..4e472add 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -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(), }} } } -- 2.30.2