1GROFFER(1)                  General Commands Manual                 GROFFER(1)
2
3
4

NAME

6       groffer - display groff files and man pages on X and tty
7

SYNOPSIS

9       groffer [option...]  [--] [filespec...]
10       groffer -h|--help
11       groffer -v|--version
12

DESCRIPTION

14       The groffer program is the easiest way to use groff(1).  It can display
15       arbitrary documents written in the groff  language,  see  groff(7),  or
16       other  roff languages, see roff(7), that are compatible to the original
17       troff language.  The groffer program also includes many of the features
18       for finding and displaying the Unix manual pages (man pages), such that
19       it can be used as a replacement for a man(1) program.   Moreover,  com‐
20       pressed  files  that  can  be handled by gzip(1) or bzip2(1) are decom‐
21       pressed on-the-fly.
22
23       The normal usage is quite simple by supplying a file name or name of  a
24       man  page  without  further  options.  But the option handling has many
25       possibilities for creating special behaviors.  This can be done  either
26       in   configuration   files,   with   the   shell  environment  variable
27       $GROFFER_OPT, or on the command line.
28
29       The output can be generated and viewed in several different ways avail‐
30       able  for  groff.   This  includes  the  groff  native  X Window viewer
31       gxditview(1), each Postcript, pdf, or dvi display program, a web brows‐
32       er by generating html in www mode, or several text modes in text termi‐
33       nals.
34
35       Most of the options that must be named when running groff directly  are
36       determined  automatically for groffer, due to the internal usage of the
37       grog(1) program.  But all parts can also be controlled manually by  ar‐
38       guments.
39
40       Several  file  names  can  be  specified on the command line arguments.
41       They are transformed into a single document in the normal way of groff.
42
43       Option handling is done in GNU style.  Options and file  names  can  be
44       mixed  freely.  The option `--' closes the option handling, all follow‐
45       ing arguments are treated as file names.  Long options can be  abbrevi‐
46       ated in several ways.
47

OPTION OVERVIEW

49       breaking options
50
51              [-h|--help] [-v|--version]
52
53       groffer mode options
54
55              [--auto]  [--default] [--default-modes mode1,mode2,...]  [--dvi]
56              [--dvi-viewer  prog]  [--groff]  [--html]  [--html-viewer  prog]
57              [--mode   display_mode]   [--pdf]   [--pdf-viewer  prog]  [--ps]
58              [--ps-viewer prog]  [--source]  [--text]  [--to-stdout]  [--tty]
59              [--tty-viewer   prog]   [--www]  [--www-viewer  prog]  [--x|--X]
60              [--x-viewer|--X-viewer prog]
61
62       options related to groff
63
64              [-T|--device device] [-Z|--intermediate-output|--ditroff]
65
66              All further groff short options are accepted.
67
68       options for man pages
69              [--apropos] [--apropos-data] [--apropos-devel] [--apropos-progs]
70              [--man] [--no-man] [--no-special] [--whatis]
71
72       long options taken over from GNU man
73
74              [--all]  [--ascii]  [--ditroff]  [--extension  suffix] [--locale
75              language]   [--local-file]    [--location|--where]    [--manpath
76              dir1:dir2:...]   [--no-location]  [--pager  program] [--sections
77              sec1:sec2:...]    [--systems   sys1,sys2,...]    [--troff-device
78              device]
79
80              Further long options of GNU man are accepted as well.
81
82       X Window Toolkit options
83
84              [--bd|--bordercolor  pixels]  [--bg|--background  color]  [--bw|
85              --borderwidth pixels] [--display  X-display]  [--fg|--foreground
86              color]   [--fn|--ft|--font   font_name]   [--geometry  size_pos]
87              [--resolution value] [--rv] [--title string] [--xrm X-resource]
88
89       options for development
90
91              [--debug]   [--debug-all]   [--debug-filenames]   [--debug-func]
92              [--debug-keep]   [--debug-lm]  [--debug-params]  [--debug-shell]
93              [--debug-stacks] [--debug-tmpdir] [--debug-user]  [--do-nothing]
94              [--print text] [--shell prog] [-V]
95
96       filespec arguments
97
98              The  filespec  parameters  are all arguments that are neither an
99              option nor an option argument.  They usually mean a file name or
100              a man page searching scheme.
101
102              In  the following, the term section_extension is used.  It means
103              a word that consists of a man section that  is  optionally  fol‐
104              lowed  by  an  extension.  The name of a man section is a single
105              character from [1-9on], the extension is some word.  The  exten‐
106              sion is mostly lacking.
107
108              No filespec parameters means standard input.
109
110              -         stands for standard input (can occur several times).
111
112              filename  the path name of an existing file.
113
114              man:name(section_extension)
115              man:name.section_extension
116              name(section_extension)
117              name.section_extension
118              section_extension name
119                        search  the man page name in the section with optional
120                        extension section_extension.
121
122              man:name  man page in the lowest man section that has name.
123
124              name      if name  is  not  an  existing  file  search  for  the
125                        man page name in the lowest man section.
126

OPTION DETAILS

128       The  groffer program can usually be run with very few options.  But for
129       special purposes, it supports many options.  These can be classified in
130       5 option classes.
131
132       All  short  options of groffer are compatible with the short options of
133       groff(1).  All long options of groffer are compatible with the long op‐
134       tions of man(1).
135
136       Arguments  for  long  option  names can be abbreviated in several ways.
137       First, the argument is checked whether it can be prolonged as is.  Fur‐
138       thermore, each minus sign - is considered as a starting point for a new
139       abbreviation.  This leads to a set of multiple abbreviations for a sin‐
140       gle argument.  For example, --de-n-f can be used as an abbreviation for
141       --debug-not-func, but --de-n works as well.  If the abbreviation of the
142       argument leads to several resulting options an error is raised.
143
144   groffer breaking Options
145       As soon as one of these options is found on the command line it is exe‐
146       cuted, printed to standard output, and the running groffer is terminat‐
147       ed thereafter.  All other arguments are ignored.
148
149       -h | --help
150              Print  a  helping information with a short explanation of option
151              sto standard output.
152
153       -v | --version
154              Print version information to standard output.
155
156   groffer Mode Options
157       The display mode and the viewer programs are determined  by  these  op‐
158       tions.   If  none of these mode and viewer options is specified groffer
159       tries to find a suitable display mode automatically.  The default modes
160       are mode pdf, mode ps, mode html, mode x, and mode dvi in X Window with
161       different viewers and mode tty with device latin1 under less on a  ter‐
162       minal; other modes are tested if the programs for the main default mode
163       do not exist.
164
165       In X Window,  many  programs  create  their  own  window  when  called.
166       groffer  can  run  these viewers as an independent program in the back‐
167       ground.  As this does not work in text mode on a terminal  (tty)  there
168       must  be  a  way to know which viewers are X Window graphical programs.
169       The groffer script has a small set of information on some viewer names.
170       If  a  viewer  argument  of the command-line chooses an element that is
171       kept as X Window program in this list it is treated as  a  viewer  that
172       can run in the background.  All other, unknown viewer calls are not run
173       in the background.
174
175       For each mode, you are free to choose whatever viewer you  want.   That
176       need  not  be some graphical viewer suitable for this mode.  There is a
177       chance to view the output source; for example, the combination  of  the
178       options  --mode=ps  and --ps-viewer=less shows the content of the Post‐
179       script output, the source code, with the pager less.
180
181       --auto Equivalent to --mode=auto.
182
183       --default
184              Reset all configuration from previously processed  command  line
185              options  to  the default values.  This is useful to wipe out all
186              former  options  of  the  configuration,  in  $GROFFER_OPT,  and
187              restart  option  processing  using  only the rest of the command
188              line.
189
190       --default-modes mode1,mode2,...
191              Set the sequence of modes for auto mode to the  comma  separated
192              list  given  in  the argument.  See --mode for details on modes.
193              Display in the default manner; actually, this means to  try  the
194              modes x, ps, and tty in this sequence.
195
196       --dvi  Equivalent to --mode=dvi.
197
198       --dvi-viewer prog
199              Choose  a  viewer program for dvi mode.  This can be a file name
200              or a program to be searched in $PATH.  Known X Window dvi  view‐
201              ers  include xdvi(1) and dvilx(1) In each case, arguments can be
202              provided additionally.
203
204       --groff
205              Equivalent to --mode=groff.
206
207       --html Equivalent to --mode=html.
208
209       --html-viewer
210              Choose a web browser program for viewing in html mode.   It  can
211              be  the  path  name of an executable file or a program in $PATH.
212              In each case, arguments can be provided additionally.
213
214       --mode value
215              Set the display mode.  The following mode values are recognized:
216
217              auto   Select the automatic determination of the  display  mode.
218                     The  sequence of modes that are tried can be set with the
219                     --default-modes  option.   Useful   for   restoring   the
220                     default mode when a different mode was specified before.
221
222              dvi    Display  formatted input in a dvi viewer program.  By de‐
223                     fault, the formatted input is displayed with the  xdvi(1)
224                     program.  --dvi.
225
226              groff  After  the  file determination, switch groffer to process
227                     the input like groff(1)  would  do.   This  disables  the
228                     groffer viewing features.
229
230              html   Translate  the input into html format and display the re‐
231                     sult in a web browser program.  By default, the existence
232                     of  a sequence of standard web browsers is tested, start‐
233                     ing with konqueror(1)  and  mozilla(1).   The  text  html
234                     viewer is lynx(1).
235
236              pdf    Display  formatted input in a PDF (Portable Document For‐
237                     mat) viewer program.  By default, the input is  formatted
238                     by  groff  using the Postscript device, then it is trans‐
239                     formed  into  the  PDF  file  format  using   gs(1),   or
240                     ps2pdf(1).   If  that's not possible, the Postscript mode
241                     (ps) is used instead.  Finally it is displayed using dif‐
242                     ferent  viewer programs.  pdf has a big advantage because
243                     the text is displayed graphically and  is  searchable  as
244                     well.
245
246              ps     Display  formatted  input in a Postscript viewer program.
247                     By default, the formatted input is displayed  in  one  of
248                     many viewer programs.
249
250              text   Format in a groff text mode and write the result to stan‐
251                     dard output without a pager or viewer program.  The  text
252                     device, latin1 by default, can be chosen with option -T.
253
254              tty    Format in a groff text mode and write the result to stan‐
255                     dard output using a text  pager  program,  even  when  in
256                     X Window.
257
258              www    Equivalent to --mode=html.
259
260              x      Display  the formatted input in a native roff viewer.  By
261                     default,  the  formatted  input  is  displayed  with  the
262                     gxditview(1)  program  being  distributed  together  with
263                     groff.  But the standard X Window  tool  xditview(1)  can
264                     also  be  chosen with the option --x-viewer.  The default
265                     resolution is 75 dpi, but 100 dpi are also possible.  The
266                     default  groff  device  for  the  resolution of 75 dpi is
267                     X75-12, for 100 dpi it is X100.  The corresponding  groff
268                     intermediate  output  for  the actual device is generated
269                     and  the  result  is  displayed.   For  a  resolution  of
270                     100 dpi, the default width of the geometry of the display
271                     program is chosen to 850 dpi.
272
273              X      Equivalent to --mode=x.
274
275              The following modes do not use  the  groffer  viewing  features.
276              They are only interesting for advanced applications.
277
278              groff  Generate device output with plain groff without using the
279                     special viewing features of groffer.  If  no  device  was
280                     specified by option -T the groff default ps is assumed.
281
282              source Output  the  roff  source code of the input files without
283                     further processing.
284
285       --pdf  Equivalent to --mode=pdf.
286
287       --pdf-viewer prog
288              Choose a viewer program for pdf mode.  This can be a  file  name
289              or  a program to be searched in $PATH; arguments can be provided
290              additionally.
291
292       --ps   Equivalent to --mode=ps.
293
294       --ps-viewer prog
295              Choose a viewer program for ps mode.  This can be a file name or
296              a  program  to  be searched in $PATH.  Common Postscript viewers
297              inlude gv(1), ghostview(1), and gs(1), In each  case,  arguments
298              can be provided additionally.
299
300       --source
301              Equivalent --mode=source.
302
303       --text Equivalent to --mode=text.
304
305       --to-stdout
306              The  file  for  the  chosen mode is generated and its content is
307              printed to standard output.  It will not be displayed in graphi‐
308              cal mode.
309
310       --tty  Equivalent to --mode=tty.
311
312       --tty-viewer prog
313              Choose  a  text  pager  for  mode  tty.   The  standard pager is
314              less(1).  This option is eqivalent to man  option  --pager=prog.
315              The  option  argument  can  be  a  file  name or a program to be
316              searched in $PATH; arguments can be provided additionally.
317
318       --www  Equivalent to --mode=html.
319
320       --www-viewer prog
321              Equivalent to --html-viewer.
322
323       --X | --x
324              Equivalent to --mode=x.
325
326       --X-viewer | --x-viewer prog
327              Choose a viewer program for x mode.   Suitable  viewer  programs
328              are  gxditview(1) which is the default and xditview(1).  The ar‐
329              gument can be any executable file or a program in  $PATH;  argu‐
330              ments can be provided additionally.
331
332       --     Signals  the  end  of option processing; all remaining arguments
333              are interpreted as filespec parameters.
334
335       Besides these, groffer accepts all short options that are valid for the
336       groff(1) program.  All non-groffer options are sent unmodified via grog
337       to groff.  So postprocessors, macro packages, compatibility with  clas‐
338       sical troff, and much more can be manually specified.
339
340   Options related to groff
341       All  short  options of groffer are compatible with the short options of
342       groff(1).  The following of groff options  have  either  an  additional
343       special meaning within groffer or make sense for normal usage.
344
345       Because  of  the  special  outputting  behavior  of the groff option -Z
346       groffer was designed to be switched into groff mode ; the groffer view‐
347       ing features are disabled there.  The other groff options do not switch
348       the mode, but allow to customize the formatting process.
349
350       -a     This  generates  an  ascii  approximation  of  output   in   the
351              text  modes.   That  could  be important when the text pager has
352              problems with control sequences in tty mode.
353
354       -m file
355              Add file as a groff macro file.  This is useful in case it  can‐
356              not be recognized automatically.
357
358       -P opt_or_arg
359              Send  the argument opt_or_arg as an option or option argument to
360              the actual groff postprocessor.
361
362       -T | --device devname
363              This option determines groff's output device.  The  most  impor‐
364              tant  devices  are  the text output devices for referring to the
365              different character sets, such as ascii, utf8, latin1, and  oth‐
366              ers.   Each of these arguments switches groffer into a text mode
367              using this device, to mode tty if  the  actual  mode  is  not  a
368              text  mode.   The  following devname arguments are mapped to the
369              corresponding groffer --mode=devname option: dvi, html, and  ps.
370              All X* arguments are mapped to mode x.  Each other devname argu‐
371              ment switches to mode groff using this device.
372
373       -X     is equivalent to groff -X.  It displays the  groff  intermediate
374              output  with  gxditview.   As the quality is relatively bad this
375              option is deprecated; use --X instead because the x mode uses an
376              X* device for a better display.
377
378       -Z | --intermediate-output | --ditroff
379              Switch  into  groff mode and format the input with the groff in‐
380              termediate  output  without  postprocessing;  see  groff_out(5).
381              This is equivalent to option --ditroff of man, which can be used
382              as well.
383
384       All other groff options are supported by groffer,  but  they  are  just
385       transparently  transferred  to groff without any intervention.  The op‐
386       tions that are not explicitly  handled  by  groffer  are  transparently
387       passed to groff.  Therefore these transparent options are not document‐
388       ed here, but in groff(1).  Due to the automatism in  groffer,  none  of
389       these groff options should be needed, except for advanced usage.
390
391   Options for man pages
392       --apropos
393              Start the apropos(1) command or facility of man(1) for searching
394              the filespec arguments within all man page  descriptions.   Each
395              filespec argument is taken for search as it is; section specific
396              parts are not handled, such that 7 groff searches  for  the  two
397              arguments  7  and  groff,  with a large result; for the filespec
398              groff.7 nothing will be found.  The language locale  is  handled
399              only  when  the called programs do support this; the GNU apropos
400              and man -k do not.  The display differs from the apropos program
401              by the following concepts:
402
403              · Construct a groff frame similar to a man page to the output of
404                apropos,
405
406              · each filespec argument is searched on its own.
407
408              · The restriction by --sections is handled as well,
409
410              · wildcard characters are allowed and handled without a  further
411                option.
412
413       --apropos-data
414              Show only the apropos descriptions for data documents, these are
415              the man(7) sections 4, 5, and 7.   Direct  section  declarations
416              are ignored, wildcards are accepted.
417
418       --apropos-devel
419              Show  only  the  apropos descriptions for development documents,
420              these are the man(7) sections 2, 3, and 9.  Direct section  dec‐
421              larations are ignored, wildcards are accepted.
422
423       --apropos-progs
424              Show  only  the  apropos descriptions for documents on programs,
425              these are the man(7) sections 1, 6, and 8.  Direct section  dec‐
426              larations are ignored, wildcards are accepted.
427
428       --whatis
429              For  each  filespec  argument  search  all man pages and display
430              their description — or say that it is not a man page.   This  is
431              written from anew, so it differs from man's whatis output by the
432              following concepts
433
434              · each retrieved file name is added,
435
436              · local files are handled as well,
437
438              · the language and system locale is supported,
439
440              · the display is framed by a groff output format  similar  to  a
441                man page,
442
443              · wildcard characters are allowed without a further option.
444
445       The  following  options  were added to groffer for choosing whether the
446       file name arguments are interpreted as names for local files  or  as  a
447       search  pattern  for  man  pages.   The default is looking up for local
448       files.
449
450       --man  Check the non-option command line arguments (filespecs) first on
451              being  man  pages, then whether they represent an existing file.
452              By default, a filespec is first tested whether it is an existing
453              file.
454
455       --no-man | --local-file
456              Do  not  check for man pages.  --local-file is the corresponding
457              man option.
458
459       --no-special
460              Disable former calls of --all, --apropos*, and --whatis.
461
462   Long options taken over from GNU man
463       The long options of groffer were synchronized with the long options  of
464       GNU  man.   All  long options of GNU man are recognized, but not all of
465       these options are important to groffer, so most of them  are  just  ig‐
466       nored.  These ignored man options are --catman, --troff, and --update.
467
468       In  the  following,  the  man  options  that have a special meaning for
469       groffer are documented.
470
471       If your system has GNU man installed the full set of long and short op‐
472       tions of the GNU man program can be passed via the environment variable
473       $MANOPT; see man(1).
474
475       --all  In searching man pages, retrieve all suitable documents  instead
476              of only one.
477
478       -7 | --ascii
479              In  text  modes, display ASCII translation of special characters
480              for critical environment.  This  is  equivalent  to  groff  -mt‐
481              ty_char; see groff_tmac(5).
482
483       --ditroff
484              Produce  groff  intermediate  output.   This  is  equivalent  to
485              groffer -Z.
486
487       --extension suffix
488              Restrict man page search to file names that have suffix appended
489              to  their  section  element.   For  example,  in  the  file name
490              /usr/share/man/man3/terminfo.3ncurses.gz the man page  extension
491              is ncurses.
492
493       --locale language
494              Set  the  language for man pages.  This has the same effect, but
495              overwrites $LANG
496
497       --location
498              Print the location of the retrieved files to standard error.
499
500       --no-location
501              Do not display the location of retrieved files;  this  resets  a
502              former call to --location.  This was added by groffer.
503
504       --manpath 'dir1:dir2:...'
505              Use  the  specified search path for retrieving man pages instead
506              of the program defaults.  If the argument is set  to  the  empty
507              string "" the search for man page is disabled.
508
509       --pager
510              Set  the  pager  program  in tty mode; default is less.  This is
511              equivalent to --tty-viewer.
512
513       --sections 'sec1:sec2:...'
514              Restrict searching for man pages to the given sections, a colon-
515              separated list.
516
517       --systems 'sys1,sys2,...'
518              Search  for man pages for the given operating systems; the argu‐
519              ment systems is a comma-separated list.
520
521       --where
522              Eqivalent to --location.
523
524   X Window Toolkit Options
525       The  following  long  options  were  adapted  from  the   corresponding
526       X  Window Toolkit options.  groffer will pass them to the actual viewer
527       program if it is an X Window program.  Otherwise these options are  ig‐
528       nored.
529
530       Unfortunately  these  options  use  the old style of a single minus for
531       long options.  For groffer that was changed to the standard with  using
532       a  double  minus for long options, for example, groffer uses the option
533       --font for the X Window option -font.
534
535       See X(1), X(7), and the documentation on the X Window  Toolkit  options
536       for more details on these options and their arguments.
537
538       --background color
539              Set the background color of the viewer window.
540
541       --bd pixels
542              This is equivalent to --bordercolor.
543
544       --bg color
545              This is equivalent to --background.
546
547       --bw pixels
548              This is equivalent to --borderwidth.
549
550       --bordercolor pixels
551              Specifies the color of the border surrounding the viewer window.
552
553       --borderwidth pixels
554              Specifies  the  width  in  pixels  of the border surrounding the
555              viewer window.
556
557       --display X-display
558              Set the X Window display on which the viewer  program  shall  be
559              started,  see  the  X Window documentation for the syntax of the
560              argument.
561
562       --foreground color
563              Set the foreground color of the viewer window.
564
565       --fg color
566              This is equivalent to -foreground.
567
568       --fn font_name
569              This is equivalent to --font.
570
571       --font font_name
572              Set the font used by the viewer  window.   The  argument  is  an
573              X Window font name.
574
575       --ft font_name
576              This is equivalent to --font.
577
578       --geometry size_pos
579              Set  the geometry of the display window, that means its size and
580              its starting position.  See X(7) for the syntax of the argument.
581
582       --resolution value
583              Set X Window resolution in dpi (dots per inch)  in  some  viewer
584              programs.   The only supported dpi values are 75 and 100.  Actu‐
585              ally, the default resolution for groffer is set to 75 dpi.   The
586              resolution also sets the default device in mode x.
587
588       --rv   Reverse foreground and background color of the viewer window.
589
590       --title 'some text'
591              Set the title for the viewer window.
592
593       --xrm 'resource'
594              Set X Window resource.
595
596   Options for Development
597       --debug
598              Enable  seven  debugging  informations.  The temporary files are
599              kept and not deleted, the name of the  temporary  directory  and
600              the  shell  name for groffer2.sh are printed, the displayed file
601              names are printed, the parameters are printed at  several  steps
602              of development, and a function stack is output with function er‐
603              ror_user() as well.  Neither the  function  call  stack  at  the
604              opening  and  closing of each function call nor the landmark in‐
605              formation to determine how far the program is running are print‐
606              ed.   These seem to be the most useful parts among all debugging
607              options.
608
609       --debug-all
610              Enable all nine debugging informations  including  the  function
611              call stack and the landmark information.
612
613       --debug-filenames
614              Print the names of the files and man pages that are displayed by
615              groffer.
616
617       --debug-func
618              Enable the basic debugging information for  checking  the  func‐
619              tions  on  the  beginning  and  end  of  each call.  The options
620              --debug-stacks and --debug-user enable this option  automatical‐
621              ly.   This  option  is important for the development, but it de‐
622              creases the speed of groffer by large amounts.
623
624       --debug-keep
625              Enable two debugging informations, the printing of the  name  of
626              the temporary directory and the keeping of the temporary files.
627
628       --debug-lm
629              Enable one debugging information, the landmark information.
630
631       --debug-params
632              Enable  one  debugging  information,  the  parameters at several
633              steps.
634
635       --debug-shell
636              Enable  one  debugging   information,   the   shell   name   for
637              groffer2.sh.
638
639       --debug-stacks
640              Enable one debugging information, the function call stack.
641
642       --debug-tmpdir
643              Enable  one debugging information, the name of the temporary di‐
644              rectory.
645
646       --debug-user
647              Enable one debugging information, the function  stack  with  er‐
648              ror_user().
649
650       --do-nothing
651              This  is  like  --version,  but without the output; no viewer is
652              started.  This makes only sense in development.
653
654       --print=text
655              Just print the argument to standard error.  This is good for pa‐
656              rameter check.
657
658       --shell shell_program
659              Specify  the  shell under which the groffer2.sh script should be
660              run.  This option overwrites the automatic  shell  determination
661              of the program.  If the argument shell_program is empty a former
662              shell option and the automatic shell determination is  cancelled
663              and the default shell is restored.  Some shells run considerably
664              faster than the standard shell.
665
666       -V     This is an advanced option for debugging only.  Instead of  dis‐
667              playing  the formatted input, a lot of groffer specific informa‐
668              tion is printed to standard output:
669
670              · the output file name in the temporary directory,
671
672              · the display mode of the actual groffer run,
673
674              · the display program for viewing the output with its arguments,
675
676              · the active parameters from the config files, the arguments  in
677                $GROFFER_OPT, and the arguments of the command line,
678
679              · the pipeline that would be run by the groff program, but with‐
680                out executing it.
681
682       Other  useful  debugging  options  are  the   groff   option   -Z   and
683       --mode=groff.
684
685   Filespec Arguments
686       A filespec parameter is an argument that is not an option or option ar‐
687       gument.  In groffer, filespec parameters are a file name or a  template
688       for  searching  man  pages.  These input sources are collected and com‐
689       posed into a single output file such as groff does.
690
691       The strange POSIX behavior to regard all  arguments  behind  the  first
692       non-option argument as filespec arguments is ignored.  The GNU behavior
693       to recognize options even when mixed with filespec  arguments  is  used
694       througout.  But, as usual, the double minus argument -- ends the option
695       handling and interprets all following arguments as filespec  arguments;
696       so the POSIX behavior can be easily adopted.
697
698       The  options have a special handling of filespec arguments.  Each argu‐
699       ment is taken as a search scheme of its own.  Also  a  regexp  (regular
700       expression)  can be used in the filespec.  For example, groffer --apro‐
701       pos '^gro.f$' searches groff  in  the  man  page  name,  while  groffer
702       --apropos  groff searches groff somewhere in the name or description of
703       the man pages.
704
705       All other parts of groffer, such as the normal display  or  the  output
706       with have a different scheme for filespecs.  No regular expressions are
707       used for the arguments.  The filespec arguments are handled by the fol‐
708       lowing scheme.
709
710       It  is  necessary  to know that on each system the man pages are sorted
711       according to their content into several sections.   The  classical  man
712       sections  have  a  single-character name, either a digit from 1 to 9 or
713       one of the characters n or o.
714
715       This can optionally be followed by a string, the  so-called  extension.
716       The  extension  allows to store several man pages with the same name in
717       the same section.  But the extension is only rarely used, usually it is
718       omitted.  Then the extensions are searched automatically by alphabet.
719
720       In  the  following,  we  use the name section_extension for a word that
721       consists of a single character section name or a section character that
722       is  followed  by an extension.  Each filespec parameter can have one of
723       the following forms in decreasing sequence.
724
725       · No filespec parameters means that groffer waits for  standard  input.
726         The  minus  option  -  always stands for standard input; it can occur
727         several times.  If you want to look up a man page called  -  use  the
728         argument man:-.
729
730       · Next  a filespec is tested whether it is the path name of an existing
731         file.  Otherwise it is assumed  to  be  a  searching  pattern  for  a
732         man page.
733
734       · man:name(section_extension),              man:name.section_extension,
735         name(section_extension),   or   name.section_extension   search   the
736         man   page   name   in   man   section   and  possibly  extension  of
737         section_extension.
738
739       · Now man:name searches for a man page in the lowest man  section  that
740         has a document called name.
741
742       · section_extension  name  is  a pattern of 2 arguments that originates
743         from a strange argument parsing of  the  man  program.   Again,  this
744         searches the man page name with section_extension, a combination of a
745         section character optionally followed by an extension.
746
747       · We are left with the argument name which is not an existing file.  So
748         this  searches for the man page called name in the lowest man section
749         that has a document for this name.
750
751       Several file name arguments can be supplied.  They are mixed  by  groff
752       into a single document.  Note that the set of option arguments must fit
753       to all of these file arguments.  So they should have at least the  same
754       style of the groff language.
755

OUTPUT MODES

757       By  default, the groffer program collects all input into a single file,
758       formats it with the groff program for a certain device, and then choos‐
759       es a suitable viewer program.  The device and viewer process in groffer
760       is called a mode.  The mode and viewer of a running groffer program  is
761       selected  automatically,  but the user can also choose it with options.
762       The modes are selected by option the arguments of --mode=anymode.   Ad‐
763       ditionally,  each of this argument can be specified as an option of its
764       own, such as --anymode.  Most of these modes  have  a  viewer  program,
765       which   can   be   chosen   by  an  option  that  is  constructed  like
766       --anymode-viewer.
767
768       Several different modes are offered,  graphical  modes  for  X  Window,
769       text modes, and some direct groff modes for debugging and development.
770
771       By  default,  groffer  first  tries  whether  x  mode is possible, then
772       ps mode,  and  finally  tty  mode.   This  mode  testing  sequence  for
773       auto  mode can be changed by specifying a comma separated list of modes
774       with the option --default-modes.
775
776       The searching for man pages and the decompression of the input are  ac‐
777       tive in every mode.
778
779   Graphical Display Modes
780       The graphical display modes work mostly in the X Window environment (or
781       similar implementations within other windowing environments).  The  en‐
782       vironment variable $DISPLAY and the option --display are used for spec‐
783       ifying the X Window display to be used.  If this  environment  variable
784       is  empty  groffer assumes that no X Window is running and changes to a
785       text mode.  You can  change  this  automatic  behavior  by  the  option
786       --default-modes.
787
788       Known  viewers  for  the  graphical  display  modes  and their standard
789       X Window viewer progams are
790
791       · in a PDF viewer (pdf mode),
792
793       · in a web browser (html or www mode).
794
795       · in a Postscript viewer (ps mode),
796
797       · X Window  roff  viewers  such  as  gxditview(1)  or  xditview(1)  (in
798         x mode),
799
800       · in a dvi viewer program (dvi mode),
801
802       The  pdf  mode  has a major advantage — it is the only graphical diplay
803       mode that allows to search for text within the viewer; this  can  be  a
804       really  important feature.  Unfortunately, it takes some time to trans‐
805       form the input into the PDF format, so it was not chosen as  the  major
806       mode.
807
808       These   graphical   viewers   can  be  customized  by  options  of  the
809       X Window Toolkit.  But the groffer options use a leading  double  minus
810       instead of the single minus used by the X Window Toolkit.
811
812   Text modes
813       There are two modes for text output, mode text for plain output without
814       a pager and mode tty for a text output on a text  terminal  using  some
815       pager program.
816
817       If  the  variable $DISPLAY is not set or empty, groffer assumes that it
818       should use tty mode.
819
820       In the actual implementation, the groff output device latin1 is  chosen
821       for  text  modes.   This  can  be  changed  by  specifying option -T or
822       --device.
823
824       The pager to be used can be specified by one of the options --pager and
825       --tty-viewer, or by the environment variable $PAGER.  If all of this is
826       not used the less(1) program with the option -r for correctly  display‐
827       ing control sequences is used as the default pager.
828
829   Special Modes for Debugging and Development
830       These modes use the groffer file determination and decompression.  This
831       is combined into a single input file that is fed  directly  into  groff
832       with  different strategy without the groffer viewing facilities.  These
833       modes are regarded as advanced, they are useful for debugging  and  de‐
834       velopment purposes.
835
836       The source mode with option --source just displays the decompressed in‐
837       put.
838
839       Otion --to-stdout does not display in a graphical mode.  It just gener‐
840       ates  the file for the chosen mode and then prints its content to stan‐
841       dard output.
842
843       The groff mode passes the input to groff using only some  suitable  op‐
844       tions provided to groffer.  This enables the user to save the generated
845       output into a file or pipe it into another program.
846
847       In groff mode, the option -Z disables post-processing,  thus  producing
848       the  groff  intermediate output.  In this mode, the input is formatted,
849       but not postprocessed; see groff_out(5) for details.
850
851       All groff short options are supported by groffer.
852

MAN PAGE SEARCHING

854       The default behavior of groffer is to first test whether a file parame‐
855       ter  represents a local file; if it is not an existing file name, it is
856       assumed to represent the name of a man page.  The following options can
857       be  used  to  determine whether the arguments should be handled as file
858       name or man page arguments.
859
860       --man  forces to interpret all file parameters as filespecs for search‐
861              ing man pages.
862
863       --no-man
864       --local-file
865              disable the man searching; so only local files are displayed.
866
867       If  neither a local file nor a man page was retrieved for some file pa‐
868       rameter a warning is issued on standard error, but processing  is  con‐
869       tinued.
870
871   Search Algoritm
872       Let us now assume that a man page should be searched.  The groffer pro‐
873       gram provides a search facility for man pages.  All long  options,  all
874       environment  variables, and most of the functionality of the GNU man(1)
875       program were implemented.  The search algorithm shall  determine  which
876       file is displayed for a given man page.  The process can be modified by
877       options and environment variables.
878
879       The only man action that is omitted in  groffer  are  the  preformatted
880       man  pages,  also  called cat pages.  With the excellent performance of
881       the actual computers, the preformatted man pages aren't  necessary  any
882       longer.  Additionally, groffer is a roff program; it wants to read roff
883       source files and format them itself.
884
885       The algorithm for retrieving the file for a man page needs first a  set
886       of  directories.   This  set starts with the so-called man path that is
887       modified later on by adding names of  operating  system  and  language.
888       This  arising set is used for adding the section directories which con‐
889       tain the man page files.
890
891       The man path is a list of directories that are separated by colon.   It
892       is generated by the following methods.
893
894       · The environment variable $MANPATH can be set.
895
896       · It  can  be  read  from  the  arguments  of  the environment variable
897         $MANOPT.
898
899       · The man path can be manually specified by using the option --manpath.
900         An empty argument disables the man page searching.
901
902       · When no man path was set the manpath(1) program is tried to determine
903         one.
904
905       · If this does not work a reasonable default path from $PATH is  deter‐
906         mined.
907
908       We  now  have  a  starting set of directories.  The first way to change
909       this set is by adding names of operating systems.   This  assumes  that
910       man pages for several operating systems are installed.  This is not al‐
911       ways true.  The names of such operating systems can be  provided  by  3
912       methods.
913
914       · The environment variable $SYSTEM has the lowest precedence.
915
916       · This can be overridden by an option in $MANOPT.
917
918       · This again is overridden by the command line option --systems.
919
920       Several  names  of  operating  systems  can be given by appending their
921       names, separated by a comma.
922
923       The man path is changed by appending each system name  as  subdirectory
924       at  the end of each directory of the set.  No directory of the man path
925       set is kept.  But if no system name is specified the man path  is  left
926       unchanged.
927
928       After  this,  the  actual set of directories can be changed by language
929       information.  This assumes that there exist man pages in different lan‐
930       guages.  The wanted language can be chosen by several methods.
931
932       · Enviroment variable $LANG.
933
934       · This is overridden by $LC_MESSAGES.
935
936       · This is overridden by $LC_ALL.
937
938       · This can be overridden by providing an option in $MANOPT.
939
940       · All  these  environment  variables are overridden by the command line
941         option --locale.
942
943       The default language can be specified by specifying one of the  pseudo-
944       language parameters C or POSIX.  This is like deleting a formerly given
945       language information.  The man pages in the default language are usual‐
946       ly in English.
947
948       Of  course,  the language name is determined by man.  In GNU man, it is
949       specified in the POSIX 1003.1 based format:
950
951       <language>[_<territory>[.<character-set>[,<version>]]],
952
953       but the two-letter code in <language> is sufficient for most  purposes.
954       If  for  a  complicated  language  formulation  no  man pages are found
955       groffer searches the country part consisting of these first two charac‐
956       ters as well.
957
958       The  actual  directory  set is copied thrice.  The language name is ap‐
959       pended as subdirectory to each directory in the first copy of the actu‐
960       al directory set (this is only done when a language information is giv‐
961       en).  Then the 2-letter abbreviation of the language name  is  appended
962       as subdirectories to the second copy of the directory set (this is only
963       done when the given language name has more than 2 letters).  The  third
964       copy of the directory set is kept unchanged (if no language information
965       is given this is the kept directory set).  These maximally 3 copies are
966       appended to get the new directory set.
967
968       We  now  have  a  complete set of directories to work with.  In each of
969       these directories, the man files are separated in sections.   The  name
970       of  a  section  is represented by a single character, a digit between 1
971       and 9, or the character o or n, in this order.
972
973       For each available section, a subdirectory man<section> exists contain‐
974       ing all man files for this section, where <section> is a single charac‐
975       ter as described before.  Each man file in a section directory has  the
976       form  man<section>/<name>.<section>[<extension>][.<compression>], where
977       <extension> and <compression> are optional.  <name> is the name of  the
978       man  page  that  is  also specified as filespec argument on the command
979       line.
980
981       The extension is an addition to the section.  This postfix acts like  a
982       subsection.   An extension occurs only in the file name, not in name of
983       the section subdirectory.  It can be specified on the command line.
984
985       On the other hand, the compression is just an information  on  how  the
986       file  is  compressed.  This is not important for the user, such that it
987       cannot be specified on the command line.
988
989       There are 4 methods to specify a section on the command line:
990
991       · Environment variable $MANSECT
992
993       · Command line option --sections
994
995       · Appendix to the name argument in the form <name>.<section>
996
997       · Preargument before the name argument in the form <section> <name>
998
999       It is also possible to specify several sections by appending the single
1000       characters separated by colons.  One can imagine that this means to re‐
1001       strict the man page search to only some sections.   The  multiple  sec‐
1002       tions are only possible for $MANSECT and --sections.
1003
1004       If no section is specified all sections are searched one after the oth‐
1005       er in the given order, starting with section 1, until a  suitable  file
1006       is found.
1007
1008       There  are  4 methods to specify an extension on the command line.  But
1009       it is not necessary to provide the whole extension name, some abbrevia‐
1010       tion is good enough in most cases.
1011
1012       · Environment variable $EXTENSION
1013
1014       · Command line option --extension
1015
1016       · Appendix  to  the  <name>.<section> argument in the form <name>.<sec‐
1017         tion><extension>
1018
1019       · Preargument before the name argument in the form <section><extension>
1020         <name>
1021
1022       For further details on man page searching, see man(1).
1023
1024   Examples of man files
1025       /usr/share/man/man1/groff.1
1026              This  is  an  uncompressed  file  for the man page groff in sec‐
1027              tion 1.  It can be called by
1028              sh# groffer groff
1029              No  section  is  specified  here,  so  all  sections  should  be
1030              searched,  but  as section 1 is searched first this file will be
1031              found first.  The file name is composed of the following  compo‐
1032              nents.   /usr/share/man must be part of the man path; the subdi‐
1033              rectory man1/ and the part .1 stand for the  section;  groff  is
1034              the name of the man page.
1035
1036       /usr/local/share/man/man7/groff.7.gz
1037              The   file   name  is  composed  of  the  following  components.
1038              /usr/local/share/man must be part of the man path; the subdirec‐
1039              tory  man7/  and the part .7 stand for the section; groff is the
1040              name of the man page; the final part .gz stands for  a  compres‐
1041              sion  with gzip(1).  As the section is not the first one it must
1042              be specified as well.  This can be done by one of the  following
1043              commands.
1044              sh# groffer groff.7
1045              sh# groffer 7 groff
1046              sh# groffer --sections=7 groff
1047
1048       /usr/local/man/man1/ctags.1emacs21.bz2
1049              Here  /usr/local/man must be in man path; the subdirectory man1/
1050              and the file name part .1 stand for section 1; the name  of  the
1051              man page is ctags; the section has an extension emacs21; and the
1052              file is compressed as .bz2  with  bzip2(1).   The  file  can  be
1053              viewed with one of the following commands
1054              sh# groffer ctags.1e
1055              sh# groffer 1e ctags
1056              sh# groffer --extension=e --sections=1 ctags
1057              where e works as an abbreviation for the extension emacs21.
1058
1059       /usr/man/linux/de/man7/man.7.Z
1060              The  directory  /usr/man is now part of the man path; then there
1061              is a subdirectory for an  operating  system  name  linux/;  next
1062              comes   a  subdirectory de/ for the German language; the section
1063              names man7 and .7 are known so far;  man  is  the  name  of  the
1064              man  page;  and .Z signifies the compression that can be handled
1065              by gzip(1).  We want now show how to provide several values  for
1066              some  options.  That is possible for sections and operating sys‐
1067              tem names.  So we use as sections 5 and 7 and  as  system  names
1068              linux and aix.  The command is then
1069              sh# groffer --locale=de --sections=5:7 --systems=linux,aix man
1070              sh# LANG=de MANSECT=5:7 SYSTEM=linux,aix groffer man
1071

DECOMPRESSION

1073       The  program has a decompression facility.  If standard input or a file
1074       that was retrieved from the command line parameters is compressed  with
1075       a  format  that is supported by either gzip(1) or bzip2(1) it is decom‐
1076       pressed on-the-fly.  This includes the GNU .gz, .bz2,  and  the  tradi‐
1077       tional  .Z  compression.  The program displays the concatenation of all
1078       decompressed input in the sequence that was specified  on  the  command
1079       line.
1080

ENVIRONMENT

1082       The  groffer  program  supports  many system variables, most of them by
1083       courtesy of other programs.  All environment variables of groff(1)  and
1084       GNU man(1) and some standard system variables are honored.
1085
1086   Native groffer Variables
1087       $GROFFER_OPT
1088              Store  options  for  a run of groffer.  The options specified in
1089              this variable are overridden by the options given on the command
1090              line.   The  content  of  this variable is run through the shell
1091              builtin `eval'; so arguments containing white-space  or  special
1092              shell characters should be quoted.  Do not forget to export this
1093              variable, otherwise it does not exist during the run of groffer.
1094
1095   System Variables
1096       The groffer program is a shell script  that  is  run  through  /bin/sh,
1097       which  can  be  internally linked to programs like bash(1).  The corre‐
1098       sponding system environment is automatically effective.  The  following
1099       variables have a special meaning for groffer.
1100
1101       $DISPLAY
1102              If  this variable is set this indicates that the X Window system
1103              is running.  Testing this variable decides on whether  graphical
1104              or  text  output  is  generated.   This  variable  should not be
1105              changed by the user carelessly, but it can be used to start  the
1106              graphical  groffer  on a remote X Window terminal.  For example,
1107              depending on your system, groffer can be started on  the  second
1108              monitor by the command
1109              sh# DISPLAY=:0.1 groffer what.ever&
1110
1111       $LC_ALL
1112       $LC_MESSAGES
1113       $LANG  If  one  of  these variables is set (in the above sequence), its
1114              content is interpreted as the locale, the language to  be  used,
1115              especially when retrieving IR man pages .  A locale name is typ‐
1116              ically of  the  form  language[_territory[.codeset[@modifier]]],
1117              where  language is an ISO 639 language code, territory is an ISO
1118              3166 country code, and codeset is a character  set  or  encoding
1119              identifier  like ISO-8859-1 or UTF-8; see setlocale(3).  The lo‐
1120              cale values C and POSIX stand for the default, i.e. the man page
1121              directories  without a language prefix.  This is the same behav‐
1122              ior as when all 3 variables are unset.
1123
1124       $PAGER This variable can be used to set the pager for the  tty  output.
1125              For  example,  to disable the use of a pager completely set this
1126              variable to the cat(1) program
1127              sh# PAGER=cat groffer anything
1128
1129       $PATH  All programs within the groffer shell script are called  without
1130              a fixed path.  Thus this environment variable determines the set
1131              of programs used within the run of groffer.
1132
1133   Groff Variables
1134       The groffer program internally calls groff, so  all  environment  vari‐
1135       ables  documented  in  groff(1)  are  internally used within groffer as
1136       well.  The following variable has a direct meaning for the groffer pro‐
1137       gram.
1138
1139       $GROFF_TMPDIR
1140              If  the value of this variable is an existing, writable directo‐
1141              ry, groffer uses it for storing its  temporary  files,  just  as
1142              groff does.
1143
1144   Man Variables
1145       Parts  of  the  functionality  of  the  man program were implemented in
1146       groffer; support for all environment variables documented in man(1) was
1147       added to groffer, but the meaning was slightly modified due to the dif‐
1148       ferent approach in groffer; but the user interface is  the  same.   The
1149       man  environment  variables can be overwritten by options provided with
1150       $MANOPT, which in turn is overwritten by the command line.
1151
1152       $EXTENSION
1153              Restrict the search for man pages to files  having  this  exten‐
1154              sion.   This  is overridden by option --extension; see there for
1155              details.
1156
1157       $MANOPT
1158              This variable contains options as a preset for man(1).   As  not
1159              all  of  these are relevant for groffer only the essential parts
1160              of its value are extracted.  The options specified in this vari‐
1161              able  overwrite  the  values  of the other environment variables
1162              that are specific to man.  All options specified in  this  vari‐
1163              able are overridden by the options given on the command line.
1164
1165       $MANPATH
1166              If  set,  this  variable  contains  the directories in which the
1167              man page  trees  are  stored.   This  is  overridden  by  option
1168              --manpath.
1169
1170       $MANSECT
1171              If  this  is a colon separated list of section names, the search
1172              for man pages is restricted to those manual sections in that or‐
1173              der.  This is overridden by option --sections.
1174
1175       $SYSTEM
1176              If  this is set to a comma separated list of names these are in‐
1177              terpreted as man page trees  for  different  operating  systems.
1178              This  variable can be overwritten by option --systems; see there
1179              for details.
1180
1181       The environment variable $MANROFFSEQ is ignored by groffer because  the
1182       necessary preprocessors are determined automatically.
1183

