2 #@ Emulate nroff with @L_ROFF@.
4 # Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
6 # Copyright (C) 1992 - 1994, 1999 - 2005, 2007
7 # Free Software Foundation, Inc.
9 # Written by James Clark, maintained by Werner Lemberg.
11 # `groff' is free software; you can redistribute it and/or modify it
12 # under the terms of the GNU General Public License (GPL) as published
13 # by the Free Software Foundation; either version 2, or (at your
14 # option) any later version.
16 # `groff' is distributed in the hope that it will be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 # General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with `groff'; see the files COPYING and LICENSE in the top
23 # directory of the `groff' source. If not, write to the Free Software
24 # Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
30 # Check the @U_ROFF@_TYPESETTER environment variable.
31 Tenv
="${@U_ROFF@_TYPESETTER}"
33 # Try the `locale charmap' command first because it is most reliable.
34 # On systems where it doesn't exist, look at the environment variables.
35 case "`exec 2>/dev/null ; locale charmap`" in
38 ISO-8859-1 | ISO-8859-15
)
43 case "${LC_ALL-${LC_CTYPE-${LANG}}}" in
46 iso_8859_1 |
*.ISO-8859-1 |
*.ISO8859-1 | \
47 iso_8859_15 |
*.ISO-8859-15 |
*.ISO8859-15
)
52 case "$LESSCHARSET" in
65 # `for i; do' doesn't work with some versions of sh
77 # ignore these options
80 echo "$prog: option $1 requires an argument" >&2
82 -[iptSUC
] |
-[dMmrnowW
]*)
87 # Solaris 2.2 through at least Solaris 9 `man' invokes
88 # `nroff -u0 ... | col -x'. Ignore the -u0,
89 # since `less' and `more' can use the emboldening info.
90 # However, disable SGR, since Solaris `col' mishandles it.
93 echo "@L_NROFF@ (@T_ROFF@) v@VERSION@"
96 echo "Synopsis: @L_NROFF@ [-CchipStUv] [-dCS] [-MDIR] [-mNAME] [-nNUM]"
97 echo " [-oLIST] [-rCN] [-Tname] [-WNAME] [-wNAME] [FILE...]"
105 echo "$prog: invalid option $1" >&2
113 if test "x$Topt" != x
; then
116 if test "x$Tenv" != x
; then
122 -Tascii |
-Tlatin1 |
-Tutf8 |
-Tcp1047)
125 # ignore other devices and use locale fallback
129 # Set up the `@U_ROFF@_BIN_PATH' variable
130 # to be exported in the current `@U_ROFF@_RUNTIME' environment.
131 @U_ROFF_BIN_PATH_SETUP@
132 export @U_ROFF@_BIN_PATH
134 # Load nroff-style character definitions too.
136 PATH
="${@U_ROFF@_RUNTIME}${PATH}" @L_ROFF@ -mtty-char ${T} $opts ${1+"${@}"}