From 88401ec558c64e0110c0de9d0f039573017c80a1 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 28 Oct 2020 11:35:43 +0300 Subject: [PATCH] Configurable file extensions --- bin/bin/docstringer.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/bin/docstringer.pl b/bin/bin/docstringer.pl index 95def27..2de9a0e 100755 --- a/bin/bin/docstringer.pl +++ b/bin/bin/docstringer.pl @@ -27,6 +27,7 @@ if ($ARGV[0] eq "-v") { my @srcDirs = split / /, $ARGV[0]; my $docDir = $ARGV[1]; my $docBuildDir = $ARGV[2]; +my @exts = split / /, defined $ENV{EXTS} ? $ENV{EXTS} : "c h h.in"; my %docstrings; @@ -34,7 +35,7 @@ foreach my $srcDir (@srcDirs) { print "src: $srcDir\n" if $verbose; opendir(my $dir, $srcDir) or die "can not open $srcDir"; foreach my $fn (readdir $dir) { - next unless $fn =~ /\.[ch]$/; + next unless grep { $fn =~ /\.$_$/ } @exts; open(my $src, "<:encoding(UTF-8)", "$srcDir/$fn") or die "can not open $srcDir/$fn"; my $curEntry; -- 2.44.0