отображать файлы groff и справочные страницы на X и tty (display groff files and man pages on X and tty)
Option Details
The groffer
program can usually be run with very few options.
But for special purposes, it supports many options. These can be
classified in 5 option classes.
All short options of groffer
are compatible with the short
options of groff(1). All long options of groffer
are compatible
with the long options of man(1).
Arguments for long option names can be abbreviated in several
ways. First, the argument is checked whether it can be prolonged
as is. Furthermore, each minus sign -
is considered as a
starting point for a new abbreviation. This leads to a set of
multiple abbreviations for a single argument. For example,
--de-n-f
can be used as an abbreviation for --debug-not-func
, but
--de-n
works as well. If the abbreviation of the argument leads
to several resulting options an error is raised.
These abbreviations are only allowed in the environment variable
GROFFER_OPT, but not in the configuration files. In
configuration, all long options must be exact.
groffer breaking options
As soon as one of these options is found on the command line it
is executed, printed to standard output, and the running groffer
is terminated thereafter. All other arguments are ignored.
-h
| --help
Print help information with a short explanation of options
to standard output.
-v
| --version
Print version information to standard output.
groffer mode options
The display mode and the viewer programs are determined by these
options. If none of these mode and viewer options is specified
groffer
tries to find a suitable display mode automatically. The
default modes are mode pdf, mode ps, mode html, mode xhtml, mode
x, and mode dvi in the X Window System with different viewers and
mode tty with device utf8 under less
on a terminal; other modes
are tested if the programs for the main default mode do not
exist.
In the X Window System, many programs create their own window
when called. groffer
can run these viewers as an independent
program in the background. As this does not work in text mode on
a terminal (tty) there must be a way to know which viewers are X
Window System-based graphical programs. The groffer
script has a
small amount of information on some viewer names. If a viewer
argument of the command-line chooses an element that is
recognized as an X Window System-based program in this list, it
is treated as a viewer that can run in the background.
Unrecognized viewers are not run in the background.
For each mode, you are free to choose whatever viewer you want.
That need not be some graphical viewer suitable for this mode.
There is a chance to view the output source; for example, the
combination of the options --mode=ps
and --viewer=less
shows the
content of the PostScript output, the source code, with the pager
less
.
--auto
Equivalent to --mode=auto
.
--default
Reset all configuration from previously processed command-
line options to the default values. This is useful to
wipe out all former options of the configuration, in
GROFFER_OPT, and restart option processing using only the
rest of the command line.
--default-modes
mode1,mode2,...
Set the sequence of modes for auto mode to the comma
separated list given in the argument. See --mode
for
details on modes. Display in the default manner;
actually, this means to try the modes x, ps, and tty in
this sequence.
--dvi
Equivalent to --mode=dvi
. Known DVI viewers for the X
Window System include xdvi
(1) and dvilx
(1).
--groff
Equivalent to --mode=groff
.
--html
Equivalent to --mode=html
.
--mode
value
Set the display mode. The following mode values are
recognized:
auto
Select the automatic determination of the display
mode. The sequence of modes that are tried can be
set with the --default-modes
option. Useful for
restoring the default mode when a different mode
was specified before.
dvi
Display formatted input in a DVI viewer program.
By default, the formatted input is displayed with
the xdvi
(1) program.
groff
After the file determination, switch groffer
to
process the input like groff(1) would do. This
disables the groffer viewing features.
html
Translate the input into HTML format and display
the result in a web browser program. By default,
the existence of a sequence of standard web
browsers is tested, starting with konqueror
(1) and
mozilla
(1). The text HTML viewer is lynx
(1). By
default, the existence of a sequence of standard
web browsers is tested, starting with konqueror
(1)
and mozilla
(1). The text HTML viewer is lynx
(1).
pdf
Transform roff input files into a PDF file by using
the groff(1) device -Tpdf
. This is the default PDF
generator. The generated PDF file is displayed
with suitable viewer programs, such as okular
(1).
pdf2
This is the traditional pdf mode. Sometimes this
mode produces more correct output than the default
PDF mode
. By default, the input is formatted by
groff
using the PostScript device, then it is
transformed into the PDF file format using gs
(1),
or ps2pdf
(1). If that's not possible, the
PostScript mode (ps) is used instead. Finally it
is displayed using different viewer programs.
ps
Display formatted input in a PostScript viewer
program. By default, the formatted input is
displayed in one of many viewer programs.
text
Format in a groff text mode and write the result to
standard output without a pager or viewer program.
The text device, latin1 by default, can be chosen
with option -T
.
tty
Format in a groff text mode and write the result to
standard output using a text pager program, even
when in the X Window System.
www
Equivalent to --mode=html
.
x
Display the formatted input in a native roff
viewer. By default, the formatted input is
displayed with the gxditview
(1) program being
distributed together with groff
. But the legacy X
Window System application xditview
(1) can also be
chosen with the option --viewer
. The default
resolution is 75dpi
, but 100dpi
are also possible.
The default groff device for the resolution of
75dpi
is X75-12
, for 100dpi
it is X100
. The
corresponding groff intermediate output for the
actual device is generated and the result is
displayed. For a resolution of 100dpi
, the default
width of the geometry of the display program is
chosen to 850dpi
.
X
Equivalent to --mode=x
.
xhtml
Translate the input into XHTML format, which is an
XML version of HTML. Then display the result in a
web browser program, mostly the known HTML viewers.
The following modes do not use the groffer viewing
features. They are only interesting for advanced
applications.
groff
Generate device output with plain groff without
using the special viewing features of groffer. If
no device was specified by option -T
the groff
default ps
is assumed.
source
Output the roff source code of the input files
without further processing.
--pdf
Equivalent to --mode=pdf
.
--pdf2
Equivalent to --mode=pdf2
.
--ps
Equivalent to --mode=ps
. Common PostScript viewers
include okular
(1), evince
(1), gv
(1), ghostview
(1), and
gs
(1), In each case, arguments can be provided
additionally.
--source
Equivalent to --mode=source
.
--text
Equivalent to --mode=text
.
--to-stdout
The file for the chosen mode is generated and its content
is printed to standard output. It will not be displayed
in graphical mode.
--tty
Equivalent to --mode=tty
. The standard pager is less(1).
This option is equivalent to man option --pager=
prog. The
option argument can be a file name or a program to be
searched in $PATH; arguments can be provided additionally.
--viewer
prog
Choose a viewer program for actual device or mode. This
can be a file name or a program to be searched in $PATH;
arguments can be provided additionally.
--www
Equivalent to --mode=html
.
--X
| --x
Equivalent to --mode=x
. Suitable viewer programs are
gxditview
(1) which is the default and xditview
(1).
--
Signals the end of option processing; all remaining
arguments are interpreted as filespec parameters.
Besides these, groffer
accepts all short options that are valid
for the groff(1) program. All non-groffer
options are sent
unmodified via grog
to groff
. So postprocessors, macro packages,
compatibility with classical troff, and much more can be manually
specified.
Options related to groff
All short options of groffer
are compatible with the short
options of groff(1). The following of groff
options have either
an additional special meaning within groffer
or make sense for
normal usage.
Because of the special outputting behavior of the groff
option -Z
groffer
was designed to be switched into groff mode; the groffer
viewing features are disabled there. The other groff
options do
not switch the mode, but allow to customize the formatting
process.
--a
This generates an ASCII approximation of output in the
text modes. That could be important when the text pager
has problems with control sequences in tty mode.
--m
file
Add file as a groff macro file. This is useful in case it
cannot be recognized automatically.
--P
opt_or_arg
Send the argument opt_or_arg as an option or option
argument to the actual groff
postprocessor.
--T
devname | --device
devname
This option determines groff
's output device. The most
important devices are the text output devices for
referring to the different character sets, such as ascii
,
utf8
, latin1
, utf8
, and others. Each of these arguments
switches groffer
into a text mode using this device, to
mode tty if the actual mode is not a text mode. The
following devname arguments are mapped to the
corresponding groffer --mode=
devname option: dvi
, html
,
xhtml
, and ps
. All X*
arguments are mapped to mode x.
Each other devname argument switches to mode groff using
this device.
--X
is equivalent to groff -X
. It displays the groff
intermediate output with gxditview
. As the quality is
relatively bad this option is deprecated; use --X
instead
because the x mode uses an X* device for a better display.
-Z
| --intermediate-output
| --ditroff
Switch into groff mode and format the input with the groff
intermediate output without postprocessing; see
groff_out(5). This is equivalent to option --ditroff
of
man, which can be used as well.
All other groff
options are supported by groffer
, but they are
just transparently transferred to groff
without any intervention.
The options that are not explicitly handled by groffer
are
transparently passed to groff
. Therefore these transparent
options are not documented here, but in groff(1). Due to the
automatism in groffer
, none of these groff
options should be
needed, except for advanced usage.
Options for man pages
--apropos
Start the apropos(1) command or facility of man(1) for
searching the filespec arguments within all man page
descriptions. Each filespec argument is taken for search
as it is; section specific parts are not handled, such
that 7 groff
searches for the two arguments 7
and groff
,
with a large result; for the filespec groff.7
nothing will
be found. The language locale is handled only when the
called programs do support this; the GNU apropos
and man
-k
do not. The display differs from the apropos
program
by the following concepts:
* Construct a groff frame similar to a man page to the
output of apropos
,
* each filespec argument is searched on its own.
* The restriction by --sections
is handled as well,
* wildcard characters are allowed and handled without a
further option.
--apropos-data
Show only the apropos
descriptions for data documents,
these are the man(7) sections 4, 5, and 7. Direct section
declarations are ignored, wildcards are accepted.
--apropos-devel
Show only the apropos
descriptions for development
documents, these are the man(7) sections 2, 3, and 9.
Direct section declarations are ignored, wildcards are
accepted.
--apropos-progs
Show only the apropos
descriptions for documents on
programs, these are the man(7) sections 1, 6, and 8.
Direct section declarations are ignored, wildcards are
accepted.
--whatis
For each filespec argument search all man pages and
display their description — or say that it is not a
man page. This is written from anew, so it differs from
man's whatis
output by the following concepts
* each retrieved file name is added,
* local files are handled as well,
* the language and system locale is supported,
* the display is framed by a groff output format similar
to a man page,
* wildcard characters are allowed without a further
option.
The following options were added to groffer
for choosing whether
the file name arguments are interpreted as names for local files
or as a search pattern for man pages. The default is looking up
for local files.
--man
Check the non-option command-line arguments (filespecs)
first on being man pages, then whether they represent an
existing file. By default, a filespec is first tested
whether it is an existing file.
--no-man
| --local-file
Do not check for man pages. --local-file
is the
corresponding man
option.
--no-special
Disable former calls of --all
, --apropos*
, and --whatis
.
Long options taken over from GNU man
The long options of groffer
were synchronized with the long
options of GNU man
. All long options of GNU man
are recognized,
but not all of these options are important to groffer
, so most of
them are just ignored. These ignored man
options are --catman
,
--troff
, and --update
.
In the following, the man
options that have a special meaning for
groffer
are documented.
If your system has GNU man
installed the full set of long and
short options of the GNU man
program can be passed via the
environment variable MANOPT; see man(1).
--all
In searching man pages, retrieve all suitable documents
instead of only one.
-7
| --ascii
In text modes, display ASCII translation of special
characters for critical environment. This is equivalent
to groff -mtty_char
; see groff_tmac(5).
--ditroff
Produce groff intermediate output. This is equivalent to
groffer -Z
.
--extension
suffix
Restrict man page search to file names that have suffix
appended to their section element. For example, in the
file name /usr/share/man/man3/terminfo.3ncurses.gz the
man page extension is ncurses.
--locale
language
Set the language for man pages. This has the same effect,
but overwrites $LANG.
--location
Print the location of the retrieved files to standard
error.
--no-location
Do not display the location of retrieved files; this
resets a former call to --location
. This was added by
groffer
.
--manpath
'dir1:dir2:...'
Use the specified search path for retrieving man pages
instead of the program defaults. If the argument is set
to the empty string "" the search for man page is
disabled.
--pager
Set the pager program in tty mode; default is less
. This
can be set with --viewer
.
--sections
sec1:sec2:...
Restrict searching for man pages to the given sections, a
colon-separated list.
--systems
sys1,sys2,...
Search for man pages for the given operating systems; the
argument systems is a comma-separated list.
--where
Equivalent to --location
.
X Window System Toolkit Intrinsics options
The following long options were adapted from the corresponding X
Window System Toolkit Intrinsics options. groffer
will pass them
to the actual viewer program if it is an X Window System program.
Otherwise these options are ignored.
Unfortunately these options use the old style of a single minus
for long options. For groffer
that was changed to the standard
with using a double minus for long options, for example, groffer
uses the option --font
for the X Window System Toolkit Intrinsics
option -font
.
See X
(7) and the manual X Toolkit Intrinsics – C Language
Interface for more details on these options and their arguments.
--background
color
Set the background color of the viewer window.
--bd
pixels
This is equivalent to --bordercolor
.
--bg
color
This is equivalent to --background
.
--bw
pixels
This is equivalent to --borderwidth
.
--bordercolor
pixels
Specifies the color of the border surrounding the viewer
window.
--borderwidth
pixels
Specifies the width in pixels of the border surrounding
the viewer window.
--display
X-display
Set the X Window System display on which the viewer
program shall be started. See section 'Display Names' in
X
(7) for the syntax of the argument.
--foreground
color
Set the foreground color of the viewer window.
--fg
color
This is equivalent to --foreground
.
--fn
font_name
This is equivalent to --font
.
--font
font_name
Set the font used by the viewer window. The argument is
an X Window System font name.
--ft
font_name
This is equivalent to --font
.
--geometry
size_pos
Set the geometry of the display window, that means its
size and its starting position. See section 'Geometry
Specifications' in X
(7) for the syntax of the argument.
--resolution
value
Set X Window System resolution in dpi (dots per inch) in
some viewer programs. The only supported dpi values are
75
and 100
. Actually, the default resolution for groffer
is set to 75dpi
. The resolution also sets the default
device in mode x.
--rv
Reverse foreground and background color of the viewer
window.
--title
'some text'
Set the title for the viewer window.
--xrm
'resource'
Set the X Window System server resource to the given
value.
Options for development
--debug
Enable all debugging options --debug-
type. The temporary
files are kept and not deleted, the grog
output is
printed, the name of the temporary directory is printed,
the displayed file names are printed, and the parameters
are printed.
--debug-filenames
Print the names of the files and man pages that are
displayed by groffer
.
--debug-grog
Print the output of all grog
commands.
--debug-keep
Enable two debugging informations. Print the name of the
temporary directory and keep the temporary files, do not
delete them during the run of groffer
.
--debug-params
Print the parameters, as obtained from the configuration
files, from GROFFER_OPT, and the command-line arguments.
--debug-tmpdir
Print the name of the temporary directory.
--do-nothing
This is like --version
, but without the output; no viewer
is started. This makes only sense in development.
--print=
text
Just print the argument to standard error. This is good
for parameter check.
-V
This is an advanced option for debugging only. Instead of
displaying the formatted input, a lot of groffer specific
information is printed to standard output:
* the output file name in the temporary directory,
* the display mode of the actual groffer
run,
* the display program for viewing the output with its
arguments,
* the active parameters from the config files, the
arguments in GROFFER_OPT, and the arguments of the
command line,
* the pipeline that would be run by the groff
program, but
without executing it.
Other useful debugging options are the groff
option -Z
and
--mode=groff
.
Filespec arguments
A filespec parameter is an argument that is not an option or
option argument. In groffer
, filespec parameters are a file name
or a template for searching man pages. These input sources are
collected and composed into a single output file such as groff
does.
The strange POSIX behavior to regard all arguments behind the
first non-option argument as filespec arguments is ignored. The
GNU behavior to recognize options even when mixed with filespec
arguments is used throughout. But, as usual, the double minus
argument --
ends the option handling and interprets all following
arguments as filespec arguments; so the POSIX behavior can be
easily adopted.
The options --apropos*
have a special handling of filespec
arguments. Each argument is taken as a search scheme of its own.
Also a regexp (regular expression) can be used in the filespec.
For example, groffer --apropos '^gro.f$'
searches groff
in the
man page name, while groffer --apropos groff
searches groff
somewhere in the name or description of the man pages.
All other parts of groffer, such as the normal display or the
output with --whatis
have a different scheme for filespecs. No
regular expressions are used for the arguments. The filespec
arguments are handled by the following scheme.
It is necessary to know that on each system the man pages are
sorted according to their content into several sections. The
classical man sections have a single-character name, either a
digit from 1
to 9
or one of the characters n
or o
.
This can optionally be followed by a string, the so-called
extension. The extension allows the storage of several man pages
with the same name in the same section. But the extension is
only rarely used; usually it is omitted. Then the extensions are
searched automatically by alphabet.
In the following, we use the name section_extension for a word
that consists of a single character section name or a section
character that is followed by an extension. Each filespec
parameter can have one of the following forms in decreasing
sequence.
* No filespec parameters means that groffer
waits for standard
input. The minus option -
always stands for standard input; it
can occur several times. If you want to look up a man page
called -
use the argument man:-
.
* Next a filespec is tested whether it is the path name of an
existing file. Otherwise it is assumed to be a searching
pattern for a man page.
* man:
name(
section_extension)
, man:
name.
section_extension,
name(
section_extension)
, or name.
section_extension search the
man page name in man section and possibly extension of
section_extension.
* Now man:
name searches for a man page in the lowest man section
that has a document called name.
* section_extension name is a pattern of 2 arguments that
originates from a strange argument parsing of the man
program.
Again, this searches the man page name with section_extension,
a combination of a section character optionally followed by an
extension.
* We are left with the argument name which is not an existing
file. So this searches for the man page called name in the
lowest man section that has a document for this name.
Several file name arguments can be supplied. They are mixed by
groff
into a single document. Note that the set of option
arguments must fit to all of these file arguments. So they
should have at least the same style of the groff language.