Hello,
In case I miss to use a mandatory option, I get a message something like this:
Mandatory option(s) missing: ...
Usage: java task. …
I just wanted to bring this to notice, that in this case, the system does not terminate with a non-zero return value. Also this message is not being sent to standard error. It is being sent to standard output. Is this a bug? If not, is it still possible to modify both (non-zero return value and usage message on standard error)?
--
Best,
Bhavesh Sanghvi
Sorry for the delay in the response, but yes, it will help me. The application uses the return value to decide whether or not the command executed properly or not.
1. For the time, the command is being executed, only the output stream is being read and the messages are displayed on progress bar as well as being stored in a temporary file. At the closing of output stream, the application assumes that command has terminated.
2. On receiving a zero return value, application assumes that the command executed properly. Then,
a. A project is created and it contains all the input and output files.
b. The temporary file (containing output stream messages) is stored as execution.log file in the project.
c. The error stream is ignored. If required, I can still display it on console (I just thought there is no need).
3. On receiving any non-zero return value, application assumes that the command did not executed properly. Then,
a. No, project is created.
b. The temporary file (containing output stream messages) is discarded. If required, I can still display it on console (I just thought there is no need).
c. The error stream is displayed on the console.
Hence, on receiving less arguments or any other error (e.g. a file with invalid data), if the message is shown on error stream and a non-zero value is returned, then the GUI will be more accurate. I think for the error case, it is already happening, but I have not tested much for various kinds of errors.
I also thought about a scenario in which user specifically wants to know the usage, say on using “/?” argument. In this case, please continue using zero return value and displaying the messages on output stream.
--
Best,
Bhavesh Sanghvi
-----Original Message-----
From: openb...@googlegroups.com [mailto:openb...@googlegroups.com] On Behalf Of Lúcio de Souza Coelho
Sent: Monday, July 21, 2008 12:40 PM
Subject: Re: Usage messages not being sent to Standard Error
A new jar (version 0.71) is available at the OpenBiomind project site.
All error/consistency check messages of all commands are now being
sent to Standard Error. I have not included yet the explicit -help
option in that release.