SA Bugzilla – Bug 6938
arguments not checked when option found
Last modified: 2013-05-29 01:40:26 UTC
$ spamassassin x y z --version; echo $? SpamAssassin version 3.4.0-r1197259 running on Perl version 5.14.2 0 Compare $ cat x y z -t cat: x: No such file or directory cat: y: No such file or directory cat: z: No such file or directory $ less x y z -t x: No such file or directory y: No such file or directory z: No such file or directory -t: No such file or directory
This is a special case with the --version and --help options. $ spamassassin Without any arguments, it just sits there waiting for you to pump a message to STDIN. $ spamassassin x warn: archive-iterator: unable to open x: No such file or directory Errors out as expected. $ spamassassin x --version Simply returns after printing version information. This is expected behavior. Closing RESOLVED INVALID, aka "not a bug". Jidanni, you might want to try the following command. Don't file a bug report against coreutils, though. $ cat x --version
$ less x --version x: No such file or directory --version: No such file or directory $ less --version x less 458 (GNU regular expressions) Copyright (C) 1984-2012 Mark Nudelman less comes with NO WARRANTY, to the extent permitted by law. For information about the terms of redistribution, see the file named README in the less distribution. Homepage: http://www.greenwoodsoftware.com/less OK I give up.
What real world problems does this issue cause?
I was surprised that a script was sending spamassassin spamassassin --version and no error was caught. That the script was written by me is beside the point.
(In reply to jidanni from comment #2) > OK I give up. No need to give up. But to accept the fact that --version and --help options commonly ignore any other options, just dump the info, and exit. This is in no way specific to, nor broken behavior of 'spamassassin'.