14.3.4.3 Raising errors in a callback
The callback function should raise OptionValueError if there are any
problems with the option or its argument(s). optparse catches this and
terminates the program, printing the error message you supply to
stderr. Your message should be clear, concise, accurate, and mention
the option at fault. Otherwise, the user will have a hard time
figuring out what he did wrong.
Release 2.5.2, documentation updated on 21st February, 2008.
See About this document... for information on suggesting changes.
|