summaryrefslogtreecommitdiff
path: root/lib/RHRD/utils.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/RHRD/utils.pm')
-rwxr-xr-xlib/RHRD/utils.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/RHRD/utils.pm b/lib/RHRD/utils.pm
index 756707b..ad8e7b8 100755
--- a/lib/RHRD/utils.pm
+++ b/lib/RHRD/utils.pm
@@ -213,6 +213,20 @@ sub cmdline_dow
return (undef, 'invalid day-of-week', CMDLINE_DOW_HINT);
}
+sub cmdline_ask_yn
+{
+ my ($question) = @_;
+
+ print "$question (y/N)? ";
+ my $answer = <STDIN>;
+ chomp($answer) if(defined $answer);
+ unless(defined $answer && lc($answer) eq 'y') {
+ print "aborting.\n";
+ return 0;
+ }
+ return 1;
+}
+
sub fetch_parse_json
{
my ($url, $ua_str, $headers, $queries) = @_;