Bug 6938 - arguments not checked when option found
Summary: arguments not checked when option found
Status: RESOLVED INVALID
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamassassin (show other bugs)
Version: 3.4.0
Hardware: PC Linux
: P2 trivial
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-28 17:21 UTC by jidanni
Modified: 2013-05-29 01:40 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description jidanni 2013-05-28 17:21:52 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
Comment 1 Karsten Bräckelmann 2013-05-28 22:12:21 UTC
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
Comment 2 jidanni 2013-05-29 00:53:01 UTC
$ 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.
Comment 3 Kevin A. McGrail 2013-05-29 00:54:55 UTC
What real world problems does this issue cause?
Comment 4 jidanni 2013-05-29 01:02:10 UTC
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.
Comment 5 Karsten Bräckelmann 2013-05-29 01:40:26 UTC
(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'.