[Gambas-user] control command line output

Tobias Boege taboege at gmail.com
Thu Aug 16 11:25:51 CEST 2018


On Wed, 15 Aug 2018, james at lixce.com wrote:
> I'm writing a spell check utility that uses hunspell to check a word typed or pasted into a textbox or provided as a command line arument.  When the utility is closed I want it to return the corrected word which is not a problem; a simple print statement in the Form_Close does that fine.
> 
> The problem is that I also get "qt5ct: using qt5ct plugin" on the command line whenever the utility is run.
> 
> I have tried including in the Form_Open:
> 
> nFile = Open "/dev/null" For Output
>   Error To nFile
>   Output To nFile
> 
> Which prevents the Print statement from working unless I redirect the stream again but leaves the "qt5ct: using qt5ct plugin" on the command line.
> 
> Calling the utility and redirecting error to NULL like:
> 
> lixce-spell word-to-check 2>/dev/null
> 
> works but it is not really graceful, I could write an alias or a script but once again not really graceful.
> 
> Is there any way within the Gambas basic code to suppress the "qt5ct: using qt5ct plugin" statement? 
> 

The question is where this line comes from and where it is going to.
It sounds like an informative message. Does it come from Gambas directly
or from hunspell, i.e. does it appear when you run your program but
replace every call to hunspell with a dummy line? And how are you using
hunspell, as a library or are you calling the external program?
The lines appears to be sent to stderr, right?

I'm going to assume that it doesn't come from Gambas. Then, if you use
the library, that's very undesirable behaviour and you should talk to
the hunspell people. If you use the external hunspell program, does it
have a switch to turn these informatives off? If not, but the message
arrives on stderr instead of stdout, you can capture and throw away
stderr in your Gambas program to prevent the message from coming through.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list