aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas <skangas@skangas.se>2011-03-14 15:17:13 +0100
committerStefan Kangas <skangas@skangas.se>2011-03-14 15:17:13 +0100
commit5d3d384a5bf1e08951ed37ec5111314c1cce82dc (patch)
tree0251e71e31a25eff66431c81c84dc6127558d04d
parent6238a0b2d98b59a99c5eab89b15d5686ba6858f3 (diff)
Better name: confirm_or_abort
-rwxr-xr-xfripost-adduser4
-rwxr-xr-xfripost-newalias2
-rwxr-xr-xlib/Fripost/Prompt.pm2
3 files changed, 4 insertions, 4 deletions
diff --git a/fripost-adduser b/fripost-adduser
index 5153a18..c8bfc84 100755
--- a/fripost-adduser
+++ b/fripost-adduser
@@ -59,7 +59,7 @@ my $user;
say "Name: $user->{name}";
say "Password: (hidden)";
- ask_if_ok_or_abort();
+ confirm_or_abort();
}
die "User already exists"
@@ -93,7 +93,7 @@ say "Sent welcome message: ";
say $msg->as_string;
#say decode_qp($msg->as_string);
-ask_if_ok_or_abort("Send email with login information? ");
+confirm_or_abort("Send email with login information? ");
prompt_email("Where should the email be sent? ");
diff --git a/fripost-newalias b/fripost-newalias
index 162f787..cf7f563 100755
--- a/fripost-newalias
+++ b/fripost-newalias
@@ -71,7 +71,7 @@ if (@addr == 0) {
exit 1;
}
say "dest adress: " . (join " ", @addr);
-ask_if_ok_or_abort();
+confirm_or_abort();
## Insert alias into database
for my $addr (@addr) {
diff --git a/lib/Fripost/Prompt.pm b/lib/Fripost/Prompt.pm
index 4b11a19..ac40411 100755
--- a/lib/Fripost/Prompt.pm
+++ b/lib/Fripost/Prompt.pm
@@ -20,7 +20,7 @@ use String::MkPasswd qw/mkpasswd/;
our @EXPORT = qw(prompt_password prompt_username);
-sub ask_if_ok_or_abort {
+sub confirm_or_abort {
my ($msg) = @_;
$msg //= "Is this OK? [no will abort] ";
my $confirmed = prompt $msg, -ynt;