diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/cli_interactor.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/cli_interactor.rs b/src/lib/cli_interactor.rs index 8bcda19..e944bf9 100644 --- a/src/lib/cli_interactor.rs +++ b/src/lib/cli_interactor.rs | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | use anyhow::{Context, Result}; | 1 | use anyhow::{Context, Result}; |
| 2 | use dialoguer::{Confirm, Input, Password, theme::ColorfulTheme}; | 2 | use dialoguer::{ |
| 3 | Confirm, Input, Password, | ||
| 4 | theme::{ColorfulTheme, Theme}, | ||
| 5 | }; | ||
| 3 | use indicatif::TermLike; | 6 | use indicatif::TermLike; |
| 4 | #[cfg(test)] | 7 | #[cfg(test)] |
| 5 | use mockall::*; | 8 | use mockall::*; |
| @@ -323,6 +326,19 @@ where | |||
| 323 | Ok(selected_choices) | 326 | Ok(selected_choices) |
| 324 | } | 327 | } |
| 325 | 328 | ||
| 329 | pub fn show_multi_input_prompt_success(label: &str, values: &[String]) { | ||
| 330 | let values_str: Vec<&str> = values.iter().map(std::string::String::as_str).collect(); | ||
| 331 | eprintln!("{}", { | ||
| 332 | let mut s = String::new(); | ||
| 333 | let _ = ColorfulTheme::default().format_multi_select_prompt_selection( | ||
| 334 | &mut s, | ||
| 335 | label, | ||
| 336 | &values_str, | ||
| 337 | ); | ||
| 338 | s | ||
| 339 | }); | ||
| 340 | } | ||
| 341 | |||
| 326 | #[derive(Debug, Default)] | 342 | #[derive(Debug, Default)] |
| 327 | pub struct Printer { | 343 | pub struct Printer { |
| 328 | printed_lines: Vec<String>, | 344 | printed_lines: Vec<String>, |