CONFIGURATION FILES

1185       The groffer program can be preconfigured by two configuration files.
1186
1187       /etc/groff/groffer.conf
1188              System-wide configuration file for groffer.
1189
1190       $HOME/.groff/groffer.conf
1191              User-specific  configuration  file  for groffer, where $HOME de‐
1192              notes the user's home directory.  This file is called after  the
1193              system-wide configuration file to enable overriding by the user.
1194
1195       Both  files  are  handled  for the configuration, but the configuration
1196       file in /etc comes first; it is overwritten by the  configuration  file
1197       in  the home directory; both configuration files are overwritten by the
1198       environment variable $GROFFER_OPT; everything  is  overwritten  by  the
1199       command line arguments.
1200
1201       In  the configuration files, arbitrary spaces are allowed at the begin‐
1202       ning of each line, they are just ignored.  Apart from that,  the  lines
1203       of  the  configuration  lines  either start with a minus character, all
1204       other lines are interpreted as shell commands.
1205
1206       The lines with the beginning minus are interpreted as groffer  options.
1207       This  easily  allows to set general groffer options that should be used
1208       with any call of groffer.
1209
1210       If a lines starts with a double minus it represents a groffer long  op‐
1211       tion;  everything behind the first equal sign `=' or space character up
1212       to the end of the line is interpreted as its argument.  A line starting
1213       with  a single minus represents a short options cluster with or without
1214       a final argument.  It is not necessary to use quotes  in  these  lines;
1215       quotes are just ignored.
1216
1217       The  lines  starting with a minus are changed into a prepend to the ex‐
1218       isting value of $GROFFER_OPT.   So  the  configuration  files  will  be
1219       transferred into a shell script that is called within groffer.
1220
1221       It  makes  sense  to  use  these  configuration files for the following
1222       tasks:
1223
1224       · Preset command line options, such as choosing a  mode  or  a  viewer.
1225         These  are  written into lines starting with a single or double minus
1226         sign, followed by the option name.
1227
1228       · Preset environment variables recognized by groffer; but do not forget
1229         to export them.
1230
1231       · You can also write a shell function for calling, for example a viewer
1232         program for some mode.  Such a function can be fed into a correspond‐
1233         ing --mode-viewer option.
1234
1235       · Enter  --shell  to  specify a shell for the run of groffer2.sh.  Some
1236         shells run much faster than the standard shell.
1237
1238       As  an  example,  consider  the   following   configuration   file   in
1239       ~/.groff/groffer.conf, say.
1240
1241       # groffer configuration file
1242       #
1243       # groffer options that are used in each call of groffer
1244       --shell=ksh
1245       --foreground=DarkBlue
1246       --resolution=100
1247       --x-viewer=gxditview -geometry 900x1200
1248       #
1249       # some shell commands
1250       if test "$DISPLAY" = ""; then
1251         export DISPLAY='localhost:0.0'
1252       fi
1253       date >>~/mygroffer.log
1254
1255       The  lines  starting with # are command lines.  This configuration sets
1256       four groffer options (the lines starting with `-') and runs  two  shell
1257       commands (the rest of the script).  This has the following effects:
1258
1259       · Use ksh as the shell to run the groffer script; if it works it should
1260         be faster than the usual sh.
1261
1262       · Use a text color of DarkBlue in all viewers that support  this,  such
1263         as gxditview.
1264
1265       · Use a resolution of 100 dpi in all viewers that support this, such as
1266         gxditview.  By this, the default device in x mode is set to X100.
1267
1268       · Force gxditview(1) as the x-mode viewer using the geometry option for
1269         setting the width to 900 dpi and the height to 1200 dpi.  This geome‐
1270         try is suitable for a resolution of 100 dpi.
1271
1272       · If the environment variable  $DISPLAY  is  empty  set  it  to  local‐
1273         host:0.0.  That allows to start groffer in the standard X Window dis‐
1274         play, even when the program is called from a text console.
1275
1276       · Just for fun, the date of each groffer start is written to  the  file
1277         mygroffer.log in the home directory.
1278

