diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2016-06-06 15:19:46 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2016-06-06 15:19:46 +0000 |
commit | df80dd65dec8e8c53afc19ed596de99483f1532b (patch) | |
tree | 868d059a28ea36716c27366c10f51d595e628a6b /usr.sbin | |
parent | c555904b1b2d56eb98c24029443fe7bf2fc79e43 (diff) |
band-aid for pkg_check, some options need to be mixin.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/AddCreateDelete.pm | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PkgCheck.pm | 17 |
2 files changed, 17 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/AddCreateDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddCreateDelete.pm index da57d411e42..e380c26c1eb 100644 --- a/usr.sbin/pkg_add/OpenBSD/AddCreateDelete.pm +++ b/usr.sbin/pkg_add/OpenBSD/AddCreateDelete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: AddCreateDelete.pm,v 1.35 2016/06/06 13:58:55 espie Exp $ +# $OpenBSD: AddCreateDelete.pm,v 1.36 2016/06/06 15:19:45 espie Exp $ # # Copyright (c) 2007-2014 Marc Espie <espie@openbsd.org> # @@ -63,7 +63,7 @@ sub handle_options $state->progress->setup($state->opt('x'), $state->opt('m'), $state); $state->{not} = $state->opt('n'); - $state->{interactive} //= OpenBSD::InteractiveStub->new($state); + $state->{interactive} = OpenBSD::InteractiveStub->new($state); } diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm index 8e858b79eb5..ae26853c0f4 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgCheck.pm,v 1.57 2015/10/21 10:11:13 espie Exp $ +# $OpenBSD: PkgCheck.pm,v 1.58 2016/06/06 15:19:45 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org> # @@ -306,10 +306,23 @@ sub safe sub handle_options { my $self = shift; + my $i; + $self->{opt}{i} //= sub { + $i++; + }; $self->{no_exports} = 1; - $self->SUPER::handle_options('fB:q', + $self->SUPER::handle_options('iIfB:q', '[-fIimnqvx] [-B pkg-destdir] [-D value]'); + if ($self->opt('I')) { + $i = 0; + } elsif (!defined $i) { + $i = -t STDIN; + } + if ($i) { + require OpenBSD::Interactive; + $self->{interactive} = OpenBSD::Interactive->new($self, $i); + } $self->{force} = $self->opt('f'); $self->{quick} = $self->opt('q'); if (defined $self->opt('B')) { |