summaryrefslogtreecommitdiffstats
path: root/contrib/groff/src/roff/nroff/nroff.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/groff/src/roff/nroff/nroff.sh')
-rwxr-xr-xcontrib/groff/src/roff/nroff/nroff.sh24
1 files changed, 15 insertions, 9 deletions
diff --git a/contrib/groff/src/roff/nroff/nroff.sh b/contrib/groff/src/roff/nroff/nroff.sh
index 5144ba4..e8feb04 100755
--- a/contrib/groff/src/roff/nroff/nroff.sh
+++ b/contrib/groff/src/roff/nroff/nroff.sh
@@ -1,31 +1,38 @@
#!/bin/sh
# Emulate nroff with groff.
+# $FreeBSD$
prog="$0"
# Default device.
# First try the "locale charmap" command, because it's most reliable.
# On systems where it doesn't exist, look at the environment variables.
case "`locale charmap 2>/dev/null`" in
+ ISO*8859-1 | ISO*8859-15)
+ T=-Tlatin1 ;;
+ KOI8-R)
+ T=-Tkoi8-r ;;
UTF-8)
T=-Tutf8 ;;
- ISO-8859-1)
- T=-Tlatin1 ;;
IBM-1047)
T=-Tcp1047 ;;
*)
case "${LC_ALL-${LC_CTYPE-${LANG}}}" in
+ iso_8859_1 | *.ISO*8859-1 | *.ISO*8859-15)
+ T=-Tlatin1 ;;
+ *.KOI8-R)
+ T=-Tkoi8-r ;;
*.UTF-8)
T=-Tutf8 ;;
- iso_8859_1 | *.ISO-8859-1)
- T=-Tlatin1 ;;
*.IBM-1047)
T=-Tcp1047 ;;
*)
case "$LESSCHARSET" in
- utf-8)
- T=-Tutf8 ;;
latin1)
T=-Tlatin1 ;;
+ koi8-r)
+ T=-Tkoi8-r ;;
+ utf-8)
+ T=-Tutf8 ;;
cp1047)
T=-Tcp1047 ;;
*)
@@ -52,7 +59,7 @@ for i
exit 1 ;;
-[iptSUC] | -[dmrno]*)
opts="$opts $1" ;;
- -Tascii | -Tlatin1 | -Tutf8 | -Tcp1047)
+ -Tascii | -Tlatin1 | -Tkoi8-r | -Tutf8 | -Tcp1047)
T=$1 ;;
-T*)
# ignore other devices
@@ -65,8 +72,7 @@ for i
echo "GNU nroff (groff) version @VERSION@"
exit 0 ;;
--help)
- echo "usage: nroff [-CchipStUv] [-dCS] [-mNAME] [-nNUM] [-oLIST] [-rCN]"
- echo " [-Tname] [FILE...]"
+ echo "usage: nroff [-CchipStUv] [-dCS] [-mNAME] [-nNUM] [-oLIST] [-rCN] [-Tname] [FILE...]"
exit 0 ;;
--)
shift
OpenPOWER on IntegriCloud