summaryrefslogtreecommitdiff
path: root/web/noweb/contrib/rsc/rc/notangle.nw
blob: 476534ca27009be9c19a92c70c709508171b34c4 (plain)
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
<<notangle>>=
#!/bin/rc
# Copyright 1991 by Norman Ramsey.  All rights reserved.
# See file /sys/src/cmd/noweb/COPYRIGHT for more information.
#
# Translated from sh to rc by Russ Cox
# bugs -> rsc@plan9.bell-labs.com
#

rfork en
bind -b /sys/lib/texmf/bin/$objtype /bin
bind -b /sys/lib/texmf/bin/rc /bin

LIB=/sys/lib/texmf/noweb
markup=markup
opt=()
arg=()
markopt=()
filters=()

while(! ~ $#* 0) {
	switch($1) {
	case -m -m3 -awk -icn -icon -pascal -c -c++ -f77 -f90 -tex -w[0-9][0-9]

		;
	case -t
		;
	case -t*
		markopt=($markopt -t)
		opt=($opt $1)
	case -filter
		filters=($filters $2)
		shift
	case -markup
		markup=$2
		shift
	case -
		arg=($arg $1)
	case -L*
		opt=($opt -t $1)
		markopt=($markopt -t)
	case -*
		opt=($opt $1)
	case *
		arg=($arg $1)
	}
	shift
}

$markup $markopt $arg | $filters nt $opt
exit $status