--Apple-Mail-52-514739234
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed
Can someone tell me the difference between the on() and on_tail()
methods of OptionParser. I can't seem to figure it out. Thanks.
from optparse.rb:
=begin
--- OptionParser#on(*opts) [{...}]
--- OptionParser#def_option(*opts) [{...}]
--- OptionParser#on_head(*opts) [{...}]---
OptionParser#def_head_option(*opts) [{...}]
--- OptionParser#on_tail(*opts) [{...}]
--- OptionParser#def_tail_option(*opts) [{...}]
Defines option switch and handler. (({on_head})),
(({def_head_option}))
and (({on_tail})), (({def_tail_option})) put the switch at head
and tail of summary, respectively.
cf. ((<OptionParser#switch>)).
=end #'#"#`#
If you read down from there, on_tail/on add things to the end, of the
args list summary while on_head adds them to the front.
It looks like on_tail only exists to make things pretty.
--
Eric Hodel - (e-mail address removed) -
http://segment7.net
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04
--Apple-Mail-52-514739234
content-type: application/pgp-signature; x-mac-type=70674453;
name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCJnxJMypVHHlsnwQRAnLmAJ9kc6YZ1V6FEEcdhh2GaSmQflVZBgCgxn66
O3iMnECXq3gRhcbpO5x4HK4=
=mXMA
-----END PGP SIGNATURE-----
--Apple-Mail-52-514739234--