aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Fripost
diff options
context:
space:
mode:
authorStefan Kangas <skangas@skangas.se>2011-11-18 19:30:54 +0100
committerStefan Kangas <skangas@skangas.se>2011-11-18 19:30:54 +0100
commit6c2cd2ab4ffb47f3dec5c08279a0afe83601b57c (patch)
tree491a7f7c23e64cb87da6e16d38162ac55f4d33dd /lib/Fripost
parent1b0a0969361eb294bd98c5cdfabb9e667077fbf4 (diff)
Add new function to just prompt for confirmation
Diffstat (limited to 'lib/Fripost')
-rwxr-xr-xlib/Fripost/Prompt.pm8
1 files changed, 7 insertions, 1 deletions
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] ";