[texdoc] texdoc machine readable output

Manuel Pégourié-Gonnard mpg at elzevir.fr
Wed Nov 11 18:48:37 CET 2009


Hi Adam,

For your information, I just added an option to texdoc allowing to
select more machine-friendly output. The command-line option is -M or
--machine.

The new output format is as follows:
- If only one argument was given, then each line of output is exactly
one file name.
- If more arguments were given, a line <tab>name is inserted before each
argument's result list.

Examples:

mpg at roth:~% texdoc -l -I -M live texlive-fr
	live
/usr/local/texlive/2009/texmf/doc/texlive/texlive-en/texlive-en.pdf
/usr/local/texlive/2009/texmf/doc/texlive/texlive-en/texlive-en.html
	texlive-fr
/usr/local/texlive/2009/texmf/doc/texlive/texlive-fr/texlive-fr.pdf
/usr/local/texlive/2009/texmf/doc/texlive/texlive-fr/texlive-fr.html
mpg at roth:~% texdoc -l -I -M live
/usr/local/texlive/2009/texmf/doc/texlive/texlive-en/texlive-en.pdf
/usr/local/texlive/2009/texmf/doc/texlive/texlive-en/texlive-en.html
mpg at roth:~%

(Please note that -M doesn't imply any other option like -l or -I.)

I also reworked the exit codes, which are now:
- 0: process exited normally (even if problems were encountered, like
unable to launch a viewer, no result found,  etc)
- 1: internal error (lua's error() or assert() functions). Please note
that in this case the error message is written on stdout, not stderr.
- 2: usage error.

Those changes are in the development version[1], which I'll probably
upload to texlive in a few days (this will be texdoc 0.5).

[1] http://tug.org/texdoc/dev/

Feel free to comment.

Manuel.


More information about the texdoc mailing list