Do not accept any other characters than n/y
Change-Id: Iff342d57a40c3171a89a44c0a0060e128de3684b
diff --git a/bin/git_gerrit_pull b/bin/git_gerrit_pull
index 95a2073..1ed6990 100755
--- a/bin/git_gerrit_pull
+++ b/bin/git_gerrit_pull
@@ -10,14 +10,18 @@
sub _check {
my $cmd = shift;
+ CHECK:
print "\n\n" . 'Do "' . $cmd . '"? (y/n)', "\n";
my $x = <STDIN>;
chomp($x);
if ($x eq 'y' || $x eq 'Y') {
system $cmd;
- } else {
+ } elsif ($x eq 'n' || $x eq 'N') {
exit;
+ } else {
+ print "Please answer with 'y' or 'n'.\n";
+ goto CHECK;
};
};