def cli_usage(msg=""):
    """ Output usage for command line tool. """
    sys.stderr.write(msg + "\n")
    sys.stderr.write(
        'Usage: xmlformat [--preserve "pre,literal"] [--blanks]\
 [--compress] [--selfclose] [--indent num] [--indent-char char]\
 [--outfile file] [--encoding enc] [--outencoding enc]\
 [--disable-inlineformatting] [--overwrite] [--disable-correction]\
 [--eof-newline]\
 [--help] <--infile file | file | - >\n'
    )
    sys.exit(2)