From 0c5a3c001ccafd458a9b99b7513a9c8c172a54b2 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 25 Nov 2024 16:09:36 +0000 Subject: feat(list): report on action selection there was a bug in `Interactor` so that reports were turned off by default for choices. This was embodied into the CLI tests but this turns them on in these scenarios. --- src/lib/cli_interactor.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib/cli_interactor.rs b/src/lib/cli_interactor.rs index 2ceb088..50a0f0c 100644 --- a/src/lib/cli_interactor.rs +++ b/src/lib/cli_interactor.rs @@ -178,7 +178,6 @@ impl Default for PromptChoiceParms { impl PromptChoiceParms { pub fn with_prompt>(mut self, prompt: S) -> Self { self.prompt = prompt.into(); - self.report = true; self } @@ -198,7 +197,6 @@ impl PromptChoiceParms { } } -#[derive(Default)] pub struct PromptMultiChoiceParms { pub prompt: String, pub choices: Vec, @@ -206,10 +204,20 @@ pub struct PromptMultiChoiceParms { pub report: bool, } +impl Default for PromptMultiChoiceParms { + fn default() -> Self { + Self { + prompt: String::new(), + choices: vec![], + defaults: None, + report: true, + } + } +} + impl PromptMultiChoiceParms { pub fn with_prompt>(mut self, prompt: S) -> Self { self.prompt = prompt.into(); - self.report = true; self } -- cgit v1.2.3