split-man

来自「ZD1211 source code, based on linux 2.44 」· 代码 · 共 34 行

TXT
34
字号
#!/usr/bin/perl##      split-man: create man pages from kernel-doc -man output## Author:	Tim Waugh <twaugh@redhat.com># Modified by:	Christoph Hellwig <hch@infradead.org>#use strict;die "$0: where do I put the results?\n" unless ($#ARGV >= 0);die "$0: can't create $ARGV[0]: $!\n" unless mkdir $ARGV[0], 0777;my $state = 0;while (<STDIN>) {	s/&amp;(\w+)/\\fB\1\\fP/g; # fix smgl uglinesses	if (/^\.TH \"[^\"]*\" 9 \"([^\"]*)\"/) {		close OUT unless ($state++ == 0);		my $fn = "$ARGV[0]/$1.9";		if (open OUT, ">$fn") {			print STDERR "creating $fn\n";		} else {			die "can't open $fn: $!\n";		}		print OUT $_;	} elsif ($state != 0) {		print OUT $_;	}}close OUT;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?