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

NAME

6       grog - guess options for groff command
7

SYNOPSIS

9       grog [-C] [groff-option ...] [--] [filespec ...]
10       grog -h | --help
11       grog -v | --version
12

DESCRIPTION

14       grog  reads  the input (file names or standard input) and guesses which
15       of the groff(1) options are needed to perform the input with the  groff
16       program.  The corresponding groff command is output.
17

OPTIONS

19       The  only  grog  options recognized are -C (which is also passed on) to
20       enable compatibility mode; -v and --version print  information  on  the
21       version  number; and -h and --help print usage information.  -v, --ver‐
22       sion, -h, and --help stop the program directly without printing a groff
23       command to standard output.
24
25       All  other specified short options (words starting with one minus char‐
26       acter -) are interpreted as groff options or option  clusters  with  or
27       without  argument.  No space is allowed between options and their argu‐
28       ment.  Except from the -marg options, all options will  be  passed  on,
29       i.e.  they are included unchanged in the command for the output without
30       effecting the work of grog.
31
32       A filespec argument can either be the name of an  existing  file  or  a
33       single  minus  -  to  mean standard input.  If no filespec is specified
34       standard input is read automatically.
35

DETAILS

37       grog reads all filespec parameters as a whole.  It tries to guess which
38       of the following groff options are required for running the input under
39       groff: -e, -man, -me, -mm, -mom, -ms, -mdoc, -mdoc-old, -p, -R, -g, -G,
40       -s,  and -t.  The guessed groff command including those options and the
41       found filespec parameters is put on the standard output.
42
43       It is possible to specify arbitrary groff options on the command  line.
44       These  are  passed  on  the output without change, except for the -marg
45       options.
46
47       The groff program has trouble when the wrong -marg option or several of
48       these  options are specified.  In these cases, grog will print an error
49       message and exit with an error code.  It is better to specify no  -marg
50       option.   Because  such an option is only accepted and passed when grog
51       does not find any of these options or the same option is found.
52
53       If several different -marg options are found by grog an  error  message
54       is  produced and the program is terminated with an error code.  But the
55       output is written with the wrong options nevertheless.
56
57       Remember that it is not necessary to determine a macro package.  A roff
58       file  can also be written in the groff language without any macro pack‐
59       age.  grog will produce an output without an -marg option.
60
61       As groff also works with pure text files  without  any  roff  requests,
62       grog cannot be used to identify a file to be a roff file.
63
64       The groffer(1) program heavily depends on a working grog.
65
66       The  grog  source  contains  two files written in different programming
67       languages: grog.pl is the Perl version, while grog.sh is a shell script
68       using  awk(1).  During the run of make(1), it is determined whether the
69       system contains a suitable version  of  perl(1).   If  so,  grog.pl  is
70       transformed into grog; otherwise grog.sh is used instead.
71

EXAMPLES

73       ·      Calling
74
75                     grog meintro.me
76
77              results in
78
79                     groff -me meintro.me
80
81              So  grog recognized that the file meintro.me is written with the
82              -me macro package.
83
84       ·      On the other hand,
85
86                     grog pic.ms
87
88              outputs
89
90                     groff -pte -ms pic.ms
91
92              Besides determining the macro package -ms, grog recognized  that
93              the  file  pic.ms additionally needs -pte, the combination of -p
94              for pic, -t for tbl, and -e for eqn.
95
96       ·      If both files are combined by the command
97
98                     grog meintro.me pic.ms
99
100              an error message is sent to standard error because groff  cannot
101              work with two different macro packages:
102
103                     grog: error: there are several macro packages: -me -ms
104
105              Additionally  the corresponding output with the wrong options is
106              printed to standard output:
107
108                     groff -pte -me -ms meintro.me pic.ms
109
110              But the program is terminated with an error code.
111
112       ·      The call of
113
114                     grog -ksS -Tdvi grnexmpl.g
115
116              contains several groff options that are just passed on the  out‐
117              put without any interface to grog.  These are the option cluster
118              -ksS consisting of -k, -s, and -S; and the option -T with  argu‐
119              ment dvi.  The output is
120
121                     groff -ksS -Tdvi grnexmpl.g
122
123              so  no  additional option was added by grog.  As no option -marg
124              was found by grog this file does not use a macro package.
125

SEE ALSO

127       groff(1), troff(1), tbl(1), pic(1), chem(1), eqn(1), refer(1),  grn(1),
128       grap(1),     soelim(1),    groff_me(7),    groff_ms(7),    groff_mm(7),
129       groff_mom(7), groff_man(7), groffer(1)
130

COPYING

132       Copyright (C) 1989-2003, 2006, 2007, 2009-2012  Free  Software  Founda‐
133       tion,  Inc.   Written  by  James  Clark.   Maintained by Werner Lemberg
134       ⟨wl@gnu.org⟩.  Rewritten and put under  GPL  by  Bernd  Warken  <groff-
135       bernd.warken-72@web.de>.
136
137       This  file  is  part  of  grog, which is part of groff, a free software
138       project.  You can redistribute it and/or modify it under the  terms  of
139       the  GNU General Public License (GPL) as published by the Free Software
140       Foundation, either version 2, or (at your option) any later version.
141
142       You should have received a copy of the GNU General Public License along
143       with  groff,  see the files COPYING and LICENSE in the top directory of
144       the groff source package.  Or read the man page gpl(1).  You  can  also
145       write  to  the  Free Software Foundation, 51 Franklin St - Fifth Floor,
146       Boston, MA 02110-1301, USA.
147
148
149
150Groff Version 1.22.2            7 February 2013                        GROG(1)
Impressum