upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-11-25 16:09:36 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-11-25 16:09:36 +0000
commit0c5a3c001ccafd458a9b99b7513a9c8c172a54b2 (patch)
tree23067eeb18bf0a318c7a774aa45a9456fd38a7cf /src
parentb722aeb556507244f499b69caf01439418eb8ae6 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/lib/cli_interactor.rs14
1 files changed, 11 insertions, 3 deletions
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 {
178impl PromptChoiceParms { 178impl PromptChoiceParms {
179 pub fn with_prompt<S: Into<String>>(mut self, prompt: S) -> Self { 179 pub fn with_prompt<S: Into<String>>(mut self, prompt: S) -> Self {
180 self.prompt = prompt.into(); 180 self.prompt = prompt.into();
181 self.report = true;
182 self 181 self
183 } 182 }
184 183
@@ -198,7 +197,6 @@ impl PromptChoiceParms {
198 } 197 }
199} 198}
200 199
201#[derive(Default)]
202pub struct PromptMultiChoiceParms { 200pub struct PromptMultiChoiceParms {
203 pub prompt: String, 201 pub prompt: String,
204 pub choices: Vec<String>, 202 pub choices: Vec<String>,
@@ -206,10 +204,20 @@ pub struct PromptMultiChoiceParms {
206 pub report: bool, 204 pub report: bool,
207} 205}
208 206
207impl Default for PromptMultiChoiceParms {
208 fn default() -> Self {
209 Self {
210 prompt: String::new(),
211 choices: vec![],
212 defaults: None,
213 report: true,
214 }
215 }
216}
217
209impl PromptMultiChoiceParms { 218impl PromptMultiChoiceParms {
210 pub fn with_prompt<S: Into<String>>(mut self, prompt: S) -> Self { 219 pub fn with_prompt<S: Into<String>>(mut self, prompt: S) -> Self {
211 self.prompt = prompt.into(); 220 self.prompt = prompt.into();
212 self.report = true;
213 self 221 self
214 } 222 }
215 223