-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 R Kimber wrote: > On Sun, 09 Dec 2007 21:13:32 +0100 > Hrvoje Niksic wrote: > >>> I disagree again. If wget did not download a file, no matter what >>> the reason, then it should not exit with zero. I have written >>> several scripts that utilize wget to download files. Because wget >>> fails to issue a useful code upon completion, I am forced to use >>> hacks to find out what actually transpired. Curl utilizes certain >>> error codes, # 73 for instance, that are quite useful. >> I agree that Wget should allow the caller to find out what happened, >> but I don't think exit codes can be of much use there. For one, they >> don't allow distinction between different "successful" conditions, >> which is a problem in many cases. > > I'm not sure I understand this. Why is it that there cannot be > different exit codes for different 'successful' conditions? > > A program can exit under various conditions, some of which might be > situations in which errors occurred and some might be situations in > which no errors occurred but different things happened. Having exit > codes to indicate what actually happened seems eminently desirable, > and it's unclear to me why it is not possible.
I believe I already answered this: it is because a non-zero exit status always means "something's wrong". Myriad scripts invoke utilities in ways similar to: if ! wget http://foo.com/ then echo "Something went wrong with the download." fi If Wget starts using non-zero to mean a "special" kind of success, scripting suddenly becomes much more complicated (and Wget suddenly ceases to be "Unixy"). - -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXFv37M8hyUobTrERAjBMAJ9UB/zKsUt2rynPbYVu4MGjD9J55wCdGofh XxPdOAuW9Gq80V2Fhpygod8= =xsCk -----END PGP SIGNATURE-----