{
    "content": [
        {
            "type": "text",
            "text": "# grog(1) (man)\n\n**Summary:** grog - guess options for a following groff command\n\n**Synopsis:** grog [-C] [-T device] [--run] [--warnings] [--ligatures] [groff-option ...] [--] [filespec\n...]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -C | — | — | the generated groff command line. |\n| — | --ligatures | — | this option forces to include the arguments -P-y -PU within the generated groff com‐ mand line. --run with this option,  |\n| — | --warnings | — | with this option, some more warnings are output to standard error. All other specified short options (words starting wit |\n\n## Examples\n\n- `Calling`\n- `grog meintro.me`\n- `results in`\n- `groff -me meintro.me`\n- `So grog recognized that the file meintro.me is written with the -me macro package.`\n- `On the other hand,`\n- `grog pic.ms`\n- `outputs`\n- `groff -p -t -e -ms pic.ms`\n- `Besides  determining the macro package -ms, grog recognized that the file pic.ms additionally`\n- `needs -pte, the combination of -p for pic, -t for tbl, and -e for eqn.`\n- `If both of the former example files are combined by the command`\n- `grog meintro.me pic.ms`\n- `an error message is sent to standard error because groff cannot work with two different macro`\n- `packages:`\n- `grog: error: there are several macro packages: -me -ms`\n- `Additionally the corresponding output with the wrong options is printed to standard output:`\n- `groff -pte -me -ms meintro.me pic.ms`\n- `But the program is terminated with an error code.  The call of`\n- `grog -ksS -Tdvi grnexmpl.g`\n- `contains  several  groff  options that are just passed on the output without any interface to`\n- `grog.  These are the option cluster -ksS consisting of -k, -s, and -S; and the option -T with`\n- `argument dvi.  The output is`\n- `groff -k -s -S -Tdvi grnexmpl.g`\n- `so  no  additional  option was added by grog.  As no option -marg was found by grog this file`\n- `does not use a macro package.`\n\n## See Also\n\n- groff(1)\n- groffer(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (3 lines) — 4 subsections\n  - grog -h (1 lines)\n  - grog --help (1 lines)\n  - grog -v (1 lines)\n  - grog --version (1 lines)\n- **DESCRIPTION** (8 lines)\n- **OPTIONS** (5 lines) — 3 subsections\n  - -C (2 lines)\n  - --ligatures (6 lines)\n  - --warnings (11 lines)\n- **DETAILS** (28 lines)\n- **EXAMPLES** (27 lines)\n- **AUTHORS** (4 lines)\n- **SEE ALSO** (5 lines)\n\n## Full Content\n\n### NAME\n\ngrog - guess options for a following groff command\n\n### SYNOPSIS\n\ngrog [-C] [-T device] [--run] [--warnings] [--ligatures] [groff-option ...] [--] [filespec\n...]\n\n#### grog -h\n\n#### grog --help\n\n#### grog -v\n\n#### grog --version\n\n### DESCRIPTION\n\ngrog reads the input (file names or standard input) and guesses which of the groff(1) options\nare  needed  to  perform  the  input with the groff program.  A suitable device is now always\nwritten as -Tdevice including the groff default as -T ps.\n\nThe corresponding groff command is usually displayed in standard  output.   With  the  option\n--run,  the  generated  line is output into standard error and the generated groff command is\nrun on the standard output.  groffer(1) relies on a perfectly running groff(1).\n\n### OPTIONS\n\nThe option -v or --version prints information on the  version  number.   Also  -h  or  --help\nprints  usage  information.  Both of these options automatically end the grog program.  Other\noptions are thenignored, and no groff command line is generated.  The following 3 options are\nthe only grog options,\n\n#### -C\n\nthe generated groff command line.\n\n#### --ligatures\n\nthis option forces to include the arguments -P-y -PU within the generated  groff  com‐\nmand line.\n\n--run  with  this  option,  the  command line is output at standard error and then run on the\ncomputer.\n\n#### --warnings\n\nwith this option, some more warnings are output to standard error.\n\nAll other specified short options (words starting with one minus character -) are interpreted\nas  groff  options  or option clusters with or without argument.  No space is allowed between\noptions and their argument.  Except from the -marg options, all options will  be  passed  on,\ni.e.  they are included unchanged in the command for the output without effecting the work of\ngrog.\n\nA filespec argument can either be the name of an existing file or a single minus  -  to  mean\nstandard input.  If no filespec is specified standard input is read automatically.\n\n### DETAILS\n\ngrog  reads  all  filespec  parameters  as a whole.  It tries to guess which of the following\ngroff options are required for running the input under groff: -e, -g, -G, -j, -p, -R, -s,  -t\n(preprocessors); and -man, -mdoc, -mdoc-old, -me, -mm, -mom, and -ms (macro packages).\n\nThe guessed groff command including those options and the found filespec parameters is put on\nthe standard output.\n\nIt is possible to specify arbitrary groff options on the command line.  These are  passed  on\nthe output without change, except for the -marg options.\n\nThe  groff  program  has  trouble when the wrong -marg option or several of these options are\nspecified.  In these cases, grog will print an error message and exit with an error code.  It\nis  better  to  specify  no -marg option.  Because such an option is only accepted and passed\nwhen grog does not find any of these options or the same option is found.\n\nIf several different -marg options are found by grog an error message  is  produced  and  the\nprogram  is  terminated with an error code.  But the output is written with the wrong options\nnevertheless.\n\nRemember that it is not necessary to determine a macro package.  A  roff  file  can  also  be\nwritten in the groff language without any macro package.  grog will produce an output without\nan -marg option.\n\nAs groff also works with pure text files without any roff requests, grog cannot  be  used  to\nidentify a file to be a roff file.\n\nThe groffer(1) program heavily depends on a working grog.\n\n### EXAMPLES\n\nCalling\ngrog meintro.me\nresults in\ngroff -me meintro.me\nSo grog recognized that the file meintro.me is written with the -me macro package.\nOn the other hand,\ngrog pic.ms\noutputs\ngroff -p -t -e -ms pic.ms\nBesides  determining the macro package -ms, grog recognized that the file pic.ms additionally\nneeds -pte, the combination of -p for pic, -t for tbl, and -e for eqn.\nIf both of the former example files are combined by the command\ngrog meintro.me pic.ms\nan error message is sent to standard error because groff cannot work with two different macro\npackages:\ngrog: error: there are several macro packages: -me -ms\nAdditionally the corresponding output with the wrong options is printed to standard output:\ngroff -pte -me -ms meintro.me pic.ms\nBut the program is terminated with an error code.  The call of\ngrog -ksS -Tdvi grnexmpl.g\ncontains  several  groff  options that are just passed on the output without any interface to\ngrog.  These are the option cluster -ksS consisting of -k, -s, and -S; and the option -T with\nargument dvi.  The output is\ngroff -k -s -S -Tdvi grnexmpl.g\nso  no  additional  option was added by grog.  As no option -marg was found by grog this file\ndoes not use a macro package.\n\n### AUTHORS\n\ngrog was originally written by James Clark.  The current Perl implementation was  written  by\nBernd  Warken  ⟨groff-bernd.warken-72@web.de⟩  with contributions from Ralph Corderoy, and is\nmaintained by Werner Lemberg ⟨wl@gnu.org⟩.\n\n### SEE ALSO\n\ngroff(1), groffer(1)\n\n\n\ngroff 1.22.4                                23 March 2022                                    GROG(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "grog",
        "section": "1",
        "mode": "man",
        "summary": "grog - guess options for a following groff command",
        "synopsis": "grog [-C] [-T device] [--run] [--warnings] [--ligatures] [groff-option ...] [--] [filespec\n...]",
        "flags": [
            {
                "flag": "-C",
                "long": null,
                "arg": null,
                "description": "the generated groff command line."
            },
            {
                "flag": "",
                "long": "--ligatures",
                "arg": null,
                "description": "this option forces to include the arguments -P-y -PU within the generated groff com‐ mand line. --run with this option, the command line is output at standard error and then run on the computer."
            },
            {
                "flag": "",
                "long": "--warnings",
                "arg": null,
                "description": "with this option, some more warnings are output to standard error. All other specified short options (words starting with one minus character -) are interpreted as groff options or option clusters with or without argument. No space is allowed between options and their argument. Except from the -marg options, all options will be passed on, i.e. they are included unchanged in the command for the output without effecting the work of grog. A filespec argument can either be the name of an existing file or a single minus - to mean standard input. If no filespec is specified standard input is read automatically."
            }
        ],
        "examples": [
            "Calling",
            "grog meintro.me",
            "results in",
            "groff -me meintro.me",
            "So grog recognized that the file meintro.me is written with the -me macro package.",
            "On the other hand,",
            "grog pic.ms",
            "outputs",
            "groff -p -t -e -ms pic.ms",
            "Besides  determining the macro package -ms, grog recognized that the file pic.ms additionally",
            "needs -pte, the combination of -p for pic, -t for tbl, and -e for eqn.",
            "If both of the former example files are combined by the command",
            "grog meintro.me pic.ms",
            "an error message is sent to standard error because groff cannot work with two different macro",
            "packages:",
            "grog: error: there are several macro packages: -me -ms",
            "Additionally the corresponding output with the wrong options is printed to standard output:",
            "groff -pte -me -ms meintro.me pic.ms",
            "But the program is terminated with an error code.  The call of",
            "grog -ksS -Tdvi grnexmpl.g",
            "contains  several  groff  options that are just passed on the output without any interface to",
            "grog.  These are the option cluster -ksS consisting of -k, -s, and -S; and the option -T with",
            "argument dvi.  The output is",
            "groff -k -s -S -Tdvi grnexmpl.g",
            "so  no  additional  option was added by grog.  As no option -marg was found by grog this file",
            "does not use a macro package."
        ],
        "see_also": [
            {
                "name": "groff",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/groff/1/json"
            },
            {
                "name": "groffer",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/groffer/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": [
                    {
                        "name": "grog -h",
                        "lines": 1
                    },
                    {
                        "name": "grog --help",
                        "lines": 1
                    },
                    {
                        "name": "grog -v",
                        "lines": 1
                    },
                    {
                        "name": "grog --version",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 5,
                "subsections": [
                    {
                        "name": "-C",
                        "lines": 2,
                        "flag": "-C"
                    },
                    {
                        "name": "--ligatures",
                        "lines": 6,
                        "long": "--ligatures"
                    },
                    {
                        "name": "--warnings",
                        "lines": 11,
                        "long": "--warnings"
                    }
                ]
            },
            {
                "name": "DETAILS",
                "lines": 28,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 27,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}