[texdoc] diagnostics

Manuel Pégourié-Gonnard mpg at elzevir.fr
Mon Feb 22 13:38:56 CET 2010


Manuel Pégourié-Gonnard a écrit :
> Too bad. Maybe I should check if DISPLAY is set before trying to display
> anything on Unix? Then I could issue a warning message before trying to lauch
> the viewer. (And/or default to list mode.)

texdoc issues a warning now.

mpg at roth:~% texdoc -w live
texdoc warning: DISPLAY is not set. Things may go wrong with you viewer.
texdoc warning: Try --list if you want results to be listed, not displayed.
mpg at roth:~% Error: Can't open display:

Hope it's ok. The point is, viewer are usually launched asynchronously ('xpdf
foobar.pdf &') so I can't really check the exit status.

> I guess I should rework this whole verbosity stuff. How about the following:
> 
> -v, --verbose	Be more verbose.
> -q, --quiet	Be less verbose.
> 
> -v could not be repeated, and would display the viewer command before launching
> it, and maybe a few other informations.
> 
> -q would suppress warnings, -q -q would suppress even errors (except internal
> errors, since I'm not sure how to suppress them). (And of course one would like
> to be able to say -qq rather than -q -q but that's another problem.)
> 
Finally, making -q -q work was a bit hard and didn't seem so useful, so here is
what I did:

  -q, --quiet           Suppress warnings and most error messages.
  -v, --verbose         Print additional information (eg, viewer command).
  -d, --debug[=list]    Print debug info for selected items (default: all).

Also, I suppressed the uselessly verbose parts of --debug output so that it's
only about 200 lines long now. (And now any debug option implies --verbose.)

-v=N and --verbosity-level=N are still accepted for compatibility, but they are
not advertised any more, and a warning message is issued.

I'll review a few other things, update the manual, and push the result to TL.

Manuel.



More information about the texdoc mailing list