EXAMPLES

1280       The  usage  of groffer is very easy.  Usually, it is just called with a
1281       file name or man page.  The  following  examples,  however,  show  that
1282       groffer has much more fancy capabilities.
1283
1284       sh# groffer /usr/local/share/doc/groff/meintro.ms.gz
1285              Decompress, format and display the compressed file meintro.ms.gz
1286              in the directory /usr/local/share/doc/groff, using the  standard
1287              viewer  gxditview  as  graphical viewer when in X Window, or the
1288              less(1) pager program when not in X Window.
1289
1290       sh# groffer groff
1291              If the file ./groff exists use it as input.  Otherwise interpret
1292              the  argument  as  a  search for the man page named groff in the
1293              smallest possible man section, being section 1 in this case.
1294
1295       sh# groffer man:groff
1296              search for the man page of groff even when the file ./groff  ex‐
1297              ists.
1298
1299       sh# groffer groff.7
1300       sh# groffer 7 groff
1301              search  the  man  page  of groff in man section 7.  This section
1302              search works only for a digit or a single character from a small
1303              set.
1304
1305       sh# groffer fb.modes
1306              If the file ./fb.modes does not exist interpret this as a search
1307              for the man page of fb.modes.  As the extension modes is  not  a
1308              single  character in classical section style the argument is not
1309              split to a search for fb.
1310
1311       sh# groffer groff ’troff(1)’ man:roff
1312              The arguments that are not existing files are looked-up  as  the
1313              following man pages: groff (automatic search, should be found in
1314              man section 1), troff (in section 1), and roff (in  the  section
1315              with  the  lowest  number,  being  7  in this case).  The quotes
1316              around troff(1) are necessary because the paranthesis are spe‐
1317              cial  shell characters; escaping them with a backslash character
1318              \( and \) would be possible, too.  The formatted files are  con‐
1319              catenated and displayed in one piece.
1320
1321       sh# LANG=de groffer --man --www --www-viever=galeon ls
1322              Retrieve  the  German man page (language de) for the ls program,
1323              decompress it, format it to html format (www mode) and view  the
1324              result  in  the web browser galeon.  The option --man guarantees
1325              that the man page is retrieved, even when a local file ls exists
1326              in the actual directory.
1327
1328       sh# groffer --source 'man:roff(7)'
1329              Get  the  man  page called roff in man section 7, decompress it,
1330              and print its unformatted content, its source code.
1331
1332       sh# groffer --de-p --in --ap
1333              This is a set of abbreviated arguments, it is determined as
1334              sh# groffer --debug-params --intermediate-output --apropos
1335
1336       sh# cat file.gz | groffer -Z -mfoo
1337              The file file.gz is sent  to  standard  input,  this  is  decom‐
1338              pressed,  and then this is transported to the groff intermediate
1339              output mode without post-processing  (groff  option  -Z),  using
1340              macro package foo (groff option -m)
1341
1342       sh# echo '\f[CB]WOW!' |
1343       >   groffer --x --bg red --fg yellow --geometry 200x100 -
1344              Display  the  word WOW! in a small window in constant-width bold
1345              font, using color yellow on red background.
1346

