python-awips/awips/UsageOptionParser.py
Shay Carter 67c5c0b579 add in the /awips and /dynamicsearlize directories
- see if this satisfies the webpage building
2021-06-08 15:41:53 -06:00

18 lines
473 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)