[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Parsing specific section of man page
From: |
Ted Harding |
Subject: |
Re: [Groff] Parsing specific section of man page |
Date: |
Sun, 22 Jan 2012 09:07:31 -0000 (GMT) |
On 22-Jan-2012 Siteshwar Vashisht wrote:
> Hi,
> Is there any option in groff to parse only a specifiec
> section of man page? For e.g. when I say
>
> groff -X -P -resolution -P100 -man passwd
>
> It parses and shows me the whole page. What if I want to
> parse only OPTIONS section ? I am looking for something like :-
>
> groff -X -P -resolution -P100 -man -parse-section "OPTIONS" passwd
>
> Regards,
> Siteshwar
> --
> "A belief may be larger than a fact."
> Vannevar Bush
No, groff always processes the entire document as presented
in the troff source for the document.
The only way to achieve what you want would be to edit the
source for "passwd", incorporating ".if [...]" requests
so that what is compiled by groff could depend on options
defined in the command-line. The option for that would
then be like
groff .... -dSection="OPTIONS" ....
and then, for every section in the man-page, include a ".if"
statement such that
a) If the string register "Section" is not defined then
include the section;
b) If "Section" is defined, then include the section if
"Section" matches the name of th section.
Even then, this would only output a single section. If you
wanted to choose more than one section you would have to
devise a more complicated system! (Could be done, but no-one
is going to re-write the man pages like this anyway)!
Ted.
-------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Date: 22-Jan-2012 Time: 09:07:26
This message was sent by XFMail
-------------------------------------------------
- [Groff] Parsing specific section of man page, Siteshwar Vashisht, 2012/01/22
- Re: [Groff] Parsing specific section of man page,
Ted Harding <=
- Re: [Groff] Parsing specific section of man page, Ralph Corderoy, 2012/01/22
- Message not available
- Re: [Groff] Parsing specific section of man page, Siteshwar Vashisht, 2012/01/22
- Re: [Groff] Parsing specific section of man page, Ingo Schwarze, 2012/01/22
- Re: [Groff] Parsing specific section of man page, Clarke Echols, 2012/01/22
- Re: [Groff] Parsing specific section of man page, Ralph Corderoy, 2012/01/22
- Re: [Groff] Parsing specific section of man page, Ted Harding, 2012/01/22
- Re: [Groff] Parsing specific section of man page, Ingo Schwarze, 2012/01/22
- Re: [Groff] Parsing specific section of man page, Ralph Corderoy, 2012/01/22