Print usage and msg and exit with given code.

def usage(ecode, msg=''):
    """
    Print usage and msg and exit with given code.
    """
    print >> sys.stderr, __doc__
    if msg:
        print >> sys.stderr, msg
    sys.exit(ecode)