From 6c2cd2ab4ffb47f3dec5c08279a0afe83601b57c Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 18 Nov 2011 19:30:54 +0100 Subject: Add new function to just prompt for confirmation --- lib/Fripost/Prompt.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/Fripost') diff --git a/lib/Fripost/Prompt.pm b/lib/Fripost/Prompt.pm index 0a9d5c6..d90d42d 100755 --- a/lib/Fripost/Prompt.pm +++ b/lib/Fripost/Prompt.pm @@ -17,9 +17,15 @@ use Exporter; use IO::Prompt; use String::MkPasswd qw/mkpasswd/; -our @EXPORT = qw(confirm_or_abort fix_username prompt_email prompt_password); +our @EXPORT = qw(confirm confirm_or_abort fix_username prompt_email prompt_password); our @ISA = qw(Exporter); +sub confirm { + my ($msg) = @_; + $msg //= "Is this OK? [no will abort] "; + return prompt $msg, -ynt; +} + sub confirm_or_abort { my ($msg) = @_; $msg //= "Is this OK? [no will abort] "; -- cgit v1.2.3