Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add confirmation dialogs for file overwriting #2

Merged
merged 3 commits into from
Mar 28, 2021
Merged

Conversation

vrmiguel
Copy link
Member

No description provided.

pub struct Error;

impl<'a> Confirmation<'a> {
pub fn new(prompt: &'a str, pattern: Option<&'a str>) -> Self {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be useful for this structure to receive multiple placeholders, so we could remove the placeholder Option, and instead insert multiple "REPLACE" in the prompt.

By this, when running .ask(), we accept a slice of patterns for replacing in order.

I don't know if we'll need this, so the current implementation looks fine.

However, I do think that "REPLACE" is better than providing a placeholder to simplify the code.

@vrmiguel vrmiguel merged commit 7e85798 into master Mar 28, 2021
@vrmiguel vrmiguel deleted the user-confirmation branch March 28, 2021 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants