* release of groffer 0.9.14
[s-roff.git] / contrib / groffer / groffer.man
blobb9492602a9698b58cdf4036865d888d2ff2a2013
1 .TH GROFFER @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
2 .SH NAME
3 groffer \- display groff files and man\~pages on X and tty
5 .SH "SYNOPSIS"
6 .\" The .SH was moved to this place in order to appease `apropos'.
8 .\" --------------------------------------------------------------------
9 .\" Legalize
10 .\" --------------------------------------------------------------------
12 .ig
13 groffer.1 - man page for groffer (section 1).
15 Source file position:  <groff_source_top>/contrib/groffer/groffer.man
16 Installed position:    $prefix/share/man/man1/groffer.1
18 Last update : 21 May 2005
20 Source file position: <groff-source>/contrib/groffer/groffer.man
22 .de author
23 This file was written by Bernd Warken.
25 .de copyleft
26 Copyright (C) 2001,2002,2004,2005 Free Software Foundation, Inc.
29 This file is part of groff, a free software project.
31 You can redistribute it and/or modify it under the terms of the GNU
32 General Public License as published by the Free Software Foundation;
33 either version 2, or (at your option) any later version.
36 You should have received a copy of the GNU General Public License
37 along with groff, see the files COPYING and LICENSE in the top
38 directory of the groff source package.
40 Or read the man page
41 .BR gpl (1).
42 You can also write to the Free Software Foundation, 59 Temple Place -
43 Suite 330, Boston, MA 02111-1307, USA.
46 .\" --------------------------------------------------------------------
47 .\" Setup
48 .\" --------------------------------------------------------------------
50 .mso www.tmac
52 .if n \{\
53 .  mso tty-char.tmac
54 .  ftr CR R
55 .  ftr CI I
56 .  ftr CB B
57 .\}
59 .if '\*[.T]'dvi' \{\
60 .  ftr CB CW
61 .\}
63 .ds Ellipsis ".\|.\|.\""
65 .\" --------------------------------------------------------------------
66 .\" setup for the macro definitions below
67 .\"
68 .\" naming:  namespace:cathegory_macro.variable_name  (experimental)
70 .\" --------------------------------------------------------------------
71 .\" configuration of prompt for `.Shell_cmd'* macros
72 .ds groffer:Shell_cmd.prompt_text sh#\"    prompt for shell commands
73 .ds groffer:Shell_cmd+.prompt_text >\"     prompt on continuation lines
74 .ds groffer:Shell_cmd_base.prompt_font I\" font for prompts
76 .\" automatically determine setup from the configuration above
77 .als @f groffer:Shell_cmd_base.prompt_font\"
78 .als @t groffer:Shell_cmd.prompt_text\"
79 .als @t+ groffer:Shell_cmd+.prompt_text\"
80 .ds groffer:Shell_cmd.prompt \f[\*[@f]]\*[@t]\f[]\"            needed
81 .ds groffer:Shell_cmd+.prompt \f[\*[@f]]\*[@t+]\f[]\"          needed
82 .nr @w \w'\*[groffer:Shell_cmd.prompt]'\"
83 .nr @w+ \w'\*[groffer:Shell_cmd+.prompt]'\"
84 .ft \*[@f]
85 .\" Full prompt width is maximum of texts plus 1m
86 .nr groffer:Shell_cmd_base.prompt_width (\n[@w]>?\n[@w+]+1m)\" needed
87 .ft
88 .rm @f
89 .rm @f+
90 .rm @t
91 .rm @t+
92 .rr @w
93 .rr @w+
95 .\" --------------------------------------------------------------------
96 .\" static register for inter-macro communication in `.Synopsis'*
97 .nr groffer:Synopsis.level 0
99 .\" --------------------------------------------------------------------
100 .\" static registers for inter-macro communication in `.TP'*
101 .nr groffer:TP.level 0
102 .rr groffer:TP_header.flag
103 .rr groffer:TP_body.flag
104 .rr groffer:TP.indent
107 .\" --------------------------------------------------------------------
108 .\" Macro definitions
110 .\" Ignore all arguments like a comment, even after a .eo call.
111 .de c
113 .c --------------------------------------------------------------------
114 .c .CB  (<text>...)
116 .c Print in constant-width bold font.
118 .de CB
119 .  ft CB
120 .  Text \\$*
121 .  ft
123 .c --------------------------------------------------------------------
124 .c .CI  (<text>...)
126 .c Print in constant-width italic font.
128 .de CI
129 .  ft CI
130 .  Text \\$*
131 .  ft
133 .c --------------------------------------------------------------------
134 .c .CR  (<text>...)
136 .c Print in constant-width roman font.
138 .de CR
139 .  ft CR
140 .  Text \\$*
141 .  ft
143 .c --------------------------------------------------------------------
144 .c .Error  (<text>...)
146 .c Print error message to terminal and abort.
148 .de Error
149 .  tm \\$*
150 .  ab
152 .c --------------------------------------------------------------------
153 .c .Env_var  (<env_var_name> [<punct>])
155 .c Display an environment variable, with optional punctuation.
157 .de Env_var
158 .  nh
159 .  SM
160 .  Text \f[CB]\\$1\f[]\\$2
161 .  hy
163 .c --------------------------------------------------------------------
164 .c .File_name  (<path_name>)
166 .c Display a file or directory name in CB font.
168 .de File_name
169 .  Header_CB \\$@
171 .c --------------------------------------------------------------------
172 .c .Header_CB  (<path_name>)
174 .c Display a line in CB font, for example after .TP
176 .de Header_CB
177 .  nh
178 .  Text \f[CB]\\$1\f[]\\$2
179 .  hy
181 .c --------------------------------------------------------------------
182 .c .Opt_-  ([<punct>])
184 .c Print `-' (minus sign); optional punctuation. 
186 .de Opt_-
187 .  ie (\\n[.$] == 0) \
188 .    Opt_alt - ""
189 .  el \
190 .    Opt_alt - "" "\\$1"
192 .c --------------------------------------------------------------------
193 .c .Opt_[-]  ([<punct>])
195 .c Print `Opt_[-]' (minus sign in brackets); optional punctuation. 
197 .de Opt_[-]
198 .  ie (\\n[.$] == 0) \
199 .    Opt_[alt] - ""
200 .  el \
201 .    Opt_[alt] - "" "\\$1"
203 .c --------------------------------------------------------------------
204 .c .Opt_--  ([<punct>])
206 .c Print `--' (double minus); optional punctuation. 
208 .de Opt_--
209 .  ie (\\n[.$] == 0) \
210 .    Opt_alt -- ""
211 .  el \
212 .    Opt_alt -- "" "\\$1"
214 .c --------------------------------------------------------------------
215 .c .Opt_[--]  ([<punct>])
217 .c Print `Opt_[--]' (double minus in brackets); optional punctuation. 
219 .de Opt_[--]
220 .  ie (\\n[.$] == 0) \
221 .    Opt_[alt] -- ""
222 .  el \
223 .    Opt_[alt] -- "" "\\$1"
225 .c --------------------------------------------------------------------
226 .c .Opt_alt  ([<minus> <opt>]... [<arg> [<punct>]])
228 .c Alternate options separated by a vertical bar.
230 .c Arguments:
231 .c   minus: either `-' or `--' (font CB).
232 .c   opt: a name for an option, empty allowed (font CB).
233 .c   arg: optionally, the argument to the option (font I).
234 .c   punct: optional punctuation (in the starting font).
235 .c Result:
236 .c   The minus/opt argument pairs, each
237 .c   separated by a vertical bar `|', optionally add 'arg', separated
238 .c   a space character ` '.
240 .c Example:
241 .c  .Opt_alt - T -- device -- device-troff device .
242 .c  results in
243 .c  -T|--device|--device-troff device.
245 .de Opt_alt
246 .  Opt_alt_base "" | "" \\$@
248 .c --------------------------------------------------------------------
249 .c .Opt_[alt]  ([<minus> <opt>]... [<arg> [<punct>]])
251 .c Alternate options in brackets for section SYNOPSIS.
253 .c Arguments:
254 .c   minus: either `-' or `--' (font CB).
255 .c   opt: a name for an option, empty allowed (font CB).
256 .c   arg: optionally, the argument to the option (font I).
257 .c   punct: optional punctuation (in the starting font).
258 .c Global strings written to:
259 .c   `@oa_prefix': left enclosing character (`[')
260 .c   `@oa_sep': separator (`|')
261 .c   `@oa_postfix': right enclosing character (`]')
262 .c Result:
263 .c   The minus/opt argument pairs, each separated by a vertical
264 .c   bar `|', optionally add 'arg', separated by a space character ` '.
266 .c Example:
267 .c  .Opt_[alt] - T -- device -- device-troff device .
268 .c  results in
269 .c  [-T|--device|--device-troff device].
271 .de Opt_[alt]
272 .  Opt_alt_base [ | ] \\$@
274 .c --------------------------------------------------------------------
275 .c .Opt_alt_base  (<pre> <sep> <post> [<minus> <opt>]... [arg [punct]])
277 .c Alternating options; base macro for many others; do not use directly.
279 .c Arguments:
280 .c   <pre>: prefix, result is preceded by this.
281 .c   <sep>: separator between minus/opt pairs.
282 .c   <post>: postfix, is appended to the result.
283 .c   <minus>: either `-' or `--' (font CB).
284 .c   <opt>: a name for an option, empty allowed (font CB).
285 .c   <arg>: optionally, the argument to the option (font I).
286 .c   <punct>: optional punctuation (in the starting font).
287 .c Result:
288 .c   String `<pre>' followed by the <minus>/<opt> argument pairs, each
289 .c   separated by string `<sep>', optionally add '<arg>', separated by
290 .c   a single space ` ', followed by the string `<post>'.  Terminated
291 .c   by the optional punctuation <punct>.
293 .de Opt_alt_base
294 .  nr @font \\n[.f]\"
295 .  if (\\n[.$] < 3) \
296 .    Error .\\0: not enough arguments.
297 .  ds @pre \)\\$1\)\"                   prefix
298 .  ds @sep \)\\$2\)\"                   separator
299 .  ds @post \)\\$3\)\"                  postfix
300 .  shift 3
301 .  nr @count 0
302 .  ds @res \f[CR]\\*[@pre]\"
303 .  while (\\n[.$] >= 2) \{\
304 .    c                                  do the pairs, break on no `-'
305 .    if !'\\$1'-' \{\
306 .      if !'\\$1'--' \
307 .        break
308 .    \}
309 .    c                                  separator
310 .    if (\\n[@count] > 0) \
311 .      as @res \f[CR]\\*[@sep]\:\"
312 .    nr @count +1
313 .    c                                  combine minus with option name
314 .    as @res \f[CB]\\-\"
315 .    if '\\$1'--' \
316 .      as @res \\-\"
317 .    as @res \\$2\"
318 .    shift 2
319 .  \}
320 .  if (\\n[.$] >= 3) \
321 .    Error .\\0: wrong arguments: \\$@
322 .  c                                    all pairs are done
323 .  ie (\\n[.$] == 0) \
324 .    as @res \f[CR]\\*[@post]\"
325 .  el \{\
326 .    c                                  optional option argument
327 .    if !'\\$1'' \
328 .      as @res \f[CR] \,\f[I]\\$1\"
329 .    shift
330 .    c                                  postfix
331 .    as @res \\f[CR]\\*[@post]\"
332 .    if (\\n[.$] >= 1) \{\
333 .      c                                add punctuation
334 .      as @res \f[\\n[@font]]\\$1\"
335 .    \}
336 .  \}
337 .  nh
338 .  Text \\*[@res]
339 .  hy
340 .  ft \\n[@font]
341 .  rr @count
342 .  rr @font
343 .  rm @pre
344 .  rm @post
345 .  rm @sep
346 .  rm @res
348 .c --------------------------------------------------------------------
349 .c .Opt_def  ([<minus> <opt>]... [<arg> [<punct>]])
351 .c Definitions of options in section OPTIONS.
353 .c Arguments:
354 .c   minus: either `-' or `--' (font CB).
355 .c   opt: a name for an option, empty allowed (font CB).
356 .c   arg: optionally, the argument to the option (font I).
357 .c   punct: optional punctuation (in the starting font).
358 .c Result:
359 .c   The header for an indented paragraph, consisting of
360 .c   minus/opt argument pairs, each, separated by a space
361 .c   character ` ', optionally add 'arg', separated a space
362 .c   character ` '.
364 .c Example:
365 .c  .Opt_def - T -- device -- device-troff device .
366 .c  results in
367 .c  -T --device --device-troff device.
368 .c  as the header of for indented paragraph.
370 .de Opt_def
371 .  TP
372 .    Opt_alt_base "" "\~|\~" "" \\$@
374 .c --------------------------------------------------------------------
375 .c .Opt_element  ([<minus> <opt>]... [<arg> [<punct>]])
377 .c Definitions of options in section OPTIONS.
379 .c Arguments:
380 .c   minus: either `-' or `--' (font CB).
381 .c   opt: a name for an option, empty allowed (font CB).
382 .c   arg: optionally, the argument to the option (font I).
383 .c   punct: optional punctuation (in the starting font).
384 .c Result:
385 .c   The minus/opt argument pairs, each, separated by a space
386 .c   character ` ', optionally add 'arg', separated a space
387 .c   character ` '.
389 .c Example:
390 .c  .Opt_element - T -- device -- device-troff device .
391 .c  results in
392 .c  -T --device --device-troff device.
394 .de Opt_element
395 .  Opt_alt_base "" "\~" "" \\$@
397 .c --------------------------------------------------------------------
398 .als Opt_list Opt_element
400 .c --------------------------------------------------------------------
401 .c .Opt_long  ([<name> [<punct>]])
403 .c Print `--name' somewhere in the text; optional punctuation.
405 .de Opt_long
406 .  Opt_alt -- "\\$1" "" "\\$2"
408 .c --------------------------------------------------------------------
409 .c .Opt_long_arg  ([<name> <arg> [<punct>]])
411 .c Print `--name=arg' somewhere in the text; optional punctuation.
413 .de Opt_long_arg
414 .  Opt_alt -- "\\$1=\\$2" "" "\\$3"
416 .c --------------------------------------------------------------------
417 .c .Opt_[long]  ([<name> [<punct>]])
419 .c Print `--name' somewhere in the text; optional punctuation.
421 .de Opt_[long]
422 .  Opt_[alt] -- "\\$1" "" "\\$2"
424 .c --------------------------------------------------------------------
425 .c .Opt_short  ([<name> [<punct>]])
427 .c Print `-name' somewhere in the Text; optional punctuation.
429 .de Opt_short
430 .  Opt_alt - "\\$1" "" "\\$2"
432 .c --------------------------------------------------------------------
433 .c .Opt_[short]  ([name [punct]])
435 .c Print `[-name]' somewhere in the Text; optional punctuation.
437 .de Opt_[short]
438 .  Opt_[alt] - "\\$1" "" "\\$2"
440 .c --------------------------------------------------------------------
441 .c .Shell_cmd  (<CR> [<CI>] ...)
443 .c A shell command line; display args alternating in fonts CR and CI.
445 .c Examples:
446 .c   .Shell_cmd "groffer --dpi 100 file"
447 .c     result: `sh#  groffer --dpi 100 file'
448 .c             with 'sh#' in font I, the rest in CR
450 .c   .Shell_cmd groffer\~--dpi\~100\~file
451 .c     result: the same as above
453 .c   .Shell_cmd "groffer --dpi=" value " file"
454 .c     result: sh#  groffer --dpi=value file
455 .c             with `groffer --dpi=' and `file' in CR; `value' in CI
457 .c   .Shell_cmd groffer\~--dpi= value \~file
458 .c     result: the same as the previous example
460 .de Shell_cmd
461 .  groffer:Shell_cmd_base "\*[groffer:Shell_cmd.prompt]" \\$@
463 .c --------------------------------------------------------------------
464 .c .Shell_cmd+  (<CR> [<CI>] ...)
466 .c A continuation line for .Shell_cmd.
468 .de Shell_cmd+
469 .  groffer:Shell_cmd_base "\*[groffer:Shell_cmd+.prompt]" \\$@
471 .c --------------------------------------------------------------------
472 .c .Shell_cmd_base  (<prompt> [<CR> [<CI>] ...])
474 .c A shell command line; display args alternating in fonts CR and CI.
475 .c Internal, do not use directly.
477 .c Globals: read-only register @.Shell_cmd_width
479 .de groffer:Shell_cmd_base
480 .  if (\\n[.$] <= 0) \
481 .    return
482 .  nr @+font \\n[.f]\"
483 .  ds @prompt \\$1\"
484 .  ft CR
485 .  c gap between prompt and command
486 .  nr @+gap \\n[groffer:Shell_cmd_base.prompt_width]-\\w'\\*[@prompt]'\"
487 .  ds @res \\*[@prompt]\h'\\n[@+gap]u'\"
488 .  shift
489 .  ds @cf CR\"
490 .  while (\\n[.$] > 0) \{\
491 .    as @res \\f[\\*[@cf]]\\$1\"
492 .    shift
493 .    ie '\\*[@cf]'CR' \
494 .      ds @cf I\"
495 .    el \
496 .      ds @cf CR\"
497 .  \}
498 .  br
499 .  ad l
500 .  nh
501 .  nf
502 .  Text \\*[@res]\"
503 .  fi
504 .  hy
505 .  ad
506 .  br
507 .  ft \\n[@+font]
508 .  rr @+font
509 .  rr @+gap
510 .  rm @cf
511 .  rm @res
513 .c --------------------------------------------------------------------
514 .c .Synopsis  ()
516 .c Begin a synopsis section, to be ended by a ./Synopsis macro.
518 .de Synopsis
519 .  if (\\n[groffer:Synopsis.level] > 0) \
520 .    Error .\\$0: previous .Synopsis was not closed by ./Synopsis.
521 .  nh
522 .  ds @1 \\$1\"
523 .  nr @old_indent \\n(.i
524 .  ad l
525 .  in +\w'\fB\\*[@1]\0'u
526 .  ti \\n[@old_indent]u
527 .  B \\*[@1]\0\c
528 .  rr @old_indent
529 .  rm @1
530 .  nr groffer:Synopsis.level +1\"        marker for ./Synopsis
532 .c  --------------------------------------------------------------------
533 .c ./Synopsis  ()
535 .c Close a synopsis section opened by the previous .Synopsis macro.
537 .de /Synopsis
538 .  if (\\n[groffer:Synopsis.level] <= 0) \
539 .    Error .\\$0: no previous call of .Synopsis
540 .  br
541 .  ad
542 .  in
543 .  hy
544 .  nr groffer:Synopsis.level -1
546 .c  --------------------------------------------------------------------
547 .c .Text  (<text>...)
549 .c Treat the arguments as text, no matter how they look.
551 .de Text
552 .  if (\\n[.$] == 0) \
553 .    return
554 .  nh
555 .  nop \)\\$*\)
556 .  hy
558 .c --------------------------------------------------------------------
559 .c .Topic  ([<indent>])
561 .c A bulleted paragraph
563 .de Topic
564 .  ie (\\n[.$] = 0) \
565 .    ds @indent 2m\"
566 .  el \
567 .    ds @indent \\$1\"
568 .  TP \\*[@indent]
569 .  Text \[bu]
570 .  rm @indent
572 .c --------------------------------------------------------------------
573 .c .TP+  ()
575 .c Continuation line for .TP header.
577 .de TP+
578 .  br
579 .  ns
580 .  TP \\$1
582 .c --------------------------------------------------------------------
583 .c .TP_header  ([<indent>])
585 .c Start a multi-line header for a .TP-like paragraph
587 .de TP_header
588 .  if (\\n[groffer:TP.level] < 0) \
589 .    Error .\\$0: wrong level.
590 .  nr groffer:TP.level +1
591 .  P
592 .  ie (\\n[.$] == 0) \
593 .    rr groffer:TP.indent
594 .  el \
595 .    nr groffer:TP.indent \\$1
596 .  nr groffer:TP_header.flag 1
598 .c --------------------------------------------------------------------
599 .c .TP_body  ([<indent>])
601 .c End a previous .TP-header and beging the body of the paragraph.
603 .de TP_body
604 .  if !rgroffer:TP_header.flag \
605 .    Error .\\$0: no previous call of .TP_header
606 .  if (\\n[groffer:TP.level] <= 0) \
607 .    Error .\\$0: wrong level.
608 .  br
609 .  ie (\\n[.$] == 0) \{\
610 .    ie rgroffer:TP.indent \{\
611 .      RS \\n[groffer:TP.indent]u
612 .    \}
613 .    el \
614 .      RS
615 .  \}
616 .  el \
617 .    RS \\$1u
618 .  rr groffer:TP.indent
619 .  rr groffer:TP_header.flag
620 .  nr groffer:TP_body.flag 1
622 .c --------------------------------------------------------------------
623 .c TP_end  ()
625 .c End of former .TP_body paragraph.
627 .de TP_end
628 .  if !rgroffer:TP_body.flag \
629 .    Error .\\$0: no previous .TP_body.
630 .  if (\\n[groffer:TP.level] <= 0) \
631 .    Error TP_end: wrong level.
632 .  nr groffer:TP.level -1
633 .  rr grogger:TP.indent
634 .  rr groffer:TP_header.flag
635 .  rr groffer:TP_body.flag
636 .  br
637 .  RE
640 .\" End of macro definitions
643 .\" --------------------------------------------------------------------
644 .\" SH "SYNOPSIS"
645 .\" --------------------------------------------------------------------
647 .ad l
648 .Synopsis groffer
649 .RI [ option... ]
650 .Opt_[--]
651 .RI [ "filespec" "\*[Ellipsis]]"
652 ./Synopsis
654 .Synopsis groffer
655 .Opt_alt -- apropos -- apropos-data -- apropos-devel -- apropos-progs name
656 ./Synopsis
658 .Synopsis groffer
659 .Opt_alt - h -- help
660 ./Synopsis
662 .Synopsis groffer
663 .Opt_alt - v -- version
664 ./Synopsis
667 .\" --------------------------------------------------------------------
668 .SH DESCRIPTION
669 .\" --------------------------------------------------------------------
672 .I \%groffer
673 program is the easiest way to use
674 .BR \%groff (@MAN1EXT@).
675 It can display arbitrary documents written in the
676 .BR \%groff (@MAN7EXT@)
677 language or other
678 .BR \%roff (@MAN7EXT@)
679 languages that are compatible to the original
680 .I \%troff
681 language.
684 .I \%groffer
685 program also includes many of the features for finding and displaying
686 the \%UNIX manual pages
688 .RI ( man\~pages ),
690 such that it can be used as a replacement for a
691 .BR \%man (1)
692 program.
694 Moreover, compressed files that can be handled by
695 .BR \%gzip (1)
697 .BR \%bzip2 (1)
698 are decompressed on-the-fly.
702 The normal usage is quite simple by supplying a file name or name of a
703 man\~page without further options.
705 But the option handling has many possibilities for creating special
706 behaviors.
708 This can be done in configuration files, with the shell environment
709 variable
710 .BR \%$GROFFER_OPT ,
711 or on the command line.
715 The output can be generated and viewed in several different ways
716 available for
717 .IR \%groff .
719 This includes the
720 .I \%groff
721 native X viewer
722 .BR \%gxditview (@MAN1EXT@),
723 each Postcript or
724 .I \%dvi
725 display program, a web browser by generating
726 .I \%html
727 in www-mode, or several text modes in text terminals.
731 Most of the options that must be named when running
732 .I \%groff
733 directly are determined automatically for
734 .IR \%groffer ,
735 due to the internal usage of the
736 .BR \%grog (@MAN1EXT@)
737 program.
739 But all parts can also be controlled manually by arguments.
743 Several file names can be specified on the command line arguments.
745 They are transformed into a single document in the normal way of
746 .IR \%groff .
749 .\" --------------------------------------------------------------------
750 .SH "OPTION OVERVIEW"
751 .\" --------------------------------------------------------------------
754 .I breaking options
757 .Opt_[alt] -- apropos name
758 .Opt_[alt] -- apropos\-data name
759 .Opt_[alt] -- apropos\-devel name
760 .Opt_[alt] -- apropos\-progs name
761 .Opt_[alt] - h -- help
762 .Opt_[alt] - v -- version
767 .I \%groffer mode options
770 .Opt_[alt] -- auto
771 .Opt_[alt] -- default
772 .Opt_[alt] -- default\-modes mode1,mode2,\*[Ellipsis]
773 .Opt_[alt] -- dvi
774 .Opt_[alt] -- dvi\-viewer prog
775 .Opt_[alt] -- groff
776 .Opt_[alt] -- html
777 .Opt_[alt] -- html\-viewer prog
778 .Opt_[alt] -- man
779 .Opt_[alt] -- mode display_mode
780 .Opt_[alt] -- no-man
781 .Opt_[alt] -- pdf
782 .Opt_[alt] -- pdf\-viewer prog
783 .Opt_[alt] -- ps
784 .Opt_[alt] -- ps\-viewer prog
785 .Opt_[alt] -- text
786 .Opt_[alt] -- tty
787 .Opt_[alt] -- tty\-viewer prog
788 .Opt_[alt] -- www
789 .Opt_[alt] -- www\-viewer prog
790 .Opt_[alt] -- x -- X
791 .Opt_[alt] -- x\-viewer -- X\-viewer prog
796 .I development options
799 .Opt_[alt] -- debug
800 .Opt_[alt] -- shell
805 .I options related to \%groff
808 .Opt_[alt] - P -- postproc\-arg opt_or_arg
809 .Opt_[alt] - Q -- source
810 .Opt_[alt] - T -- device device
811 .Opt_[alt] - Z -- intermediate\-output -- ditroff
813 All further
814 .I \%groff
815 short options are accepted.
820 .I X Window toolkit options
823 .Opt_[alt] -- bd pixels
824 .Opt_[alt] -- bg -- background color
825 .Opt_[alt] -- bw pixels
826 .Opt_[alt] -- display X-display
827 .Opt_[alt] -- fg -- foreground color
828 .Opt_[alt] -- ft -- font font_name
829 .Opt_[alt] -- geometry size_pos
830 .Opt_[alt] -- resolution value
831 .Opt_[alt] -- rv
832 .Opt_[alt] -- title string
833 .Opt_[alt] -- xrm X_resource
838 .I options from man
841 .Opt_[alt] -- all
842 .Opt_[alt] -- ascii
843 .Opt_[alt] -- ditroff
844 .Opt_[alt] -- extension suffix
845 .Opt_[alt] -- locale language
846 .Opt_[alt] -- local-file
847 .Opt_[alt] -- manpath dir1:dir2:\*[Ellipsis]
848 .Opt_[alt] -- pager program
849 .Opt_[alt] -- sections sec1:sec2:\*[Ellipsis]
850 .Opt_[alt] -- systems sys1,sys2,\*[Ellipsis]
851 .Opt_[alt] -- troff-device device
852 .Opt_[alt] -- whatis
854 Further long options of GNU
855 .I man
856 are accepted as well.
861 .I filespec argument
865 .I filespec
866 parameters means standard input.
869 .TP 10m
870 .Opt_short ""
871 stands for standard input (can occur several times).
875 .I filename
876 the path name of an existing file.
880 .BI man: name ( section )
881 .TP+
882 .IB name ( section )
883 search the man\~page
884 .I \%name
885 in man\~section
886 .IR section .
890 .BI man: name . s
891 .TP+
892 .IB name . s
894 .I s
895 is a character in
896 .BR \%[1-9on] ,
897 search for a man\~page
898 .I \%name
899 in man\~section
900 .IR s .
904 .BI man: name
905 man\~page in the lowest man\~section that has
906 .IR \%name .
910 .I "s name"
912 .I s
913 is a character in
914 .BR \%[1-9on] ,
915 search for a man\~page
916 .I \%name
917 in man\~section
918 .IR s .
922 .I name
923 if 
924 .I \%name
925 is not an existing file search for the man\~page
926 .I \%name
927 in the lowest man\~section.
932 .\" --------------------------------------------------------------------
933 .SH "OPTION DETAILS"
934 .\" --------------------------------------------------------------------
937 .I \%groffer
938 program can usually be run with very few options.
940 But for special purposes, it supports many options.
942 These can be classified in 5 option classes.
946 All short options of
947 .I \%groffer
948 are compatible with the short options of
949 .BR \%groff (@MAN1EXT@).
951 All long options of
952 .I \%groffer
953 are compatible with the long options of
954 .BR \%man (1).
957 .\" --------------------------------------------------------------------
958 .SS "groffer breaking Options"
959 .\" --------------------------------------------------------------------
961 As soon as one of these options is found on the command line it is
962 executed, printed to standard output, and the running
963 .I \%groffer
964 is terminated thereafter.
966 All other arguments are ignored.
969 .Opt_def -- apropos name
970 Start the
971 .BR \%apropos (1)
972 command for searching within man\~page
973 descriptions.
975 That slightly differs from the strange behavior of the
976 .Opt_long apropos
977 program of
978 .BR \%man (1),
979 which has no argument of its own, but takes the file arguments
980 instead.
982 Practically both concepts are compatible.
985 .Opt_def -- apropos\-data name
986 Show only the
987 .BR \%apropos (1)
988 descriptions for data documents, in the
989 .BR \%man (7)
990 sections 4, 5, and 7.
993 .Opt_def -- apropos\-devel name
994 Show only the
995 .BR apropos (1)
996 descriptions for development documents, in the
997 .BR man (7)
998 sections 2, 3, and 9.
1001 .Opt_def -- apropos\-progs name
1002 Show only the
1003 .BR \%apropos (1)
1004 descriptions for documents on programs, in the
1005 .BR \%man (7)
1006 sections 1, 6, and 8.
1009 .Opt_def - h -- help
1010 Print a helping information with a short explanation of option sto
1011 standard output.
1014 .Opt_def - v -- version
1015 Print version information to standard output.
1018 .\" --------------------------------------------------------------------
1019 .SS "groffer Mode Options"
1020 .\" --------------------------------------------------------------------
1022 The display mode and the viewer programs are determined by these
1023 options.
1025 If none of these mode and viewer options is specified
1026 .I \%groffer
1027 tries to find a suitable display mode automatically.
1030 .Opt_def -- auto
1031 Equivalent to
1032 .Opt_long_arg mode auto .
1035 .Opt_def -- default
1036 Reset all configuration from previously processed command line options
1037 to the default values.
1039 This is useful to wipe out all former options of the configuration, in
1040 .Env_var $GROFFER_OPT ,
1041 and restart option processing using only the rest of the command line.
1044 .Opt_def -- default\-modes mode1,mode2,\*[Ellipsis]
1045 Set the sequence of modes for
1046 .I \%auto mode
1047 to the comma separated list given in the argument.
1050 .Opt_long mode
1051 for details on modes.  Display in the default manner; actually, this
1052 means to try the modes
1053 .IR x ,
1054 .IR ps ,
1056 .I \%tty
1057 in this sequence.
1061 .Opt_def -- dvi
1062 Equivalent to
1063 .Opt_long_arg mode \%dvi .
1066 .Opt_def -- dvi\-viewer prog
1067 Set the viewer program for dvi mode.
1069 This can be a file name or a program to be searched in
1070 .Env_var $PATH .
1072 Known
1073 .I \%dvi
1074 viewers inlude
1075 .BR \%xdvi (1)
1077 .BR \%dvilx (1)
1079 In each case, arguments can be provided additionally.
1082 .Opt_def -- groff
1083 Equivalent to
1084 .Opt_long_arg mode groff .
1087 .Opt_def -- html
1088 Equivalent to
1089 .Opt_long_arg mode html .
1092 .Opt_def -- html\-viewer
1093 Set the web browser program for viewing in
1094 .I \%html
1095 mode.
1097 Each program that accepts html input and allows the
1098 .BI \%file://localhost/ dir / file
1099 syntax on the command line is suitable as viewer program; it can be
1100 the path name of an executable file or a program in
1101 .Env_var $PATH .
1103 In each case, arguments can be provided additionally.
1106 .Opt_def -- mode value
1108 Set the display mode.
1110 The following mode values are recognized:
1115 .Header_CB auto
1116 Select the automatic determination of the display mode.
1118 The sequence of modes that are tried can be set with the
1119 .Opt_long default\-modes
1120 option.
1122 Useful for restoring the default mode when a different mode was
1123 specified before.
1127 .Header_CB dvi
1128 Display formatted input in a
1129 .I \%dvi
1130 viewer program.
1132 By default, the formatted input is displayed with the
1133 .BR \%xdvi (1)
1134 program.
1135 .Opt_long dvi .
1139 .Header_CB groff
1140 After the file determination, switch
1141 .I \%groffer
1142 to process the input like
1143 .BR \%groff (@MAN1EXT@)
1144 would do.
1146 This disables the
1147 .I \%groffer
1148 viewing features.
1152 .Header_CB html
1153 Translate the input into html format and display the result in a web
1154 browser program.
1156 By default, the existence of a sequence of standard web browsers is
1157 tested, starting with
1158 .BR \%konqueror (1)
1160 .BR \%mozilla (1).
1161 The text html viewer is
1162 .BR \%lynx (1).
1166 .Header_CB pdf
1167 Display formatted input in a
1168 .I \%PDF
1169 (Portable Document Format) viewer
1170 program.
1172 By default, the input is formatted by groff using the Postscript
1173 device, then it is transformed into the PDF file format using
1174 .BR \%gs (1),
1175 and finally displayed either with the
1176 .BR \%xpdf (1)
1177 or the
1178 .BR \%acroread (1)
1179 program.
1181 PDF has a big advantage because the text is displayed graphically and
1182 is searchable as well.
1184 But as the transformation takes a considerable amount of time, this
1185 mode is not suitable as a default device for the auto mode.
1189 .Header_CB ps
1190 Display formatted input in a Postscript viewer program.
1192 By default, the formatted input is displayed with the
1193 .BR \%ghostview (@MAN1EXT@)
1194 program.
1198 .Header_CB text
1199 Format in a
1200 .I \%groff
1201 text mode and write the result to standard output without a pager or
1202 viewer program.
1204 The text device,
1205 .I \%latin1
1206 by default, can be chosen with option
1207 .Opt_short T .
1211 .Header_CB tty
1212 Format in a
1213 .I \%groff
1214 text mode and write the result to standard output using a text pager
1215 program, even when in X\~\%Window.
1219 .Header_CB www
1220 Equivalent to
1221 .Opt_long_arg mode html .
1225 .Header_CB X
1226 Display formatted input in a native roff viewer.
1228 By default, the formatted input is displayed with the
1229 .BR \%gxditview (@MAN1EXT@)
1230 program, being distributed together with groff, or with
1231 .BR \%xditview (1),
1232 which is distributed as a standard X tool.
1236 .Header_CB x
1237 Equivalent to
1238 .Opt_long_arg mode X .
1242 The following modes do not use the
1243 .I \%groffer
1244 viewing features.
1246 They are only interesting for advanced applications.
1250 .Header_CB groff
1251 Generate device output with plain
1252 .I \%groff
1253 without using the special viewing features of
1254 .IR \%groffer .
1255 If no device was specified by option
1256 .Opt_short T
1258 .I \%groff
1259 default
1260 .B \%ps
1261 is assumed.
1265 .Header_CB source
1266 Display the source code of the input without formatting; equivalent to
1267 .Opt_short Q .
1273 .Opt_def -- pdf
1274 Equivalent to
1275 .Opt_long_arg mode pdf .
1278 .Opt_def -- pdf-viewer prog
1279 Set the viewer program for
1280 .I \%pdf
1281 mode.
1283 This can be a file name or a program to be searched in
1284 .Env_var $PATH .
1286 In each case, arguments can be provided additionally.
1289 .Opt_def -- ps
1290 Equivalent to
1291 .Opt_long_arg mode ps .
1294 .Opt_def -- ps-viewer prog
1295 Set the viewer program for
1296 .I \%ps
1297 mode.
1299 This can be a file name or a program to be searched in
1300 .Env_var $PATH .
1302 Common Postscript viewers inlude
1303 .BR \%gv (1),
1304 .BR \%ghostview (1),
1306 .BR \%gs (1),
1308 In each case, arguments can be provided additionally.
1311 .Opt_def -- text
1312 Equivalent to
1313 .Opt_long_arg mode text .
1316 .Opt_def -- tty
1317 Equivalent to
1318 .Opt_long_arg mode tty .
1321 .Opt_def -- tty\-viewer
1322 Choose tty display mode, that means displaying in a text pager even
1323 when in X; eqivalent to
1324 .Opt_long_arg mode tty .
1327 .Opt_def -- www
1328 Equivalent to
1329 .Opt_long_arg mode html .
1332 .Opt_def -- www\-viewer prog
1333 Equivalent to
1334 .Opt_long html\-viewer .
1337 .Opt_def - X -- X -- x
1338 Equivalent to
1339 .Opt_long_arg mode X .
1342 .Opt_def -- X\-viewer -- x\-viewer prog
1343 Set the viewer program for
1344 .I x
1345 mode.
1347 Suitable viewer programs are
1348 .BR \%gxditview (@MAN1EXT@)
1350 .BR \%xditview (1).
1352 But the argument can be any executable file or a program in
1353 .Env_var $PATH .
1355 In each case, arguments can be provided additionally.
1359 .Opt_--
1360 Signals the end of option processing; all remaining arguments are
1361 interpreted as
1362 .I \%filespec
1363 parameters.
1367 Besides these,
1368 .I \%groffer
1369 accepts all arguments that are valid for the
1370 .BR \%groff (@MAN1EXT@)
1371 program.
1373 All non-groffer options are sent unmodified via
1374 .I \%grog
1376 .IR \%groff .
1378 Postprocessors, macro packages, compatibility with classical
1379 .IR \%troff ,
1380 and much more can be manually specified.
1383 .\" --------------------------------------------------------------------
1384 .SH "Options for Development"
1385 .\" --------------------------------------------------------------------
1387 .Opt_def -- debug
1388 Print debugging information for development only.
1390 Actually, a function call stack is printed if an error occurs.
1393 .Opt_def -- shell "shell_program"
1394 Specify the shell under which the groffer script should be run.
1396 The script first tests whether this option is set (either by
1397 configuration, within
1398 .Env_var $GROFF_OPT
1399 or as a command line option); if so, the script is rerun under the
1400 shell program specified with the option argument.
1403 .Opt_def - Q -- source
1404 Output the roff source code of the input files without further
1405 processing.
1407 This is the equivalent
1408 .Opt_long_arg mode source .
1412 Other useful debugging options are the
1413 .I \%groff
1414 options
1415 .Opt_short V
1417 .Opt_short Z
1418 and option
1419 .Opt_long_arg mode groff .
1422 .\" --------------------------------------------------------------------
1423 .SH "Options related to groff"
1424 .\" --------------------------------------------------------------------
1426 All short options of
1427 .I \%groffer
1428 are compatible with the short options of
1429 .BR \%groff (@MAN1EXT@).
1431 The following of
1432 .I \%groff
1433 options have either an additional special meaning within
1434 .I \%groffer
1435 or make sense for normal usage.
1439 Because of the special outputting behavior of the
1440 .I \%groff
1441 options
1442 .Opt_short V
1444 .Opt_short Z
1445 .I \%groffer
1446 was designed to be switched into
1447 .I \%groff
1448 mode by these; the
1449 .I \%groffer
1450 viewing features are disabled there.
1452 The other
1453 .I \%groff
1454 options do not switch the mode, but allow to customize the formatting
1455 process.
1458 .Opt_def - a
1459 This generates an ascii approximation of output in text modes.
1461 That could be important when the text pager has problems with control
1462 sequences.
1465 .Opt_def - m file
1467 .I \%file
1468 as a
1469 .I \%groff
1470 macro file.
1472 This is useful in case it cannot be recognized automatically.
1475 .Opt_def - P opt_or_arg
1476 Send the argument
1477 .I \%opt_or_arg
1478 as an option or option argument to the actual
1479 .I \%groff
1480 postprocessor.
1483 .Opt_def - T -- device devname
1485 This option determines
1486 .IR \%groff 's
1487 output device.
1489 The most important devices are the text output devices for referring
1490 to the different character sets, such as
1491 .BR \%ascii ,
1492 .BR \%utf8 ,
1493 .BR \%latin1 ,
1494 and others.
1496 Each of these arguments switches
1497 .I \%groffer
1498 into a text mode using this device, to
1499 .I mode \%tty
1500 if the actual mode is not a text mode.
1502 The following
1503 .I \%devname
1504 arguments are mapped to the corresponding
1505 .I \%groffer
1506 .Opt_long_arg mode \fIdevname\fR
1507 option:
1508 .BR \%dvi ,
1509 .BR \%html ,
1511 .BR \%ps .
1513 .B \%X*
1514 arguments are mapped to mode
1515 .BR \%X .
1516 Each other
1517 .I \%devname
1518 argument switches to
1519 .I mode \%groff
1520 using this device.
1523 .Opt_def - V
1524 Switch into
1525 .I \%groff
1526 mode and show only the
1527 .I \%groff
1528 calling pipe without formatting the input.
1530 This an advanced option from
1531 .BR \%groff (@MAN1EXT@) ,
1532 only useful for debugging.
1535 .Opt_def - X
1536 was made equivalent to
1537 .Opt_long_arg mode x ;
1538 this slightly enhances the facility of
1539 .IR \%groff 's
1540 option.
1543 .Opt_def - Z -- intermediate-output -- ditroff
1544 Switch into
1545 .I \%groff
1546 mode and format the input with
1547 .I \%groff
1548 intermediate output without postprocessing; see
1549 .BR \%groff_out (@MAN1EXT@).
1550 This is equivalent to option
1551 .Opt_long ditroff
1553 .IR \%man ,
1554 which can be used as well.
1558 All other
1559 .I \%groff
1560 options are supported by
1561 .IR \%groffer ,
1562 but they are just transparently transferred to
1563 .I \%groff
1564 without any intervention.
1566 The options that are not explicitly handled by
1567 .I \%groffer
1568 are transparently passed to
1569 .IR \%groff .
1571 Therefore these transparent options are not documented here, but in
1572 .BR \%groff (@MAN1EXT@).
1573 Due to the automatism in
1574 .IR \%groffer ,
1575 none of these
1576 .I \%groff
1577 options should be needed, except for advanced usage.
1580 .\" --------------------------------------------------------------------
1581 .SS "X Window toolkit Options"
1582 .\" --------------------------------------------------------------------
1584 The following long options were adapted from the corresponding X
1585 Toolkit options.
1587 .I \%groffer
1588 will pass them to the actual viewer program if it is an X Window
1589 program.
1591 Otherwise these options are ignored.
1595 Unfortunately these options use the old style of a single minus for
1596 long options.
1599 .I \%groffer
1600 that was changed to the standard with using a double minus for long
1601 options, for example,
1602 .I \%groffer
1603 uses the option
1604 .Opt_long font
1605 for the
1606 .I X
1607 option
1608 .Opt_short font .
1613 .BR \%X (1),
1614 .BR \%X (7),
1615 and the documentation on the X toolkit options for more details on
1616 these options and their arguments.
1619 .Opt_def -- background color
1620 Set the background color of the viewer window.
1623 .Opt_def -- bd pixels
1624 Specifies the color of the border surrounding the viewer window.
1627 .Opt_def -- bg color
1628 This is equivalent to
1629 .Opt_long background .
1632 .Opt_def -- bw pixels
1633 Specifies the width in pixels of the border surrounding the viewer
1634 window.
1637 .Opt_def -- display X-display
1638 Set the X display on which the viewer program shall be started, see the
1639 .I X\~\%Window
1640 documentation for the syntax of the argument.
1643 .Opt_def -- foreground color
1644 Set the foreground color of the viewer window.
1647 .Opt_def -- fg color
1648 This is equivalent to
1649 .Opt_short foreground .
1652 .Opt_def -- font font_name
1653 Set the font used by the viewer window.
1655 The argument is an X font name.
1658 .Opt_def -- ft font_name
1659 This is equivalent to
1660 .Opt_long ft .
1663 .Opt_def -- geometry size_pos
1664 Set the geometry of the display window, that means its size and its
1665 starting position.
1668 .BR \%X (7)
1669 for the syntax of the argument.
1672 .Opt_def -- resolution value
1673 Set X resolution in dpi (dots per inch) in some viewer programs.
1675 The only supported dpi values are
1676 .B 75
1678 .BR 100 .
1680 Actually, the default resolution for
1681 .I \%groffer
1682 is set to
1683 .BR 75 .
1686 .Opt_def -- rv
1687 Reverse foreground and background color of the viewer window.
1690 .Opt_def -- title "'some text'"
1691 Set the title for the viewer window.
1694 .Opt_def -- xrm "'resource'"
1695 Set X resource.
1698 .\" --------------------------------------------------------------------
1699 .SS "Options for man"
1700 .\" --------------------------------------------------------------------
1702 The long options of
1703 .I \%groffer
1704 were synchronized with the long options of
1705 .IR GNU man .
1707 All long options of
1708 .I GNU man
1709 are recognized, but not all of these options are important to
1710 .IR \%groffer ,
1711 so most of them are just ignored.
1715 The following two options were added to
1716 .I \%groffer
1717 for choosing whether the file name arguments are interpreted as names
1718 for local files or as a search pattern for man pages.
1720 The default is looking up for local files.
1723 .Opt_def -- man
1724 Check the non-option command line arguments
1726 .RI ( filespecs )
1728 first on being man\~pages, then whether they represent an existing
1729 file.
1731 By default, a
1732 .I \%filespec
1733 is first tested whether it is an existing file.
1736 .Opt_def -- no-man -- local-file
1737 Do not check for man\~pages.
1739 .Opt_long local-file
1740 is the corresponding
1741 .I man
1742 option.
1746 In the following, the
1747 .I man
1748 options that have a special meaning for
1749 .I \%groffer
1750 are documented.
1754 The full set of long and short options of the
1755 .I GNU man
1756 program can be passed via the environment variable
1757 .Env_var $MANOPT ;
1759 .BR \%man (1)
1760 if your system has
1761 .I GNU man
1762 installed.
1765 .Opt_def -- all
1766 In searching man\~pages, retrieve all suitable documents instead of
1767 only one.
1770 .Opt_def - 7 -- ascii
1771 In text modes, display ASCII translation of special characters.
1774 .Opt_def -- ditroff
1775 Eqivalent to
1776 .I \%groffer
1777 .Opt_short Z .
1780 .Opt_def -- extension suffix
1781 Restrict man\~page search to file names that have
1782 .I \%suffix
1783 appended to their section element.
1785 For example, in the file name
1786 .I \%/usr/share/man/man3/terminfo.3ncurses.gz
1787 the man\~page extension is
1788 .IR \%ncurses .
1791 .Opt_def -- locale language
1793 Set the language for man pages.
1795 This has the same effect, but overwrites
1796 .Env_var $LANG
1799 .Opt_def -- location
1800 Print the location of the retrieved files to standard error.
1803 .Opt_def -- no-location
1804 Do not display the location of retrieved files; this resets a former
1805 call to
1806 .Opt_long location .
1808 This was added by
1809 .IR \%groffer .
1812 .Opt_def -- manpath "'dir1:dir2:\*[Ellipsis]'"
1813 Use the specified search path for retrieving man\~pages instead of the
1814 program defaults.
1816 If the argument is set to the empty string "" the search for man\~page
1817 is disabled.
1820 .Opt_def -- pager
1821 Set the pager program in tty mode; default is
1822 .IR \%less .
1823 This is equivalent to
1824 .Opt_long tty-viewer .
1827 .Opt_def -- sections "'sec1:sec2:\*[Ellipsis]'"
1828 Restrict searching for man\~pages to the given
1829 .IR sections ,
1830 a colon-separated list.
1833 .Opt_def -- systems "'sys1,sys2,\*[Ellipsis]'"
1834 Search for man pages for the given operating systems; the argument
1835 .I \%systems
1836 is a comma-separated list.
1839 .Opt_def -- whatis
1840 Instead of displaying the content, get the one-liner description from
1841 the retrieved man\~page files \[em] or say that it is not a man\~page.
1844 .Opt_def -- where
1845 Eqivalent to
1846 .Opt_long location .
1850 Additionally, the following short option of
1851 .I \%man
1852 is supported as well.
1855 .\" --------------------------------------------------------------------
1856 .SS "Filespec Arguments"
1857 .\" --------------------------------------------------------------------
1860 .I \%filespec
1861 parameter is an argument meaning an input source, such as a file name
1862 or template for searching man\~pages.
1864 These input sources are collected and composed into a single output
1865 file such as
1866 .I \%groff
1867 does.
1871 The strange POSIX behavior that maps all arguments behind the first
1872 non-option argument into
1873 .I \%filespec
1874 arguments is ignored.
1876 The GNU behavior to recognize options even when mixed with
1877 .I \%filespec
1878 arguments is used througout.
1880 But, as usual, the double minus argument
1881 .Opt_long
1882 still takes all following arguments as
1883 .I \%filespec
1884 arguments.
1888 Each
1889 .I \%filespec
1890 parameters can have one of the following forms.
1895 .I \%filespec
1896 parameters means that
1897 .I \%groffer
1898 waits for standard input.
1900 The minus option
1901 .Opt_short ""
1902 stands for standard input, too, but can occur several times.
1904 Next
1905 .I \%filespec
1906 is tested whether it is the path name of an existing file.
1908 Otherwise it is assumed as a searching pattern for a man\~page.
1912 On each system, the man pages are sorted according to their content
1913 into several sections.
1916 .I classical man sections
1917 have a single-character name, either are a digit from
1918 .B 1
1920 .B 9
1921 or one of the characters
1922 .B n
1924 .BR o .
1926 In the following, a stand-alone character
1927 .I s
1928 means this scheme.
1932 The internal precedence of
1933 .I \%man
1934 for searching man pages with the same name within several sections
1935 goes according to the classical single-character sequence.
1937 On some systems, this single character can be extended by a following
1938 string.
1940 But the special
1941 .I \%groffer
1942 man\~page facility is based on the classical single character sections.
1946 .BI \%man: name ( section )
1948 .IB \%name ( section )
1949 search the man\~page
1950 .I \%name
1951 in man\~section\~\c
1952 .IR \%section ,
1953 where
1954 .I \%section
1955 can be any string, but it must exist in the
1956 .I \%man
1957 system.
1961 Next some patterns based on the
1962 .I classical man sections
1963 were constructed.
1965 .BI \%man: name . s
1967 .IB \%name . s
1968 search for a man\~page
1969 .I \%name
1970 in man\~section
1971 .I s
1973 .I s
1974 is a
1975 .I classical man section
1976 mentioned above.
1978 Otherwise search for a man\~page named
1979 .IR \%name.s
1980 in the lowest
1981 .I man\~\c
1982 .IR section .
1987 .BI \%man: name
1988 searches for a man\~page in the lowest man\~section that has a
1989 document called
1990 .IR \%name .
1994 The pattern
1995 .I \%s\~name
1996 originates from a strange argument parsing of the
1997 .I man
1998 program.
2001 .I s
2002 is a
2003 .I classical man section
2004 interpret it as a search for a man\~page called
2005 .I \%name
2006 in man\~section
2007 .IR s ,
2008 otherwise interpret
2009 .I s
2010 as a file argument and
2011 .I \%name
2012 as another
2013 .I \%filespec
2014 argument.
2018 We are left with the argument
2019 .I \%name
2020 which is not an existing file.
2022 So this searches for the man\~page called
2023 .I \%name
2024 in the lowest man\~section that has a document for this name.
2028 Several file name arguments can be supplied.
2030 They are mixed by
2031 .I \%groff
2032 into a single document.
2034 Note that the set of option arguments must fit to all of these file
2035 arguments.
2037 So they should have at least the same style of the
2038 .I \%groff
2039 language.
2042 .\" --------------------------------------------------------------------
2043 .SH "OUTPUT MODES"
2044 .\" --------------------------------------------------------------------
2046 By default, the
2047 .I \%groffer
2048 program collects all input into a single file, formats it with the
2049 .I \%groff
2050 program for a certain device, and then chooses a suitable viewer
2051 program.
2053 The device and viewer process in
2054 .I \%groffer
2055 is called a
2056 .IR \%mode .
2058 The mode and viewer of a running
2059 .I \%groffer
2060 program is selected automatically, but the user can also choose it
2061 with options.
2064 The modes are selected by option the arguments of
2065 .Opt_long_arg mode \fIanymode .
2066 Additionally, each of this argument can be specified as an option of
2067 its own, such as
2068 .Opt_long \fIanymode .
2069 Most of these modes have a viewer program, which can be chosen by an
2070 option that is constructed like
2071 .Opt_long \fIanymode\fR-viewer .
2075 Several different modes are offered, graphical X modes, text modes,
2076 and some direct
2077 .I \%groff
2078 modes for debugging and development.
2082 By default,
2083 .I \%groffer
2084 first tries whether
2085 .B x
2086 mode is possible, then
2087 .B \%ps
2088 mode, and finally
2089 .B \%tty
2090 mode.
2092 This mode testing sequence for
2093 .B \%auto
2094 mode can be changed by specifying a comma separated list of modes
2095 with the option
2096 .Opt_long default\-modes.
2100 The searching for man\~pages and the decompression of the input are
2101 active in every mode.
2104 .\" --------------------------------------------------------------------
2105 .SS "Graphical Display Modes"
2106 .\" --------------------------------------------------------------------
2108 The graphical display modes work only in the
2109 .I X\~Window environment
2110 (or similar implementations within other windowing environments).
2112 The environment variable
2113 .Env_var $DISPLAY
2114 and the option
2115 .Opt_long display
2116 are used for specifying the X display to be used.
2118 If neither is given,
2119 .I \%groffer
2120 assumes that no X and changes to one text mode.
2122 You can change this automatic behavior by the option
2123 .Opt_long default\-modes .
2127 Known viewers for the graphical display modes and their standard X
2128 Window viewer progams are
2130 .Topic
2131 X Window roff viewers such as
2132 .BR \%gxditview (@MAN1EXT@)
2134 .BR \%xditview (1)
2136 .I x
2138 .I X
2139 mode),
2141 .Topic
2142 in a Postscript viewer
2144 .RI ( ps
2145 mode),
2148 .Topic
2149 in a dvi viewer program
2151 .RI ( dvi
2152 mode),
2155 .Topic
2156 in a PDF viewer
2158 .RI ( pdf
2159 mode),
2162 .Topic
2163 in a web browser
2165 .RI ( html
2167 .I www
2168 mode),
2175 .I \%pdf
2176 mode has a major advantage \[em] it is the only graphical diplay mode
2177 that allows to search for text within the viewer; this can be a really
2178 important feature.
2180 Unfortunately, it takes some time to transform the input into the PDF
2181 format, so it was not chosen as the major mode.
2185 These graphical viewers can be customized by options of the X Window
2186 Toolkit.
2188 But the
2189 .I \%groffer
2190 options use a leading double minus instead of the single minus used by
2192 .I X\~Window\~\c
2193 .IR Toolkit .
2196 .\" --------------------------------------------------------------------
2197 .SS "Text mode"
2198 .\" --------------------------------------------------------------------
2200 There are to modes for text output, mode
2201 .I \%text
2202 for plain output without a pager and mode
2203 .I \%tty
2204 for a text output on a text terminal using some pager program.
2208 If the variable
2209 .Env_var $DISPLAY
2210 is not set or empty, groffer assumes that it should use
2211 .I \%tty
2212 mode.
2216 In the actual implementation, the groff output device
2217 .I \%latin1
2218 is chosen for text modes.
2220 This can be changed by specifying option
2221 .Opt_short T
2223 .Opt_long device .
2227 The pager to be used can be specified by one of the options
2228 .Opt_long pager
2230 .Opt_long tty-viewer ,
2231 or by the environment variable
2232 .Env_var $PAGER .
2233 If all of this is not used the
2234 .BR \%less (1)
2235 program with the option
2236 .Opt_short r
2237 for correctly displaying control sequences is used as the default
2238 pager.
2241 .\" --------------------------------------------------------------------
2242 .SS "Special Modes for Debugging and Development"
2243 .\" --------------------------------------------------------------------
2245 These modes use the
2246 .I \%groffer
2247 file determination and decompression.
2249 This is combined into a single input file that is fed directly into
2250 .I \%groff
2251 with different strategy without the
2252 .I \%groffer
2253 viewing facilities.
2255 These modes are regarded as advanced, they are useful for debugging
2256 and development purposes.
2261 .I \%source
2262 mode with just displays the generated input.
2265 .I \%groff
2266 mode passes the input to
2267 .I \%groff
2268 using only some suitable options provided to
2269 .IR \%groffer .
2271 This enables the user to save the generated output into a file or pipe
2272 it into another program.
2277 .I \%groff
2278 mode, the option
2279 .Opt_short Z
2280 disables post-processing, thus producing the
2282 .I groff intermediate
2283 .IR output .
2286 In this mode, the input is formatted, but not postprocessed; see
2287 .BR \%groff_out (@MAN5EXT@)
2288 for details.
2293 .I \%groff
2294 short options are supported by
2295 .IR \%groffer .
2298 .\" --------------------------------------------------------------------
2299 .SH "MAN\~PAGE\~SEARCHING"
2300 .\" --------------------------------------------------------------------
2302 The default behavior of groffer is to first test whether a file
2303 parameter represents a local file; if it is not an existing file name,
2304 it is assumed to represent a name of a man\~page.
2306 This behavior can be modified by the following options.
2310 .Opt_long man
2311 forces to interpret all file parameters as filespecs for searching
2312 man\~pages.
2315 .Opt_long no\-man
2316 .TP+
2317 .Opt_long local\-file
2318 disable the man searching; so only local files are displayed.
2322 If neither a local file nor a man\~page was retrieved for some file
2323 parameter a warning is issued on standard error, but processing is
2324 continued.
2328 The groffer program provides a search facility for man\~pages.
2330 All long options, all environment variables, and most of the
2331 functionality of the GNU
2332 .BR \%man (1)
2333 program were implemented.
2335 This inludes the extended file names of man\~pages, for example,
2336 the man\~page of
2337 .I \%groff
2338 in man\~section 7 may be stored under
2339 .File_name /usr/share/man/man7/groff.7.gz ,
2340 where
2341 .File_name /usr/share/man/
2342 is part of the man\~path, the subdirectory
2343 .I \%man7
2344 and the file extension
2345 .I .7
2346 refer to the man\~section 7;
2347 .I \%.gz
2348 shows the compression of the file.
2353 .I cat\~pages
2354 (preformatted man\~pages) are intentionally excluded from the search
2355 because groffer is a roff program that wants to format by its own.
2357 With the excellent performance of the actual computers, the
2358 preformatted man\~pages aren't necessary any longer.
2362 The algorithm for retrieving man\~pages uses five search methods.
2364 They are successively tried until a method works.
2367 .Topic
2368 The search path can be manually specified by using the option
2369 .Opt_long manpath .
2370 An empty argument disables the man\~page searching.
2372 This overwrites the other methods.
2375 .Topic
2376 If this is not available the environment variable
2377 .Env_var $MANPATH
2378 is searched.
2381 .Topic
2382 If this is empty, the program tries to read it from the environment
2383 variable
2384 .Env_var $MANOPT .
2387 .Topic
2388 If this does not work a reasonable default path from
2389 .Env_var $PATH
2390 is searched for man\~pages.
2393 .Topic
2394 If this does not work, the
2395 .BR \%manpath (1)
2396 program for determining a path of man directories is tried.
2400 After this, the path elements for the language (locale) and operating
2401 system specific man\~pages are added to the man\~path; their sequence
2402 is determined automatically.
2404 For example, both
2405 .File_name /usr/share/man/linux/fr
2407 .File_name /usr/share/man/fr/linux
2408 for french linux man\~pages are found.
2410 The language and operating system names are determined from both
2411 environment variables and command line options.
2415 The locale (language) is determined like in GNU man, that is from
2416 highest to lowest precedence:
2417 .Topic
2418 .Opt_long locale
2420 .Topic
2421 .Env_var $GROFFER_OPT
2423 .Topic
2424 .Env_var $MANOPT
2426 .Topic
2427 .Env_var $LCALL
2429 .Topic
2430 .Env_var $LC_MESSAGES
2432 .Topic
2433 .Env_var $LANG .
2437 The language locale is usually specified in the POSIX 1003.1 based
2438 format:
2441 \f[I]<language>\f[][\f[CB]_\f[]\f[I]<territory>\f[][\f[CB].\f[]\
2442 \f[I]<character-set>\f[][\f[CB],\f[]\f[I]<version>\f[]]]],
2445 but the two-letter code in
2447 .I <language>
2449 is sufficient for most purposes.
2453 If no man\~pages for a complicated locale are found the country part
2454 consisting of the first two characters (without the `\f[CB]_\f[]',
2455 `\f[CB].\f[]', and `\f[CB],\f[]' parts) of the locale is searched as
2456 well.
2460 If still not found the corresponding man\~page in the default language
2461 is used instead.
2463 As usual, this default can be specified by one of \f[CR]C\f[] or
2464 \f[CR]POSIX\f[].
2466 The man\~pages in the default language are usually in English.
2470 Several operating systems can be given by appending their names,
2471 separated by a comma.
2473 This is then specified by the environment variable
2474 .Env_var $SYSTEM
2475 or by the command line option
2476 .Opt_long systems .
2477 The precedence is similar to the locale case above from highest to
2478 lowest precedence:
2480 Topic
2481 .Opt_long systems
2483 .Topic
2484 .Env_var $GROFFER_OPT
2486 .Topic
2487 .Env_var $MANOPT
2489 .Topic
2490 .Env_var $SYSTEM .
2494 When searching for man\~pages this man\~path with the additional
2495 language and system specific directories is used.
2499 The search can further be restricted by limiting it to certain
2500 sections.
2502 A single section can be specified within each filespec argument,
2503 several sections as a colon-separated list in command line option
2504 .Opt_long sections
2505 or environment variable
2506 .Env_var $MANSECT .
2508 When no section was specified a set of standard sections is searched
2509 until a suitable man\~page was found.
2513 Finally, the search can be restricted to a so-called
2514 .IR extension .
2515 This is a postfix that acts like a subsection.
2517 It can be specified by
2518 .Opt_long extension
2519 or environment variable
2520 .Env_var $EXTENSION .
2524 For further details on man\~page searching, see
2525 .BR \%man (1).
2528 .\" --------------------------------------------------------------------
2529 .SH DECOMPRESSION
2530 .\" --------------------------------------------------------------------
2532 The program has a decompression facility.
2534 If standard input or a file that was retrieved from the command line
2535 parameters is compressed with a format that is supported by either
2536 .BR \%gzip (1)
2538 .BR \%bzip2 (1)
2539 it is decompressed on-the-fly.
2541 This includes the GNU
2542 .BR \%.gz ,
2543 .BR \%.bz2 ,
2544 and the traditional
2545 .B \%.Z
2546 compression.
2548 The program displays the concatenation of all decompressed input in
2549 the sequence that was specified on the command line.
2552 .\" --------------------------------------------------------------------
2553 .SH "ENVIRONMENT"
2554 .\" --------------------------------------------------------------------
2556 The groffer programs supports many system variables, most of them by
2557 courtesy of other programs.
2559 All environment variables of
2560 .BR \%groff (@MAN1EXT@)
2561 and GNU
2562 .BR \%man (1)
2563 and some standard system variables are honored.
2566 .\" --------------------------------------------------------------------
2567 .SS "Native groffer Variables"
2568 .\" --------------------------------------------------------------------
2571 .Env_var $GROFFER_OPT
2572 Store options for a run of groffer.
2574 The options specified in this variable are overridden by the options
2575 given on the command line.
2577 The content of this variable is run through the shell builtin `eval';
2578 so arguments containing white-space or special shell characters should
2579 be quoted.
2582 .\" --------------------------------------------------------------------
2583 .SS "System Variables"
2584 .\" --------------------------------------------------------------------
2586 The groffer program is a shell script that is run through
2587 .File_name /bin/sh ,
2588 which can be internally linked to programs like
2589 .BR \%bash (1).
2590 The corresponding system environment is automatically effective.
2592 The following variables have a special meaning for groffer.
2596 .Env_var $DISPLAY
2597 If this variable is set this indicates that the X Window system is
2598 running.
2600 Testing this variable decides on whether graphical or text output is
2601 generated.
2603 This variable should not be changed by the user carelessly, but it can
2604 be used to start the graphical groffer on a remote X terminal.
2606 For example, depending on your system, groffer can be started on the
2607 second monitor by the command
2608 .Shell_cmd DISPLAY=:0.1\~groffer\~ what.ever &
2612 .Env_var $LC_ALL
2613 .TP+
2614 .Env_var $LC_MESSAGES
2615 .TP+
2616 .Env_var $LANG
2617 If one of these variables is set (in the above sequence), its content
2618 is interpreted as the locale, the language to be used, especially when
2619 retrieving man\~pages.
2621 A locale name is typically of the form
2623 .IR language [\c
2624 .B _\c
2625 .IR territory [\c
2626 .B .\c
2627 .IR codeset [\c
2628 .B @\c
2629 .IR modifier ]]],
2631 where
2632 .I \%language
2633 is an ISO 639 language code,
2634 .I \%territory
2635 is an ISO 3166 country code, and
2636 .I \%codeset
2637 is a character set or encoding identifier like ISO-8859-1 or UTF-8;
2639 .BR \%setlocale (3).
2641 The locale values\~\c
2642 .B C
2644 .B \%POSIX
2645 stand for the default, i.e. the man\~page directories without a
2646 language prefix.
2648 This is the same behavior as when all 3\~variables are unset.
2652 .Env_var $PAGER
2653 This variable can be used to set the pager for the tty output.
2655 For example, to disable the use of a pager completely set this
2656 variable to the
2657 .BR \%cat (1)
2658 program
2659 .Shell_cmd PAGER=cat\~groffer\~ anything
2663 .Env_var $PATH
2664 All programs within the groffer shell script are called without a
2665 fixed path.
2667 Thus this environment variable determines the set of programs used
2668 within the run of groffer.
2672 .Env_var $POSIXLY_CORRECT
2673 If set to a non-empty value this chooses the POSIX mode.
2675 This is done internally by some shells.
2677 .I \%groffer
2678 ignores the bad POSIX behavior for option processing, that means that
2679 option processing will be finished as soon as a non-option argument is
2680 found.
2682 Instead the GNU behavior of freely mixing options and
2683 .I \%filespec
2684 arguments is used in any case.
2686 Usually, you do not want to set this environment variable externally.
2689 .\" --------------------------------------------------------------------
2690 .SS "Groff Variables"
2691 .\" --------------------------------------------------------------------
2693 The groffer program internally calls groff, so all environment
2694 variables documented in
2695 .BR \%groff (@MAN1EXT@)
2696 are internally used within groffer as well.
2698 The following variables have a direct meaning for the groffer program.
2701 .Env_var $GROFF_TMPDIR
2702 If the value of this variable is an existing, writable directory,
2703 .I \%groffer
2704 uses it for storing its temporary files, just as groff does.
2707 .\" --------------------------------------------------------------------
2708 .SS "Man Variables"
2709 .\" --------------------------------------------------------------------
2711 Parts of the functionality of the man\~program were implemented in
2712 groffer; support for all environment variables documented in
2713 .BR \%man (1)
2714 was added to groffer, but the meaning was slightly modified due to the
2715 different approach in groffer; but the user interface is the same.
2717 The man environment variables can be overwritten by options provided
2718 with
2719 .Env_var $MANOPT ,
2720 which in turn is overwritten by the command line.
2724 .Env_var $EXTENSION
2725 Restrict the search for man\~pages to files having this extension.
2727 This is overridden by option
2728 .Opt_long extension ;
2729 see there for details.
2733 .Env_var $MANOPT
2734 This variable contains options as a preset for
2735 .BR \%man (1).
2736 As not all of these are relevant for groffer only the essential parts
2737 of its value are extracted.
2739 The options specified in this variable overwrite the values of the
2740 other environment variables taht are specific to man.
2742 All options specified in this variable are overridden by the options
2743 given on the command line.
2747 .Env_var $MANPATH
2748 If set, this variable contains the directories in which the man\~page
2749 trees are stored.
2751 This is overridden by option
2752 .Opt_long manpath .
2756 .Env_var $MANSECT
2757 If this is a colon separated list of section names, the search for
2758 man\~pages is restricted to those manual sections in that order.
2760 This is overridden by option
2761 .Opt_long sections .
2765 .Env_var $SYSTEM
2766 If this is set to a comma separated list of names these are interpreted
2767 as man\~page trees for different operating systems.
2769 This variable can be overwritten by option
2770 .Opt_long systems ;
2771 see there for details.
2775 The environment variable
2776 .Env_var $MANROFFSEQ
2777 is ignored by groffer because the necessary preprocessors are
2778 determined automatically.
2781 .\" --------------------------------------------------------------------
2782 .SH "CONFIGURATION FILES"
2783 .\" --------------------------------------------------------------------
2786 .I \%groffer
2787 program can be preconfigured by two configuration files.
2789 This configuration can be overridden at each program start by command
2790 line options or by the environment variable
2791 .Env_var $GROFFER_OPT .
2795 .File_name /etc/groff/groffer.conf
2796 System-wide configuration file for groffer.
2800 .File_name $HOME/.groff/groffer.conf
2801 User-specific configuration file for groffer, where
2802 .Env_var $HOME
2803 denotes the user's home directory.
2805 This script is called after the system-wide configuration file to
2806 enable overriding by the user.
2810 Their lines either start with a minus character or are shell commands.
2812 Arbitrary spaces are allowed at the beginning, they are just ignored.
2814 The lines with the beginning minus are appended to the existing value
2815 of $GROFFER_OPT.
2817 This easily allows to set general
2818 .I \%groffer
2819 options that are used with any call of
2820 .IR \%groffer .
2824 After the transformation of the minus lines, the emerging
2825 configuration shell scripts are called using the `\c
2827 .CB \.\~\c
2828 .IR filename '
2830 shell syntax within
2831 .IR \%groffer .
2835 In the configuration files, there is only one option that really needs
2836 a line starting with a minus character because it cannot be restored
2837 by any shell tricks.
2839 This is
2840 .Opt_long shell .
2841 The reason is that its argument must be retrieved at a very early
2842 stage of
2843 .IR \%groffer .
2847 It makes sense to use these configuration files for the following
2848 tasks:
2850 .Topic
2851 Preset command line options by writing them into lines starting with a
2852 minus sign.
2854 .Topic
2855 Preset environment variables recognized by
2856 .IR \%groffer .
2858 .Topic
2859 Write a function for calling a viewer program for a special
2860 .I \%mode
2861 and feed this name into its corresponding
2862 .Opt_long \f[I]mode\f[]\-viewer
2863 option.
2865 Note that the name of such a function must coincide with some existing
2866 program in the system path
2867 .Env_var $PATH
2868 in order to be recognized by groffer.
2872 As an example, consider the following configuration file in
2873 .File_name ~/.groff/groffer.conf ,
2874 say.
2877 .ft CR
2880 # groffer configuration file
2882 # groffer options that are used in each call of groffer
2883 --shell=/bin/bash
2884 --resolution=100
2885 --foreground=DarkBlue
2886 --x-viewer='gxditview -geometry 850x800'
2888 # some shell commands
2889 if test "$DISPLAY" = ""; then
2890   export DISPLAY='localhost:0.0'
2892 date >>~/mygroffer.log
2899 This configuration sets four
2900 .I \%groffer
2901 options (the lines starting with `-') and runs two shell commands (the
2902 rest of the script).
2904 This has the following effects:
2907 .Topic
2909 .B /bin/bash
2910 as the shell to run the
2911 .I \%groffer
2912 script.
2915 .Topic
2916 Use a resolution of
2917 .B 100\~dpi
2918 in all viewers that support this.
2921 .Topic
2922 Use a text color of
2923 .B \%DarkBlue
2924 in all viewers that support this.
2927 .Topic
2928 Force
2929 .BR \%gxditview (@MAN1EXT@)
2930 as the X-mode viewer using the geometry option for setting the width
2932 .B 850\~dpi
2933 and the height to
2934 .B 800\~\c
2935 .BR dpi .
2938 .Topic
2939 If the environment variable
2940 .Env_var $DISPLAY
2941 is empty set it to
2942 .IR localhost:0.0 .
2944 That allows to start
2945 .I \%groffer
2946 in the standard X\~display, even when the program is called from a text
2947 console.
2950 .Topic
2951 Just for fun, the date of each
2952 .I \%groffer
2953 start is written to the file
2954 .File_name mygroffer.log
2955 in the home directory.
2958 .\" --------------------------------------------------------------------
2959 .SH "EXAMPLES"
2960 .\" --------------------------------------------------------------------
2962 The usage of
2963 .I \%groffer
2964 is very easy.
2966 Usually, it is just called with a file name or man\~page.
2968 The following examples, however, show that groffer has much more fancy
2969 capabilities.
2973 .Shell_cmd "groffer\~/usr/local/share/doc/groff/meintro.ms.gz"
2974 Decompress, format and display the compressed file
2975 .File_name meintro.ms.gz
2976 in the directory
2977 .File_name /usr/local/share/doc/groff ,
2978 using
2979 .I \%gxditview
2980 as graphical viewer when in X Window, or the
2981 .BR \%less (1)
2982 pager program when not in X.
2986 .Shell_cmd "groffer\~groff"
2987 If the file
2988 .I \%./groff
2989 exists use it as input.
2991 Otherwise interpret the argument as a search for the man\~page named
2992 .I \%groff
2993 in the smallest possible man\~section, being section 1 in this case.
2997 .Shell_cmd "groffer\~man:groff"
2998 search for the man\~page of
2999 .I \%groff
3000 even when the file
3001 .File_name ./groff
3002 exists.
3006 .Shell_cmd "groffer\~groff.7"
3007 .TP+
3008 .Shell_cmd "groffer\~7\~groff"
3009 search the man\~page of
3010 .I \%groff
3011 in man\~section
3012 .BR 7 .
3013 This section search works only for a digit or a single character from
3014 a small set.
3018 .Shell_cmd "groffer\~fb.modes"
3019 If the file
3020 .File_name ./fb.modes
3021 does not exist interpret this as a search for the man\~page of
3022 .IR fb.modes .
3023 As the extension
3024 .I \%modes
3025 is not a single character in classical section style the argument is
3026 not split to a search for
3027 .IR fb .
3031 .Shell_cmd "groffer\~groff\~\[cq]troff(1)\[cq]\~man:roff"
3033 The arguments that are not existing files are looked-up as the
3034 following man\~pages:
3035 .I \%groff
3036 (automatic search, should be found in man\~section\~1),
3037 .I \%troff
3038 (in section\~1),
3040 .I \%roff
3041 (in the section with the lowest number, being\~7 in this case).
3043 The quotes around
3045 .I \[cq]troff(1)\[cq]
3047 are necessary because the paranthesis are special shell characters;
3048 escaping them with a backslash character
3049 .I \[rs](
3051 .I \[rs])
3052 would be possible, too.
3054 The formatted files are concatenated and displayed in one piece.
3058 .Shell_cmd "LANG=de\~groffer\~--man\~--www\~--www-viever=mozilla\~ls"
3060 Retrieve the German man\~page (language
3061 .IR de )
3062 for the
3063 .B ls
3064 program, decompress it, format it to
3065 .I \%html
3066 format
3068 .RI ( www
3069 mode)
3071 and view the result in the web browser
3072 .IR \%galeon .
3073 The option
3074 .Opt_long man
3075 guarantees that the man\~page is retrieved, even when a local file
3076 .I \%ls
3077 exists in the actual directory.
3081 .Shell_cmd "groffer\~--source\~'man:roff(7)'"
3083 Get the man\~page called
3084 .I \%roff
3085 in man\~section 7, decompress it, and print its unformatted content,
3086 its source code.
3090 .Shell_cmd "cat\~file.gz\~|\~groffer\~-Z\~-mfoo"
3092 Decompress the standard input, send this to
3093 .I \%groff
3094 intermediate mode without post-processing (groff option
3095 .Opt_short Z ),
3096 using macro package by
3097 .I \%foo
3098 (groff option
3099 .Opt_short m ) .
3103 .Shell_cmd "echo\~'\[rs]f[CB]WOW!'\~|"
3104 .TP+
3105 .Shell_cmd+ "groffer --x --bg red --fg yellow --geometry 200x100 -"
3107 Display the word \f[CB]WOW!\f[] in a small window in constant-width
3108 bold font, using color yellow on red background.
3111 .\" --------------------------------------------------------------------
3112 .SH "COMPATIBILITY"
3113 .\" --------------------------------------------------------------------
3116 .B \%groffer
3117 shell script is compatible with both GNU and POSIX.
3119 POSIX compatibility refers to
3120 .B IEEE P1003.2/D11.2
3121 of September 1991, a very early version of the POSIX standard that is
3122 still freely available in the internet at
3123 .URL http://\:www.funet.fi/pub/doc/posix/p1003.2/d11.2/all \
3124 "POSIX P1003.2 draft 11.2" .
3126 Unfortunately, this version of the standard removed `local' for shell
3127 function variables, but later POSIX versions restored this again.
3129 As `local' is needed for serious programming this temporary POSIX
3130 deprecation was ignored.
3134 Most GNU shells are compatible with this interpretation of POSIX, but
3135 provide much more facilities.
3137 Nevertheless this script uses only a restricted set of shell language
3138 elements and shell builtins.
3141 .I \%groffer
3142 script should work on most actual free and commercial operating
3143 systems.
3148 .I \%groffer
3149 program provides its own parser for command line options; it can
3150 handle option arguments and file names containing white space and a
3151 large set of special characters.
3156 .I \%groffer
3157 shell script was tested with the following common implementations of
3158 the GNU shells:
3159 .I \%POSIX
3160 .BR \%sh (1),
3161 .BR \%bash (1),
3162 and others.
3164 Free
3165 .I \%POSIX
3166 compatible shells and shell utilities for most operating
3167 systems are available at the
3168 .URL http://\:www.gnu.org/software/ "GNU software archive" .
3172 The shell can be chosen by the option
3173 .Opt_long shell .
3174 This option can also be given to the environment variable
3175 .Env_var $GROFF_OPT .
3176 If you want to write it to one of the
3177 .I \%groffer
3178 configuration files you must use the single option style, a line
3179 starting with
3180 .Opt_long shell .
3185 .I \%groffer
3186 program provides its own parser for command line arguments that is
3187 compatible to both
3188 .I \%POSIX
3189 .BR \%getopts (1)
3191 .I \%GNU
3192 .BR \%getopt (1)
3193 except for shortcuts of long options.
3195 The following standard types of options are supported.
3198 .Topic
3199 A single minus always refers to single character option or a
3200 combination thereof, for example, the
3201 .I \%groffer
3202 short option combination
3203 .Opt_short Qmfoo
3204 is equivalent to
3205 .Opt_short Q\~\-m\~foo .
3208 .Topic
3209 Long options are options with names longer than one character; they
3210 are always prededed by a double minus.
3212 An option argument can either go to the next command line argument or
3213 be appended with an equal sign to the argument; for example,
3214 .Opt_alt -- long=arg
3215 is equivalent to
3216 .Opt_alt -- long\~arg .
3219 .Topic
3220 An argument of
3221 .Opt_--
3222 ends option parsing; all further command line arguments are
3223 interpreted as file name arguments.
3226 .Topic
3227 By default, all command line arguments that are neither options nor
3228 option arguments are interpreted as filespec parameters and stored
3229 until option parsing has finished.
3231 For example, the command line
3232 .Shell_cmd "groffer file1 -a -o arg file2"
3233 is, by default, equivalent to
3234 .Shell_cmd "groffer -a -o arg -- file1 file2"
3238 This behavior can be changed by setting the environment variable
3239 .Env_var $POSIXLY_CORRECT
3240 to a non-empty value.
3242 Then the strange POSIX non-option behavior is adopted, i. e. option
3243 processing is stopped as soon as the first non-option argument is
3244 found and each following argument is taken as a file name.
3246 For example, in posixly correct mode, the command line
3247 .Shell_cmd "groffer file1 -a -o arg file 2"
3248 is equivalent to
3249 .Shell_cmd "groffer -- file1 -a -o arg file 2"
3250 As this leads to unwanted behavior in most cases, most people do not
3251 want to set
3252 .Env_var $POSIXLY_CORRECT .
3255 .\" --------------------------------------------------------------------
3256 .SH "SEE ALSO"
3257 .\" --------------------------------------------------------------------
3260 .BR \%groff (@MAN1EXT@)
3261 .TP+
3262 .BR \%troff (@MAN1EXT@)
3263 Details on the options and environment variables available in
3264 .IR \%groff ;
3265 all of them can be used with groffer.
3269 .BR \%groff (@MAN7EXT@)
3270 Documentation of the
3271 .I \%groff
3272 language.
3276 .BR \%grog (@MAN1EXT@)
3277 Internally,
3278 .I \%groffer
3279 tries to guess the
3280 .I \%groff
3281 command line options from the input using this program.
3285 .BR groff_out (@MAN5EXT@)
3286 Documentation on the
3287 .I \%groff intermediate output
3289 .RI ( ditroff
3290 output).
3295 .BR \%man (1)
3296 The standard program to diplay man\~pages.
3298 The information there is only useful if it is the man\~page for
3299 .IR "GNU\~man" .
3300 Then it documents the options and environment variables that are
3301 supported by
3302 .IR \%groffer .
3306 .BR \%gxditview (@MAN1EXT@)
3307 .TP+
3308 .BR \%xditview (1x)
3309 Viewers for
3310 .IR \%groffer 's
3311 .I x
3312 mode.
3316 .BR \%kghostview (1)
3317 .TP+
3318 .BR \%ggv (1)
3319 .TP+
3320 .BR \%gv (1)
3321 .TP+
3322 .BR \%ghostview (1)
3323 .TP+
3324 .BR \%gs (1)
3325 Viewers for
3326 .IR \%groffer 's
3327 .I ps
3328 mode.
3332 .BR \%kghostview (1)
3333 .TP+
3334 .BR \%ggv (1)
3335 .TP+
3336 .BR \%xpdf (1)
3337 .TP+
3338 .BR \%acroread (1)
3339 .TP+
3340 .BR \%kpdf (1)
3341 Viewers for
3342 .IR \%groffer 's
3343 .I \%pdf
3344 mode.
3348 .BR \%kdvi (1)
3349 .TP+
3350 .BR \%xdvi (1)
3351 .TP+
3352 .BR \%dvilx (1)
3353 Viewers for
3354 .IR \%groffer 's
3355 .I \%dvi
3356 mode.
3360 .BR \%konqueror (1)
3361 .TP+
3362 .BR \%mozilla (1)
3363 .TP+
3364 .BR \%lynx (1)
3365 Web-browsers for
3366 .IR \%groffer 's
3367 .I \%html
3369 .I \%www
3370 mode.
3374 .BR \%less (1)
3375 Standard pager program for the
3376 .I \%tty
3377 .IR mode .
3381 .BR \%gzip (1)
3382 .TP+
3383 .BR \%bzip2 (1)
3384 The decompression programs supported by groffer.
3387 .\" --------------------------------------------------------------------
3388 .SH "AUTHOR"
3389 .\" --------------------------------------------------------------------
3390 .author
3393 .\" --------------------------------------------------------------------
3394 .SH "COPYING"
3395 .\" --------------------------------------------------------------------
3396 .copyleft
3399 \" --------------------------------------------------------------------
3400 .\" Emacs settings
3401 .\" --------------------------------------------------------------------
3403 .\" Local Variables:
3404 .\" mode: nroff
3405 .\" End: