Permalink
Browse files

menupick no longer prompts user to select from empty menu

  • Loading branch information...
Mark Dominus
Mark Dominus committed Oct 30, 2012
1 parent 0539156 commit d04587559ce9a506b2a741f04548485e2d194eba
Showing with 6 additions and 0 deletions.
  1. +6 −0 menupick
View
@@ -5,6 +5,12 @@ my $opt = { 1 => 0, n => 30 };
getopts('1n:', $opt) or usage();
chomp(my @item = <>);
+
+unless (@item) {
+ warn "No items supplied to menupick\n";
+ exit;
+}
+
open my($ttyin), "<", "/dev/tty"
or do { warn "No tty: $!\n"; exit 1 };
open my($ttyout), ">", "/dev/tty"

0 comments on commit d045875

Please sign in to comment.