summary refs log tree commit diff
path: root/doc/rfc/rfctags.pl
blob: 45e74f9a88e2b73e537c8fe8378700f4bea134f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env perl
use strict;
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 [
		}
	}
	die "${rfc}: $!" if $!;
	close $handle;
}
9b22c936b&follow=1'>Use PascalCase for constantsJune McEnroe 2018-09-02Remove colorcolumn at 100June McEnroe 2018-09-02Install bc(1) on ArchJune McEnroe 2018-09-02SendEnv LANGJune McEnroe 2018-08-27Add New Order — TemptationJune McEnroe 2018-08-26Add NetBSD to install.shJune McEnroe 2018-08-24Show hostname in title over SSHJune McEnroe 2018-08-23Alias bc='bc -l'June McEnroe 2018-08-20Update usage of scheme in READMEJune McEnroe 2018-08-20Use scheme.h in fbatt and fbclockJune McEnroe 2018-08-20Generate scheme.hJune McEnroe 2018-08-20Add dependencies on gfx.hJune McEnroe 2018-08-18Add Blondie — Heart of GlassJune McEnroe 2018-08-18Set FCEDIT=$EDITORJune McEnroe 2018-08-18Only post commits with bodies to MastodonJune McEnroe 2018-08-18Run tf/cfg link script with /bin/shJune McEnroe 2018-08-18Run {,s,t}up with /bin/shJune McEnroe 2018-08-18Use whence instead of typeJune McEnroe 2018-08-18Cut off path components until right prompt fitsJune McEnroe 2018-08-17Add "private" alias to source encrypted fileJune McEnroe 2018-08-17Add vim mapping to add a #includeJune McEnroe