pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/lintpkgsrc/files lintpkgsrc: condense code fo...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bf31dac7ef00
branches:  trunk
changeset: 382538:bf31dac7ef00
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Jul 30 17:30:47 2022 +0000

description:
lintpkgsrc: condense code for checking mandatory command line options

diffstat:

 pkgtools/lintpkgsrc/files/lintpkgsrc.pl |  19 ++-----------------
 1 files changed, 2 insertions(+), 17 deletions(-)

diffs (35 lines):

diff -r d5f1f9d39d0f -r bf31dac7ef00 pkgtools/lintpkgsrc/files/lintpkgsrc.pl
--- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sat Jul 30 17:06:29 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sat Jul 30 17:30:47 2022 +0000
@@ -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 <abs%netbsd.org@localhost>.
 #
@@ -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;



Home | Main Index | Thread Index | Old Index