]> Sergey Matveev's repositories - dotfiles.git/blobdiff - bin/bin/docstringer.pl
Raise copyright years
[dotfiles.git] / bin / bin / docstringer.pl
index 95def27cae3354487d1cb366d393347306658d4c..8a8db495306a79dc7c09f7a839c7b32de01cfdb2 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 # Simple script for substitute placeholders in Texinfo files with
 # docstring values found in source code.
-# Copyright (C) 2020 Sergey Matveev (stargrave@stargrave.org)
+# Copyright (C) 2020-2022 Sergey Matveev (stargrave@stargrave.org)
 #
 # If you C source code contains:
 #
@@ -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;