Version: (using KDE KDE 3.5.7) Installed from: Compiled From Sources OS: Linux Any application, that uses KCmdLineArgs for parse command line arguments exit with 254 exit status code with --help option. kmag --help kde-config --help kmixctrl --help echo $? 254
Created attachment 20884 [details] Fix above bporblem
Well, this was obviously done on purpose. The original developer of this code isn't active anymore, but I think it makes sense in a way: when you do konqueror --help, you didn't really "succeed" in launching a konqueror window, you only got a help message :-) Is this behavior of --help creating trouble somehow? Can you give more details about why this is a problem? One counter-argument is of course that `ls --help` returns 0.
Just my $0.02, but if you *asked* for --help, and it was displayed correctly, well... it successfully did what you asked. Whereas giving usage due to wrong arguments is of course different. Ditto with --version. Obviously KDE is not a GNU project (although I guess one can argue that --help/--version probably came from GNU), but for what it's worth, the GNU coding standards (http://www.gnu.org/prep/standards/standards.html#g_t_002d_002dhelp and also previous entry for --version) require this behavior ("The standard --help option should output brief documentation for how to invoke the program, on standard output, then exit successfully").
OK, agreed. This is why the first part of the patch is wrong, it should error when we go to usageError(). The second part of the patch is correct. And in fact I see now that it's already been changed in trunk, for KDE-4.0.