From: Havoc P. <hp...@re...> - 2003-04-06 16:04:00
|
On Sun, Apr 06, 2003 at 05:04:24PM +0200, Benjamin Otte wrote: > So what is "the right way" in this case? > I myself prefer exiting on any possible parsing errors, becuase a wrong > option obviously is a user error that should be corrected. Not correcting > it might make the program behave unexpected for the user, since he > supplied options that don't work as he expects them to. I'd say it's correct to exit with an informative message, generally speaking. Otherwise if you have a typo or something you'll never know. Also this is the standard UNIX behavior: $ ls --blah ls: unrecognized option `--blah' Try `ls --help' for more information. $ "echo" is a special case, the Single UNIX Specification specifies funky behavior for echo. Havoc |