'error(message: string)
Prints a usage message incorporating the message to stderr and
exits.'

def error(self, message):

    self.print_usage(sys.stderr)
    choose_from = '    (choose    from'
    progparts = self.prog.partition('    ')
    self.exit(2, (_("error:    %(errmsg)s\nTry    '%(mainp)s    help    %(subp)s'    for    more    information.\n") % {'errmsg': message.split(choose_from)[0], 'mainp': progparts[0], 'subp': progparts[2]}))
