xref: /original-bsd/share/man/makewhatis.sed (revision 7e5c8007)
1#!/usr/bin/sed -nf
2#
3# Copyright (c) 1988, 1993, 1994
4#	The Regents of the University of California.  All rights reserved.
5#
6# %sccs.include.redist.sh%
7#
8#	@(#)makewhatis.sed	8.4 (Berkeley) 04/03/94
9#
10
11/^[a-zA-Z][a-zA-Z0-9\._+\-]*(\([a-zA-Z0-9\._+\-]*\).*/ {
12	s;^[a-zA-Z0-9\._+\-]*(\([a-zA-Z0-9\._+\-]*\).*;\1;
13	h
14	d
15}
16
17/^NNAAMMEE/!d
18
19:name
20	s;.*;;
21	N
22	s;\n;;
23	# some twits underline the command name
24	s;_;;g
25	/^[^	 ]/b print
26	H
27	b name
28
29:print
30	x
31	s;\n;;g
32	/-/!d
33	s;.;;g
34	s;\([a-z][A-z]\)-[	 ][	 ]*;\1;
35	s;\([a-zA-Z0-9,\._+\-]\)[	 ][	 ]*;\1 ;g
36	s;[^a-zA-Z0-9\._+\-]*\([a-zA-Z0-9\._+\-]*\)[^a-zA-Z0-9\._+\-]*\(.*\) - \(.*\);\2 (\1) - \3;
37	p
38	q
39