Andreas Wenning wrote:
> Package: offlineimap
> Version: 5.99.4
> Severity: normal
> 
> Forwarded from Ubuntu, see:
> https://bugs.launchpad.net/ubuntu/+source/offlineimap/+bug/204572
> 
> When offlineimap is launched with an unrecognized command line option,
> it crashes with an exeption. It should not crash, simply show the help
> information. I guess, that offlineimap options parser should be
> modified.
> 
> The problem also exists in offlineimap 6.0.2

I'm not certain that this is really a bug.  OfflineIMAP is specifically
designed to yield a stack trace whenever it encounters a fatal error of
any sort, and to display a useful message at the bottom of the screen.
I believe that this helps with debugging, and in fact, it often does.
In this case, it is:

getopt.GetoptError: option --asdf not recognized

which pretty clearly states the problem, doesn't it?

$ rm --asdf
rm: unrecognized option `--asdf'
Try `rm --help' for more information.

rm --asdf doesn't display help.  Let's try some other commands:

$ gcc --asdf
gcc: no input files

sed --asdf displays help

so does awk

So there is really no consensus on whether full help should be shown.

I maintain that OfflineIMAP *should* crash when given incorrect options.
 And indeed, everything else does too:

$ gcc --asdf
gcc: no input files
$ echo $?
1
$ offlineimap --asdf
...
$ echo $?
1

so I would say it is standard to return a nonzero exit code when bad
options are given.

I think this bug ought to be closed, but what's your feedback?

-- John



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to