From 32b67e4bb1bedfacb2cf15001f2f0c3c35a1b58b Mon Sep 17 00:00:00 2001 From: rillig Date: Sat, 30 Jul 2022 17:30:47 +0000 Subject: [PATCH] lintpkgsrc: condense code for checking mandatory command line options --- pkgtools/lintpkgsrc/files/lintpkgsrc.pl | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl index bd48e76cf996..4a11d0ee23d3 100755 --- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl +++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl @@ -1,6 +1,6 @@ #!@PERL5@ -# $NetBSD: lintpkgsrc.pl,v 1.40 2022/07/30 17:06:29 rillig Exp $ +# $NetBSD: lintpkgsrc.pl,v 1.41 2022/07/30 17:30:47 rillig Exp $ # Written by David Brownlee . # @@ -1485,22 +1485,7 @@ () if ( !getopts('BDE:I:K:LM:OP:RSVdg:himopruyz', \%opt) || $opt{h} - || !(defined $opt{d} - || defined $opt{g} - || defined $opt{i} - || defined $opt{m} - || defined $opt{o} - || defined $opt{p} - || defined $opt{r} - || defined $opt{u} - || defined $opt{B} - || defined $opt{D} - || defined $opt{R} - || defined $opt{O} - || defined $opt{S} - || defined $opt{E} - || defined $opt{y} - || defined $opt{z})) { + || !grep(/[BDEORSdgimopruyz]/, keys %opt)) { usage_and_exit(); } $| = 1;