summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/pkg_delete
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-05-20 14:21:34 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-05-20 14:21:34 +0000
commit66a96b1ab6714a16fa79601924d43bc7eccf620f (patch)
tree1d1ed444d66d02fd455fa413220a1f2b5ecfb3f1 /usr.sbin/pkg_add/pkg_delete
parentf6a0eb61b4b720f21c8815f57ed6b03cb03f6238 (diff)
create specific `state' objects for pkg_add and pkg_delete, so that I can
write shortcuts for common behavior, and start hiding some details.
Diffstat (limited to 'usr.sbin/pkg_add/pkg_delete')
-rw-r--r--usr.sbin/pkg_add/pkg_delete9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/pkg_delete b/usr.sbin/pkg_add/pkg_delete
index 61fad83095d..5a6707a22f7 100644
--- a/usr.sbin/pkg_add/pkg_delete
+++ b/usr.sbin/pkg_add/pkg_delete
@@ -1,6 +1,6 @@
#!/usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_delete,v 1.100 2007/05/20 14:04:39 espie Exp $
+# $OpenBSD: pkg_delete,v 1.101 2007/05/20 14:21:33 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -32,6 +32,11 @@ use OpenBSD::Vstat;
our %forced = ();
our $not;
+package OpenBSD::pkg_delete::State;
+our @ISA=(qw(OpenBSD::Error));
+
+package main;
+
set_usage('pkg_delete [-cIinqvx] [-B pkg-destdir] [-F keywords] pkg-name [...]');
our ($opt_v, $opt_D, $opt_d, $opt_n, $opt_q, $opt_p, $opt_c, $opt_L, $opt_B, $opt_I, $opt_i, $opt_x);
@@ -78,7 +83,7 @@ my %done;
my $removed;
try {
-my $state = new OpenBSD::Error;
+my $state = OpenBSD::pkg_delete::State->new;
$state->{not} = $opt_n;
# XXX RequiredBy
$not = $opt_n;