zkstack_cli_common 0.1.2

ZK Stack CLI is a set of tools for working with zk stack.
Documentation
use std::fmt::Display;

use cliclack::Confirm;

pub struct PromptConfirm {
    inner: Confirm,
}

impl PromptConfirm {
    pub fn new(question: impl Display) -> Self {
        Self {
            inner: Confirm::new(question),
        }
    }

    pub fn default(self, default: bool) -> Self {
        Self {
            inner: self.inner.initial_value(default),
        }
    }

    pub fn ask(mut self) -> bool {
        self.inner.interact().unwrap()
    }
}