File: mkmanpages

package info (click to toggle)
fdutils 5.6-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,540 kB
  • sloc: ansic: 6,334; sh: 3,570; makefile: 262; sed: 4
file content (53 lines) | stat: -rwxr-xr-x 1,168 bytes parent folder | download | duplicates (3)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash

# extracts the manpage for a given command out of a texinfo doc

date=`date +%d%b%y`
package="fdutils-5.6"

infile=/tmp/infile.$$

extract()
{
command=$1
outfile=`echo $command | tr '[A-Z]' '[a-z]'`.1
texifile=`echo $command | tr '[A-Z]' '[a-z]'`.texi

echo \'\\\" t >>$outfile
echo .TH\ $command\ 1\ \"$date\" $package >$outfile
echo .SH Name >>$outfile
grep -i $command cmdname >>$outfile
#echo ".SH Description" >>$outfile


#	-e "1,/^@node $command/d" \
#	-e "/^@node [^,]*, [^,]*, $command, Commands$/,/^@bye/d" \
#	-e "/^@node [^,]*, [^,]*, Commands/,/^@bye/d" \

cat man-warning.texi $texifile |
	sed \
		-e 's/^@section/@chapter/' \
		-e 's/^@subs/@s/' \
		-e 's/^@chapter.*$/@chapter Description/' \
		-e 's/^@section/@chapter/' \
		-e 's/^@subs/@s/' \
		-e 's/^@c xMANoptions/@chapter Options/' \
		-e "s/^@c MAN/@MAN/"  |
	texi2roff -ma  |
	sed -f strip-pp.sed >>$outfile
echo ".SH See Also" >>$outfile
echo "Fdutils' texinfo doc" >>$outfile
}


extract diskd
extract diskseekd
extract fdmount
extract fdrawcmd
extract floppycontrol
extract floppymeter
extract getfdprm
extract makefloppies
extract setfdprm
extract superformat
extract xdfcopy