[Geany-Users] PHP_Beautifier

Matthew Brush mbrush at codebrainz.ca
Sun Nov 25 23:48:52 UTC 2012


On 12-11-25 02:44 PM, Lex Trotman wrote:
> [...]
>>> Right, but Geany thinks that since it returned messages on stderr that
>>> something went wrong with the command, so it doesn't do the
>>> substitution.  You should have a message along the line "The executed
>>> custom command returned an error. Your selection was not changed." in
>>> the status bar.
>>
>> What's the point about it BTW?  Normally a command exit status should be
>> the way to check, I don't see why we should make weird guess at a
>> command not being allowed to output something on stderr?
>>
>>
>
> Well, I don't know the original argument for doing it this way, but
> I've got two:
>
> 1. the command is meant to be a filter, stdin to stdout, anything on
> stderr almost certainly indicates a problem.
>

Filter programs sometimes use stderr as way to output status 
information/reports/warnings that shouldn't get piped to the normal 
output. IIRC the `tidy` utility does this by default.

> 2. sadly there are still filters that return zero if they fail and
> non-zero if they succeed (especially user written ones :), which means
> that you can't just test the return value.
>

Checking exit codes is pretty much the only sane way though and is the 
exact use for them.

Maybe checking exit code to determine success or failure and just having 
a status bar message if stderr is written to that says something to the 
effect of "The filter command wrote to the standard error stream, this 
might indicate a problem in your output." would be the way to go?

Cheers,
Matthew Brush



More information about the Users mailing list