*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Linux man pages -> lexgrog (1)              
Title
Content
Arch
Section
 

lexgrog(1)

Contents


NAME    [Toc]    [Back]

       lexgrog - parse header information in man pages

SYNOPSIS    [Toc]    [Back]

       lexgrog [-m|-c] [-fhwV] file ...

DESCRIPTION    [Toc]    [Back]

       lexgrog	is  an implementation of the traditional "groff guess" utility
       in lex.	It reads the list of files on its command line as  either  man
       page  source files or preformatted "cat" pages, and displays their name
       and description as used by apropos and whatis, the list of  preprocessing
  filters  required  by the man page before it is passed to nroff or
       troff, or both.

       If its input is badly formatted, lexgrog  will  print  "parse  failed";
       this  may  be useful for external programs that need to check man pages
       for correctness.  If one of lexgrog's input files is "-", it will  read
       from  standard  input;  if any input file is compressed, a decompressed
       version will be read automatically.

OPTIONS    [Toc]    [Back]

       -m, --man
	      Parse input as man page source files.  This is  the  default  if
	      neither --man nor --cat is given.

       -c, --cat
	      Parse  input as preformatted man pages ("cat pages").  --man and
	      --cat may not be given simultaneously.

       -w, --whatis
	      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.

       -f, --filters
	      Display the list of filters needed to preprocess	the  man  page
	      before formatting with nroff or troff.

       -h, --help
	      Print a help message and exit.

       -V, --version
	      Display version and author information.

EXIT STATUS    [Toc]    [Back]

       0      Successful program execution.

       1      Usage error.

       2      lexgrog failed to parse one or more of its input files.

EXAMPLES    [Toc]    [Back]

	 $ lexgrog man.1
	 man.1: "man - an interface to the on-line reference manuals"
	 $ lexgrog -fw man.1
	 man.1 (t): "man - an interface to the on-line reference manuals"
	 $ lexgrog -c whatis.cat1
	 whatis.cat1: "whatis - display manual page descriptions"
	 $ lexgrog broken.1
	 broken.1: parse failed

WHATIS PARSING    [Toc]    [Back]

       mandb  (which uses the same code as lexgrog) parses the NAME section at
       the top of each manual page looking for names and descriptions  of  the
       features documented in each.  While the parser is quite tolerant, as it
       has to cope with a number of different  forms  that  have  historically
       been used, it may sometimes fail to extract the required information.

       A correct NAME section looks something like this:

	      .SH NAME
	      foo \- program to do something

       Some  manual  pagers  require the `\-' to be exactly as shown; mandb is
       more tolerant, but for compatibility with other systems it is nevertheless
 a good idea to retain the backslash.

       On the left-hand side, there may be several names, separated by commas.
       The text on the right-hand side is free-form, and may  be  spread  over
       multiple  lines.   If  several features with different descriptions are
       being documented in the same manual page, the following form is	therefore
 used:

	      .SH NAME
	      foo, bar \- programs to do something
	      .br
	      baz \- program to do nothing

       (A macro which starts a new paragraph, like .PP, may be used instead of
       the break macro .br.)

       There are several common reasons why whatis parsing  fails.   Sometimes
       authors	of  manual  pages replace `.SH NAME' with `.SH MYPROGRAM', and
       then mandb cannot find the section from which to extract  the  information
  it  needs.   Sometimes  authors include a NAME section, but place
       free-form text there rather than `name \- description'.	 However,  any
       syntax resembling the above should be accepted.

SEE ALSO    [Toc]    [Back]

      
      
       man(1), mandb(8), apropos(1), whatis(1).

NOTES    [Toc]    [Back]

       lexgrog cannot parse files containing .so requests.  These are probably
       best checked by other problems, as lexgrog often does not  have	enough
       context to know what to do with them.

AUTHOR    [Toc]    [Back]

       The code used by lexgrog to scan man pages was written by:

       Wilf. ([email protected]).
       Fabrizio Polacco ([email protected]).
       Colin Watson ([email protected]).

       Colin  Watson  wrote the current incarnation of the command-line frontend,
 as well as this man page.



2.3.20			       07 September 2001		    lexgrog(1)
[ Back ]
 Similar pages
Name OS Title
mincore Linux get information on whether pages are in core
intro OpenBSD miscellaneous information pages
intro FreeBSD miscellaneous information pages
miscellaneous FreeBSD miscellaneous information pages
pmap_clear_modify FreeBSD set information about physical pages
pmap_clear_reference FreeBSD set information about physical pages
pmap_is_modified FreeBSD return information about physical pages
pmap_ts_modified FreeBSD return information about physical pages
prtvtoc IRIX print disk volume header information
istat IRIX print the header information of a list of image files.
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service