This should fix things.
Index: AddCreateDelete.pm =================================================================== RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/AddCreateDelete.pm,v retrieving revision 1.34 diff -u -p -r1.34 AddCreateDelete.pm --- AddCreateDelete.pm 6 Apr 2015 11:07:24 -0000 1.34 +++ AddCreateDelete.pm 6 Jun 2016 07:09:49 -0000 @@ -59,25 +59,11 @@ sub handle_options { my ($state, $opt_string, @usage) = @_; - my $i; - $state->{opt}{i} //= sub { - $i++; - }; - $state->SUPER::handle_options($opt_string.'IiL:mnx', @usage); + $state->SUPER::handle_options($opt_string.'L:mnx', @usage); $state->progress->setup($state->opt('x'), $state->opt('m'), $state); $state->{not} = $state->opt('n'); - if ($state->opt('I')) { - $i = 0; - } elsif (!defined $i) { - $i = -t STDIN; - } - if ($i) { - require OpenBSD::Interactive; - $state->{interactive} = OpenBSD::Interactive->new($state, $i); - } else { - $state->{interactive} = OpenBSD::InteractiveStub->new($state); - } + $state->{interactive} //= OpenBSD::InteractiveStub->new($state); } Index: AddDelete.pm =================================================================== RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/AddDelete.pm,v retrieving revision 1.72 diff -u -p -r1.72 AddDelete.pm --- AddDelete.pm 25 May 2015 07:20:31 -0000 1.72 +++ AddDelete.pm 6 Jun 2016 07:09:49 -0000 @@ -167,11 +167,24 @@ sub handle_options $state->{subst}->add($o, 1); } }; + my $i; + $state->{opt}{i} //= sub { + $i++; + }; $state->{no_exports} = 1; $state->SUPER::handle_options($opt_string.'aciInqsB:F:', @usage); if ($state->opt('s')) { $state->{not} = 1; + } + if ($state->opt('I')) { + $i = 0; + } elsif (!defined $i) { + $i = -t STDIN; + } + if ($i) { + require OpenBSD::Interactive; + $state->{interactive} = OpenBSD::Interactive->new($state, $i); } # XXX RequiredBy $main::not = $state->{not};