manta-cli 2.0.0-beta.12

Another CLI for ALPS
1
2
3
4
5
6
7
8
9
10
11
12
13
use dialoguer::{Confirm, theme::ColorfulTheme};

/// Prompt for confirmation; returns `true` immediately if `assume_yes` is set.
pub fn confirm(message: &str, assume_yes: bool) -> bool {
  if assume_yes {
    return true;
  }

  Confirm::with_theme(&ColorfulTheme::default())
    .with_prompt(message)
    .interact()
    .unwrap_or(false)
}