mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 14:57:56 -05:00
21 lines
480 B
Python
21 lines
480 B
Python
##
|
|
##
|
|
|
|
import sys
|
|
from optparse import OptionParser
|
|
|
|
class UsageOptionParser(OptionParser):
|
|
"""
|
|
A subclass of OptionParser that prints that overrides error() to print the
|
|
whole help text, rather than just the usage string.
|
|
"""
|
|
def error(self, msg):
|
|
"""
|
|
Print the help text and exit.
|
|
"""
|
|
self.print_help(sys.stderr)
|
|
sys.stderr.write("\n")
|
|
sys.stderr.write(msg)
|
|
sys.stderr.write("\n")
|
|
sys.exit(2)
|
|
|