diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-01-10 21:28:00 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-01-10 21:28:00 +0000 |
commit | b039c5e2f74be6a127e392ec2effc1aebc324126 (patch) | |
tree | c8c8595f9db084f5c6f46a002b88bd6d76d17e53 /usr.sbin/pkg_add/OpenBSD | |
parent | 6da0bc7f38345d7dd3b9755ca396488764f8a274 (diff) |
unify options a bit: use -Dname=value for defines uniformously (e.g., deprecate
-F keyword heavily).
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/AddDelete.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm index 534ce67ac5d..98f8d916b7b 100644 --- a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm +++ b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: AddDelete.pm,v 1.16 2010/01/09 14:49:53 espie Exp $ +# $OpenBSD: AddDelete.pm,v 1.17 2010/01/10 21:27:59 espie Exp $ # # Copyright (c) 2007-2009 Marc Espie <espie@openbsd.org> # @@ -30,11 +30,19 @@ sub handle_options set_usage(@usage); $state = OpenBSD::State->new; $hash->{h} = sub { Usage(); }; - $hash->{f} = $hash->{F} = sub { + $hash->{F} = sub { for my $o (split /\,/o, shift) { $defines{$o} = 1; } }; + $hash->{D} = sub { + my $_ = shift; + if (m/^(.*?)=(.*)/) { + $defines{$1} = $2; + } else { + $defines{$_} = 1; + } + }; try { getopts('hciInqvsxB:f:F:L:'.$opt_string, $hash); } catchall { |