From 99ffe138ccd280105fb03438236529d1295384fd Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 21 Oct 2020 14:17:38 -0400 Subject: [PATCH] Drop the "-s" option. With all due respect to the original authors, the behavior of the "-s" flag is trivial to implement with the POSIX "find" command. The benefit of having it reimplemented in valtz itself is small. --- valtz | 21 +++------------------ valtz.1 | 6 ++---- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/valtz b/valtz index 12d22c9..b9c6171 100755 --- a/valtz +++ b/valtz @@ -48,13 +48,9 @@ my $VERSION = '0.8'; $| = 1; my %opt; -getopts('?fFhHiIqrRstT:', \%opt); +getopts('?fFhHiIqrRtT:', \%opt); -my $FILESUFFIXREGEXP = '('.join('|', qw/ - ,v ~ .bak .log .old .swp .tmp - /).')$'; - # Validation errors my $verrs_total = 0; @@ -729,11 +725,6 @@ sub do_filterfile ($$) } for my $zonefile (@zonefiles) { - unless ($opt{s}) - { - next if $zonefile =~ /$FILESUFFIXREGEXP/i; - } - my $info = 0; my $filehandle = \*STDIN; my $fopen = 1; @@ -902,9 +893,9 @@ valtz $VERSION - validate tinydns-data files Usage: $0 [-r] [-R] [-i] tinydns-file1 [tinydns-file2...] - $0 [-HiIqrRst] [-T types] -f tinydns-file1 [tinydns-file2 ...] + $0 [-HiIqrRt] [-T types] -f tinydns-file1 [tinydns-file2 ...] - $0 valtz [-fHiIqrRst] [-T types] -F filter-file1 [filter-file2 ...] + $0 valtz [-fHiIqrRt] [-T types] -F filter-file1 [filter-file2 ...] Flags: -h print usage information @@ -915,7 +906,6 @@ Flags: -i allow "ip" fields to be empty -I include rejected lines as comments (filtering only) -q don't print valid lines to standard out (filtering only) - -s don't skip temporary and backup files -t don't ignore comment lines (filtering only) -T allow additional record types (advanced filtering only) @@ -956,11 +946,6 @@ else for my $zonefile (sort @{$files}) { - unless ($opt{s}) - { - next if $zonefile =~ /$FILESUFFIXREGEXP/i; - } - my $filehandle = \*STDIN; my $fopen = 1; if ($zonefile ne '-') diff --git a/valtz.1 b/valtz.1 index 8eade8f..7cbb23d 100644 --- a/valtz.1 +++ b/valtz.1 @@ -11,11 +11,11 @@ Validate one or more tinydns-data files: Filter bad lines out of one or more tinydns-data files: - \fBvaltz\fR [\fB-HiIqrRst\fR] [\fB-T \fItypes\fR\fR] -f \fItinydns-file1\fR [\fItinydns-file2 ...\fR] + \fBvaltz\fR [\fB-HiIqrRt\fR] [\fB-T \fItypes\fR\fR] -f \fItinydns-file1\fR [\fItinydns-file2 ...\fR] Filter bad lines using filter configuration files: - \fBvaltz\fR [\fB-fHiIqrRst\fR] [\fB-T \fItypes\fR\fR] -F \fIfilter-file1\fR [\fIfilter-file2 ...\fR] + \fBvaltz\fR [\fB-fHiIqrRt\fR] [\fB-T \fItypes\fR\fR] -F \fIfilter-file1\fR [\fIfilter-file2 ...\fR] Show the built-in help: @@ -44,8 +44,6 @@ Allow "ip" fields to be empty. These lines do not generate any records. Include rejected lines as comments in output. .IP \fB-q\fR (filtering only) Do not print valid lines to standard out. -.IP \fB-s\fR --s Don't skip files ending with ",v", "~", ".bak", ".log", ".old", ".swp", and ".tmp". .IP \fB-t\fR (filtering only) Don't ignore comment lines (beginning with a "#" character). .IP \fB-T \fItypes\fR\fR (advanced filtering only) -- 2.43.2