COMPATIBILITY

1348       The groffer program consists of two shell scripts.
1349
1350       The starting script is the file groffer that is installed in a bin  di‐
1351       rectory.   It is generated from the source file groffer.sh.  It is just
1352       a short starting script without any functions such that it can  run  on
1353       very poor shells.
1354
1355       The  main  part  of the groffer program is the file groffer2.sh that is
1356       installed in the groff library directory.  This script can be run under
1357       a different shell by using the groffer option --shell.
1358
1359       Both scripts are compatible with both GNU and POSIX.  POSIX compatibil‐
1360       ity refers to IEEE P1003.2/D11.2 of September 1991, a very  early  ver‐
1361       sion of the POSIX standard that is still freely available in the inter‐
1362       net at POSIX P1003.2 draft 11.2 ⟨http://www.funet.fi/pub/doc/posix/
1363       p1003.2/d11.2/all⟩.
1364
1365       Only  a restricted set of shell language elements and shell builtins is
1366       used to achieve even compatibility with some Bourne shells that are not
1367       fully  POSIX compatible.  The groffer shell scripts were tested on many
1368       shells,  including  the  following  Bourne  shells:  ash(1),   bash(1),
1369       dash(1),  ksh(1),  pdksh(1), posh(1), and zsh(1).  So it should work on
1370       most actual free and commercial operating systems.
1371
1372       The shell for the run of  groffer2.sh  can  be  chosen  by  the  option
1373       --shell on the command line or the environment variable $GROFF_OPT.  If
1374       you want to add it to one of the groffer configuration files  you  must
1375       write a line starting with --shell.
1376
1377       The  groffer program provides its own parser for command line arguments
1378       that is compatible to both POSIX getopts(1) and GNU getopt(1).  It  can
1379       handle  option  arguments  and  file names containing white space and a
1380       large set of special characters.  The following standard types  of  op‐
1381       tions are supported.
1382
1383       · The option consisiting of a single minus - refers to standard input.
1384
1385       · A  single  minus  followed by characters refers to a single character
1386         option or a combination thereof; for example, the groffer  short  op‐
1387         tion combination -Qmfoo is equivalent to -Q -m foo.
1388
1389       · Long  options  are options with names longer than one character; they
1390         are always preceded by a double minus.  An option argument can either
1391         go  to  the  next  command line argument or be appended with an equal
1392         sign to the  argument;  for  example,  --long=arg  is  equivalent  to
1393         --long arg .
1394
1395       · An argument of -- ends option parsing; all further command line argu‐
1396         ments are interpreted as filespec parameters, i.e. file names or con‐
1397         structs for searching man pages).
1398
1399       · All  command line arguments that are neither options nor option argu‐
1400         ments are interpreted as filespec parameters and stored until  option
1401         parsing has finished.  For example, the command line
1402         sh# groffer file1 -a -o arg file2
1403         is equivalent to
1404         sh# groffer -a -o arg -- file1 file2
1405
1406       The  free  mixing  of  options  and filespec parameters follows the GNU
1407       principle.  That does not fulfill the strange option behavior of  POSIX
1408       that  ends  option  processing as soon as the first non-option argument
1409       has been reached.  The end of option processing can be  forced  by  the
1410       option `--' anyway.
1411

BUGS

1413       Report bugs to the bug-groff mailing list ⟨bug-groff@gnu.org⟩.  Include
1414       a complete, self-contained example that will allow the bug to be repro‐
1415       duced, and say which version of groffer you are using.
1416
1417       You  can  also use the groff mailing list ⟨groff@gnu.org⟩, but you must
1418       first subscribe to this list.  You can do that by visiting the groff
1419       mailing list web page ⟨http://lists.gnu.org/mailman/listinfo/groff⟩.
1420
1421       See groff(1) for information on availability.
1422

SEE ALSO

1424       groff(1), troff(1)
1425              Details  on  the  options and environment variables available in
1426              groff; all of them can be used with groffer.
1427
1428       groff(7)
1429              Documentation of the groff language.
1430
1431       grog(1)
1432              Internally, groffer tries to guess the groff  command  line  op‐
1433              tions from the input using this program.
1434
1435       groff_out(5)
1436              Documentation on the groff intermediate output (ditroff output).
1437
1438       groff_tmac(5)
1439              Documentation on the groff macro files.
1440
1441       man(1) The  standard  program  to  display  man pages.  The information
1442              there is only useful if it is the man page for GNU man.  Then it
1443              documents  the  options  and environment variables that are sup‐
1444              ported by groffer.
1445
1446       ash(1), bash(1), dash(1), ksh(1), pdksh(1), posh(1), sh(1), zsh(1)
1447              Bourne shells that were tested with groffer.
1448
1449       gxditview(1), xditview(1x)
1450              Viewers for groffer's x mode.
1451
1452       kpdf(1), kghostview(1), evince(1), ggv(1), gv(1), ghostview(1), gs(1)
1453              Viewers for groffer's ps mode.
1454
1455       kpdf(1),  acroread(1),  evince(1),  xpdf(1),  gpdf(1),   kghostview(1),
1456       ggv(1)
1457              Viewers for groffer's pdf mode.
1458
1459       kdvi(1), xdvi(1), dvilx(1)
1460              Viewers for groffer's dvi mode.
1461
1462       konqueror(1), epiphany(1), firefox(1), mozilla(1), netscape(1), lynx(1)
1463              Web-browsers for groffer's html or www mode.
1464
1465       less(1)
1466              Standard pager program for the tty mode .
1467
1468       gzip(1), bzip2(1)
1469              The decompression programs supported by groffer.
1470

AUTHOR

1472       This file was written by Bernd Warken.
1473

COPYING

1475       Copyright (C) 2001,2002,2004,2005,2006 Free Software Foundation, Inc.
1476
1477       This  file  is part of groffer, which is part of groff, a free software
1478       project.  You can redistribute it and/or modify it under the  terms  of
1479       the  GNU  General  Public  License  as  published  by the Free Software
1480       Foundation, either version 2, or (at your option) any later version.
1481
1482       You should have received a copy of the GNU General Public License along
1483       with  groff,  see the files COPYING and LICENSE in the top directory of
1484       the groff source package.  Or read the man page gpl(1).  You  can  also
1485       write  to  the  Free Software Foundation, 51 Franklin St - Fifth Floor,
1486       Boston, MA 02110-1301, USA.
1487
1488
1489
1490Groff Version 1.18.1.4          05 October 2006                     GROFFER(1)
Impressum