{
    "content": [
        {
            "type": "text",
            "text": "# lexgrog (info)\n\n## NAME\n\nlexgrog - parse header information in man pages\n\n## SYNOPSIS\n\nlexgrog [-m|-c] [-dfw?V] [-E encoding] file ...\n\n## DESCRIPTION\n\nlexgrog  is  an implementation of the traditional \"groff guess\" utility\nin lex.  It reads the list of files on its command line as  either  man\npage  source files or preformatted \"cat\" pages, and displays their name\nand description as used by apropos and whatis, the list of  preprocess-\ning  filters  required  by the man page before it is passed to nroff or\ntroff, or both.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (7 subsections)\n- **EXIT STATUS**\n- **EXAMPLES**\n- **WHATIS PARSING**\n- **SEE ALSO**\n- **NOTES**\n- **AUTHOR**\n- **BUGS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "lexgrog",
        "section": "",
        "mode": "info",
        "summary": "lexgrog - parse header information in man pages",
        "synopsis": "lexgrog [-m|-c] [-dfw?V] [-E encoding] file ...",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-d",
                "long": "--debug",
                "arg": null,
                "description": "Print debugging information."
            },
            {
                "flag": "-m",
                "long": "--man",
                "arg": null,
                "description": "Parse input as man page source files. This is the default if neither --man nor --cat is given."
            },
            {
                "flag": "-c",
                "long": "--cat",
                "arg": null,
                "description": "Parse input as preformatted man pages (\"cat pages\"). --man and --cat may not be given simultaneously."
            },
            {
                "flag": "-w",
                "long": "--whatis",
                "arg": null,
                "description": "Display the name and description from the man page's header, as used by apropos and whatis. This is the default if neither --whatis nor --filters is given."
            },
            {
                "flag": "-f",
                "long": "--filters",
                "arg": null,
                "description": "Display the list of filters needed to preprocess the man page before formatting with nroff or troff. -E encoding, --encoding encoding Override the guessed character set for the page to encoding. -?, --help Print a help message and exit."
            },
            {
                "flag": "",
                "long": "--usage",
                "arg": null,
                "description": "Print a short usage message and exit."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "Display version information."
            }
        ],
        "examples": [
            "$ lexgrog man.1",
            "man.1: \"man - an interface to the system reference manuals\"",
            "$ lexgrog -fw man.1",
            "man.1 (t): \"man - an interface to the system reference manuals\"",
            "$ lexgrog -c whatis.cat1",
            "whatis.cat1: \"whatis - display manual page descriptions\"",
            "$ lexgrog broken.1",
            "broken.1: parse failed"
        ],
        "see_also": [
            {
                "name": "apropos",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/apropos/1/json"
            },
            {
                "name": "man",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/man/1/json"
            },
            {
                "name": "whatis",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/whatis/1/json"
            },
            {
                "name": "mandb",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mandb/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-d, --debug",
                        "lines": 2,
                        "flag": "-d",
                        "long": "--debug"
                    },
                    {
                        "name": "-m, --man",
                        "lines": 3,
                        "flag": "-m",
                        "long": "--man"
                    },
                    {
                        "name": "-c, --cat",
                        "lines": 3,
                        "flag": "-c",
                        "long": "--cat"
                    },
                    {
                        "name": "-w, --whatis",
                        "lines": 4,
                        "flag": "-w",
                        "long": "--whatis"
                    },
                    {
                        "name": "-f, --filters",
                        "lines": 9,
                        "flag": "-f",
                        "long": "--filters"
                    },
                    {
                        "name": "--usage",
                        "lines": 2,
                        "long": "--usage"
                    },
                    {
                        "name": "-V, --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "EXIT STATUS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "WHATIS PARSING",
                "lines": 45,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "lexgrog - parse header information in man pages\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "lexgrog [-m|-c] [-dfw?V] [-E encoding] file ...\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "lexgrog  is  an implementation of the traditional \"groff guess\" utility\nin lex.  It reads the list of files on its command line as  either  man\npage  source files or preformatted \"cat\" pages, and displays their name\nand description as used by apropos and whatis, the list of  preprocess-\ning  filters  required  by the man page before it is passed to nroff or\ntroff, or both.\n\nIf its input is badly formatted, lexgrog  will  print  \"parse  failed\";\nthis  may  be useful for external programs that need to check man pages\nfor correctness.  If one of lexgrog's input files is \"-\", it will  read\nfrom  standard  input;  if any input file is compressed, a decompressed\nversion will be read automatically.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-d, --debug",
                        "content": "Print debugging information.\n",
                        "flag": "-d",
                        "long": "--debug"
                    },
                    {
                        "name": "-m, --man",
                        "content": "Parse input as man page source files.  This is  the  default  if\nneither --man nor --cat is given.\n",
                        "flag": "-m",
                        "long": "--man"
                    },
                    {
                        "name": "-c, --cat",
                        "content": "Parse  input as preformatted man pages (\"cat pages\").  --man and\n--cat may not be given simultaneously.\n",
                        "flag": "-c",
                        "long": "--cat"
                    },
                    {
                        "name": "-w, --whatis",
                        "content": "Display the name and description from the man page's header,  as\nused  by  apropos  and  whatis.   This is the default if neither\n--whatis nor --filters is given.\n",
                        "flag": "-w",
                        "long": "--whatis"
                    },
                    {
                        "name": "-f, --filters",
                        "content": "Display the list of filters needed to preprocess  the  man  page\nbefore formatting with nroff or troff.\n\n-E encoding, --encoding encoding\nOverride the guessed character set for the page to encoding.\n\n-?, --help\nPrint a help message and exit.\n",
                        "flag": "-f",
                        "long": "--filters"
                    },
                    {
                        "name": "--usage",
                        "content": "Print a short usage message and exit.\n",
                        "long": "--usage"
                    },
                    {
                        "name": "-V, --version",
                        "content": "Display version information.\n",
                        "flag": "-V",
                        "long": "--version"
                    }
                ]
            },
            "EXIT STATUS": {
                "content": "0      Successful program execution.\n\n1      Usage error.\n\n2      lexgrog failed to parse one or more of its input files.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "$ lexgrog man.1\nman.1: \"man - an interface to the system reference manuals\"\n$ lexgrog -fw man.1\nman.1 (t): \"man - an interface to the system reference manuals\"\n$ lexgrog -c whatis.cat1\nwhatis.cat1: \"whatis - display manual page descriptions\"\n$ lexgrog broken.1\nbroken.1: parse failed\n",
                "subsections": []
            },
            "WHATIS PARSING": {
                "content": "mandb  (which uses the same code as lexgrog) parses the NAME section at\nthe top of each manual page looking for names and descriptions  of  the\nfeatures documented in each.  While the parser is quite tolerant, as it\nhas to cope with a number of different  forms  that  have  historically\nbeen used, it may sometimes fail to extract the required information.\n\nWhen  using the traditional man macro set, a correct NAME section looks\nsomething like this:\n\n.SH NAME\nfoo \\- program to do something\n\nSome manual pagers require the '\\-' to be exactly as  shown;  mandb  is\nmore tolerant, but for compatibility with other systems it is neverthe-\nless a good idea to retain the backslash.\n\nOn the left-hand side, there may be several names, separated by commas.\nNames  containing  whitespace will be ignored to avoid pathological be-\nhaviour on certain ill-formed NAME sections.  The text  on  the  right-\nhand side is free-form, and may be spread over multiple lines.  If sev-\neral features with different descriptions are being documented  in  the\nsame manual page, the following form is therefore used:\n\n.SH NAME\nfoo, bar \\- programs to do something\n.br\nbaz \\- program to do nothing\n\n(A macro which starts a new paragraph, like .PP, may be used instead of\nthe break macro .br.)\n\nWhen using the BSD-derived mdoc macro set, a correct NAME section looks\nsomething like this:\n\n.Sh NAME\n.Nm foo\n.Nd program to do something\n\nThere  are  several common reasons why whatis parsing fails.  Sometimes\nauthors of manual pages replace '.SH NAME' with  '.SH  MYPROGRAM',  and\nthen  mandb  cannot find the section from which to extract the informa-\ntion it needs.  Sometimes authors include a  NAME  section,  but  place\nfree-form  text  there rather than 'name \\- description'.  However, any\nsyntax resembling the above should be accepted.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "apropos(1), man(1), whatis(1), mandb(8)\n",
                "subsections": []
            },
            "NOTES": {
                "content": "lexgrog attempts to parse files containing .so requests, but will  only\nbe  able  to  do  so correctly if the files are properly installed in a\nmanual page hierarchy.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "The code used by lexgrog to scan man pages was written by:\n\nWilf. (G.Wilford@ee.surrey.ac.uk).\nFabrizio Polacco (fpolacco@debian.org).\nColin Watson (cjwatson@debian.org).\n\nColin Watson wrote the current incarnation of the  command-line  front-\nend, as well as this man page.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "https://gitlab.com/cjwatson/man-db/-/issues\nhttps://savannah.nongnu.org/bugs/?group=man-db\n\n2.10.2                            2022-03-17                        LEXGROG(1)",
                "subsections": []
            }
        }
    }
}