summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-04-11 22:26:16 -0400
committerJune McEnroe <june@causal.agency>2021-04-11 22:55:03 -0400
commita8dcf1e99a0811e90db8ba88fbf18f2a79e43069 (patch)
tree097efa0b579397a20050c34d3d0fe1f1514a6ffd /doc
parentAdd The Relentless Moon (diff)
downloadsrc-a8dcf1e99a0811e90db8ba88fbf18f2a79e43069.tar.gz
src-a8dcf1e99a0811e90db8ba88fbf18f2a79e43069.zip
Simplify rfctags
I wasn't thinking perl enough.
Diffstat (limited to '')
-rw-r--r--doc/rfc/rfctags.pl30
1 files changed, 13 insertions, 17 deletions
diff --git a/doc/rfc/rfctags.pl b/doc/rfc/rfctags.pl
index 45e74f9a..05173d00 100644
--- a/doc/rfc/rfctags.pl
+++ b/doc/rfc/rfctags.pl
@@ -4,22 +4,18 @@ use warnings;
 use open ':encoding(ISO-8859-1)';
 
 ($,, $\) = ("\t", "\n");
-for my $rfc (@ARGV) {
-	open my $handle, '<', $rfc or die "${rfc}: $!";
-	while (<$handle>) {
-		chomp;
-		# Section headings
-		if (/^([\d.]+|[A-Z][.])\s+([^\t]+)?/) {
-			print $1, $rfc, $.;
-			print $2, $rfc, $. if $2;
-			print $1, $rfc, $. if $1 =~ /^([\d.]+)[.]$/;
-		}
-		# References
-		if (/^\s*(\[[\w-]+\])\s{2,}/) {
-			print $1, $rfc, $.;
-			print "\\$1", $rfc, $.; # vim ^] prepends \ to [
-		}
+while (<>) {
+	chomp;
+	# Section headings
+	if (/^([\d.]+|[A-Z][.])\s+([^\t]+)?/) {
+		print $1, $ARGV, $.;
+		print $2, $ARGV, $. if $2;
+		print $1, $ARGV, $. if $1 =~ /^([\d.]+)[.]$/;
 	}
-	die "${rfc}: $!" if $!;
-	close $handle;
+	# References
+	if (/^\s*(\[[\w-]+\])\s{2,}/) {
+		print $1, $ARGV, $.;
+		print "\\$1", $ARGV, $.; # vim ^] prepends \ to [
+	}
+	close ARGV if eof;
 }