----- Original Message ----- From: "David Kastrup" <d...@gnu.org>
To: <lilypond-devel@gnu.org>
Sent: Friday, February 03, 2012 5:20 PM
Subject: Re: Another stderr/stdout question


"Phil Holmes" <em...@philholmes.net> writes:

The regtest option-help.ly emits the help text for ly:set-option.  The
idea is that the logfiles will thus be compared in the regtest
checking.  Only problem is that the list seems to go to stdout and the
logfiles are produced from stderr, so no checking actually occurs,
AFAICS.  This has the side effect (which is how I spotted it) of
sending the help text to the terminal screen rather than to logfiles,
when make doc is run.

What do we think: is it going to the wrong place, or should we do
something else with the regtest and make doc?

It is going to the wrong place.  At the very least, it should go to
current-output-port (as a function called from Scheme), but it bypasses
everything and goes straight to stdout.

The normal thing for it would be to get an optional port argument
defaulting to current-output-port.  Whether or not it does the
interpretation #f -> returned string, #t -> current-output-port that
format does is not all that important.  That would be nice but optional.

But stdout is not the right place to use for a Scheme function.

--
David Kastrup

Think program-option-scheme.cc is the guilty party:

LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (),
          "Print @code{ly:set-option} usage.")
{
 string help = get_help_string ();
 puts (help.c_str ());
 fflush (stdout);

 return SCM_UNSPECIFIED;
}



--
Phil Holmes



_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to