8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / troff / troff.d / troff.sh
blobed84069e08080f4e386a9f49d746cfa6f9cd4633
1 #!/sbin/sh
3 # CDDL HEADER START
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License, Version 1.0 only
7 # (the "License"). You may not use this file except in compliance
8 # with the License.
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 # or http://www.opensolaris.org/os/licensing.
12 # See the License for the specific language governing permissions
13 # and limitations under the License.
15 # When distributing Covered Code, include this CDDL HEADER in each
16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 # If applicable, add the following below this CDDL HEADER, with the
18 # fields enclosed by brackets "[]" replaced with your own identifying
19 # information: Portions Copyright [yyyy] [name of copyright owner]
21 # CDDL HEADER END
24 # Copyright 1989 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
27 # Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
28 # All Rights Reserved
30 # Portions of this source code were derived from Berkeley 4.3 BSD
31 # under license from the Regents of the University of California.
33 #ident "%Z%%M% %I% %E% SMI"
35 dev=aps
36 oflags= newargs=
38 for i
40 case $i in
41 -Tcat) dev=cat ;;
42 -Taps) dev=aps ;;
43 -T*) echo invalid option $i; exit 1 ;;
44 -c*) cm=`echo $i|sed -e s/c/m/`
45 newargs="$newargs $cm"
46 oflags=$oflags$i ;;
47 -b|-k*|-p*|-g|-w) oflags=$i$oflags ;;
48 *) newargs="$newargs $i" ;;
49 esac
50 done
52 case $dev in
54 cat)
55 exec otroff $*
58 aps)
59 if [ "-b" = "$oflags" ]
60 then
61 echo '-b no longer supported'
62 exit 1
64 if [ -n "$oflags" ]
65 then
66 echo "options -c, -k, -b, -w, -g and -p are no longer supported"
68 exec troff $newargs
71 esac