groff: update vendor branch to v1.20.1
[dragonfly.git] / contrib / groff / src / roff / grog / grog.man
CommitLineData
4d3e9548
JL
1.TH GROG @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
2.
3.\" --------------------------------------------------------------------
4.\" Legalize
5.\" --------------------------------------------------------------------
6.
92d0a6a6 7.ig
4d3e9548 8grog.1 - man page for grog (section 1)
92d0a6a6 9
4d3e9548
JL
10Source file position: <groff_source_top>/src/roff/grog/grog.man
11Installed position: $prefix/share/man/man1/grog.1
92d0a6a6 12
4d3e9548 13Last Update: 5 Jan 2009
92d0a6a6 14..
4d3e9548
JL
15.de co
16Copyright (C) 1989-2000, 2001, 2002, 2003, 2006, 2007, 2009
17Free Software Foundation, Inc.
18.
19Written by James Clark.
20Maintained by
21.MT wl@gnu.org
22Werner Lemberg
23.ME .
24Rewritten and put under GPL by Bernd Warken.
25.
26.P
27This file is part of
28.IR grog ,
29which is part of
30.IR groff ,
31a free software project.
32.
33You can redistribute it and/or modify it under the terms of the
34.nh
35.B "GNU General Public License"
36.hy
37(\f[CR]GPL\f[]) as published by the
38.nh
39.BR "Free Software Foundation" ,
40.hy
41either version\~2, or (at your option) any later version.
42.
43.P
44You should have received a copy of the \f[CR]GNU General Public
45License\f[] along with
46.IR groff ,
47see the files \%\f[CB]COPYING\f[] and \%\f[CB]LICENSE\f[] in the top
48directory of the
49.I groff
50source package.
51.
52Or read the
53.I man\~page
54.BR gpl (1).
55You can also write to the
56.nh
57.B "Free Software Foundation, 51 Franklin St - Fifth Floor, Boston,"
58.BR "MA 02110-1301, USA" .
59.hy
60..
61.
62.
63.\" --------------------------------------------------------------------
64.\" Local macros
65.de FN
66.I \\$1
67..
68.
69.
70.\" --------------------------------------------------------------------
92d0a6a6 71.SH NAME
4d3e9548 72.
92d0a6a6 73grog \- guess options for groff command
4d3e9548
JL
74.
75.
76.\" --------------------------------------------------------------------
92d0a6a6 77.SH SYNOPSIS
4d3e9548
JL
78.
79.SY grog
80.OP \-C
81.RI [ \%groff\-option\~ .\|.\|.\&]
82.OP \-\-
83.RI [ \%filespec\~ .\|.\|.]
84.
85.SY grog
86.B \-h
87|
88.B \-\-help
89.
90.SY grog
91.B \-v
92|
93.B \-\-version
94.YS
95.
96.
97.\" --------------------------------------------------------------------
92d0a6a6 98.SH DESCRIPTION
4d3e9548 99.
92d0a6a6 100.B grog
4d3e9548
JL
101reads the input (file names or standard input) and guesses which of
102the
92d0a6a6 103.BR groff (@MAN1EXT@)
4d3e9548
JL
104options are needed to perform the input with the
105.B groff
106program.
107.
108The corresponding
109.B groff
110command is output.
111.
112.
113.\" --------------------------------------------------------------------
114.SH OPTIONS
115.
116The only
117.B grog
118options recognized are
119.B \-C
120(which is also passed on) to enable compatibility mode;
121.B \-v
122and
123.B \-\-version
124print information on the version number; and
125.B \-h
126and
127.B \-\-help
128print usage information.
129.
130.BR \-v ,
131.BR \-\-version ,
132.BR \-h ,
133and
134.B \-\-help
135stop the program directly without printing a
136.B groff
137command to standard output.
138.
139.
140.P
141All other specified short options (words starting with one minus
142character
143.BR \- )
144are interpreted as
145.B groff
146options or option clusters with or without argument.
147.
148No space is allowed between options and their argument.
149.
150Except from the
151.BI \-m arg
152options, all options will be passed on, i.e. they are included
153unchanged in the command for the output without effecting the work of
154.BR grog .
155.
156.
157.P
158A
159.I filespec
160argument can either be the name of an existing file or a single minus
161.B \-
162to mean standard input.
163.
164If no
165.I filespec
166is specified standard input is read automatically.
167.
168.
169.\" --------------------------------------------------------------------
170.SH DETAILS
171.
172.B grog
173reads all
174.I filespec
175parameters as a whole.
176.
177It tries to guess which of the following
178.B groff
179options are required for running the input under
180.BR groff :
92d0a6a6
JR
181.BR \-e ,
182.BR \-man ,
183.BR \-me ,
184.BR \-mm ,
185.BR \-mom ,
186.BR \-ms ,
187.BR \-mdoc,
188.BR \-mdoc-old,
189.BR \-p ,
190.BR \-R ,
191.BR \-g ,
192.BR \-G ,
193.BR \-s ,
194and
4d3e9548
JL
195.BR \-t .
196The guessed
197.B groff
198command including those options and the found
199.I filespec
200parameters is put on the standard output.
201.
202.
203.P
204It is possible to specify arbitrary
205.B groff
206options on the command line.
207.
208These are passed on the output without change, except for the
209.BI \-m arg
210options.
211.
212.
213.P
214The
215.B groff
216program has trouble when the wrong
217.BI \-m arg
218option or several of these options are specified.
219.
220In these cases,
221.B grog
222will print an error message and exit with an error code.
223.
224It is better to specify no
225.BI \-m arg
92d0a6a6 226option.
4d3e9548
JL
227.
228Because such an option is only accepted and passed when
229.B grog
230does not find any of these options or the same option is found.
231.
232.
233.P
234If several different
235.BI \-m arg
236options are found by
237.B grog
238an error message is produced and the program is terminated with an
239error code.
240.
241But the output is written with the wrong options nevertheless.
242.
243.
244.P
245Remember that it is not necessary to determine a macro package.
246.
247A
248.I roff
249file can also be written in the
250.I groff
251language without any macro package.
252.
253.B grog
254will produce an output without an
255.BI \-m arg
256option.
257.
258.
259.P
260As
261.B groff
262also works with pure text files without any
263.I roff
264requests,
265.B grog
266cannot be used to identify a file to be a
267.I roff
268file.
269.
270.
271.P
272The
273.BR groffer (@MAN1EXT@)
274program heavily depends on a working
275.BR grog .
276.
277.
278.P
279The
280.B grog
281source contains two files written in different programming languages:
282.
283.ft CB
284grog.pl
285.ft R
286is the
287.I Perl
288version, while
289.ft CB
290grog.sh
291.ft R
292is a shell script using
293BR awk (1).
294During the run of
295.BR make (1),
296it is determined whether the system contains a suitable version of
297.BR perl (1).
298If so,
299.ft CB
300grog.pl
301.ft R
302is transformed into
303.BR grog ;
304otherwise
305.ft CB
306grog.sh
307.ft R
308is used instead.
309.
310.
311.\" --------------------------------------------------------------------
312.SH EXAMPLES
313.
314.IP \(bu
315Calling
316.
317.RS
318.IP
319.EX
320grog meintro.me
321.EE
322.RE
323.
324.IP
325results in
326.
327.RS
328.IP
329.EX
330groff \-me meintro.me
331.EE
332.RE
333.
334.IP
335So
336.B grog
337recognized that the file
338.FN meintro.me
339is written with the
340.B \-me
341macro package.
342.RE
343.
344.
345.IP \(bu
346On the other hand,
347.
348.RS
349.IP
350.EX
351grog pic.ms
352.EE
353.RE
354.
355.IP
356outputs
357.
358.RS
359.IP
360.EX
361groff \-pte \-ms pic.ms
362.EE
363.RE
364.
365.IP
366Besides determining the macro package
367.BR \-ms ,
368.B grog
369recognized that the file
370.FN pic.ms
371additionally needs
372.BR \-pte ,
373the combination of
374.B \-p
375for
376.IR pic ,
377.B \-t
378for
379.IR tbl ,
380and
381.B \-e
382for
383.IR eqn .
384.RE
385.
386.
387.IP \(bu
388If both files are combined by the command
389.
390.RS
391.IP
392.EX
393grog meintro.me pic.ms
394.EE
395.RE
396.
397.IP
398an error message is sent to standard error because
399.B groff
400cannot work with two different macro packages:
401.
402.RS
403.IP
404.ft CR
405grog: error: there are several macro packages: -me -ms
406.ft
407.RE
408.
409.IP
410Additionally the corresponding output with the wrong options is printed
411to standard output:
412.
413.RS
414.IP
415.EX
416groff -pte -me -ms meintro.me pic.ms
417.EE
418.RE
419.
420.IP
421But the program is terminated with an error code.
422.
423.
424.IP \(bu
425The call of
426.
427.RS
428.IP
429.EX
430grog \-ksS \-Tdvi grnexmpl.g
431.EE
432.RE
433.
434.IP
435contains several
436.B groff
437options that are just passed on the output without any interface to
438.BR grog .
439These are the option cluster
440.B \-ksS
441consisting of
442.BR \-k ,
443.BR \-s ,
444and
445.BR \-S ;
446and the option
447.B \-T
448with argument
449.BR dvi .
450The output is
451.
452.RS
453.IP
454.EX
455groff \-ksS \-Tdvi grnexmpl.g
456.EE
457.RE
458.
459.IP
460so no additional option was added by
461.BR grog .
462As no option
463.BI \-m arg
464was found by
465.B grog
466this file does not use a macro package.
467.
468.
469.IP \(bu
470.B grog
471can also handle files using the
472.I chem
473language.
474.
475The example
476.
477.RS
478.IP
479.EX
480grog chAh_brackets.chem
481.EE
482.RE
483.
484.IP
485outputs
486.
487.RS
488.IP
489.EX
490chem chAh_brackets.chem | groff \-pe
491.EE
492.RE
493.
494.IP
495So
496.B chem
497is run first and
498.B groff
499is appended.
500.
501The option
502.B \-p
503for
504.B pic
505is implied automatically by
506.BR chem .
507Additionally, the file uses
508.I eqn
509with
510.BR \-e .
511.
512.
513.\" --------------------------------------------------------------------
92d0a6a6 514.SH "SEE ALSO"
4d3e9548 515.
92d0a6a6
JR
516.BR groff (@MAN1EXT@),
517.BR @g@troff (@MAN1EXT@),
518.BR @g@tbl (@MAN1EXT@),
519.BR @g@pic (@MAN1EXT@),
520.BR @g@eqn (@MAN1EXT@),
521.BR @g@refer (@MAN1EXT@),
522.BR @g@grn (@MAN1EXT@),
523.BR grap (1),
4d3e9548
JL
524.BR @g@soelim (@MAN1EXT@),
525.BR groff_me (@MAN7EXT@),
526.BR groff_ms (@MAN7EXT@),
527.BR groff_mm (@MAN7EXT@),
528.BR groff_mom (@MAN7EXT@),
529.BR groff_man (@MAN7EXT@),
530.BR groffer (@MAN1EXT@)
531.
532.
533.\" --------------------------------------------------------------------
534.SH "COPYING"
535.
536.co
537.
538.
539.\" --------------------------------------------------------------------
540.\" Emacs settings
541.\" --------------------------------------------------------------------
92d0a6a6
JR
542.
543.\" Local Variables:
544.\" mode: nroff
545.\" End: