From: Ian Jackson Date: Wed, 2 Jun 2021 00:10:15 +0000 (+0100) Subject: otter cli: Make space for SubcommandProperties X-Git-Tag: otter-0.7.0~121 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=e0c247966250611646875286f1ece44fe922270a;p=otter.git otter cli: Make space for SubcommandProperties Signed-off-by: Ian Jackson --- 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(), }} } }