From: LOLi Date: Sat, 18 Aug 2018 20:10:36 +0000 (+0200) Subject: Fix arcstat.py handling of unsupported options X-Git-Tag: zfs-0.8.0-rc1~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f87313ac830970088389a6d6e68fa3ce8194aff;p=zfs Fix arcstat.py handling of unsupported options This change allows the arcstat.py script to handle unsupported options gracefully and print both error and usage messages when one such option is provided. Reviewed-by: Giuseppe Di Natale Reviewed-by: George Melikov Reviewed-by: Brian Behlendorf Signed-off-by: loli10K Closes #7799 --- diff --git a/cmd/arcstat/arcstat.py b/cmd/arcstat/arcstat.py index 85c83ccc4..b52a8c294 100755 --- a/cmd/arcstat/arcstat.py +++ b/cmd/arcstat/arcstat.py @@ -285,7 +285,7 @@ def init(): ] ) except getopt.error as msg: - sys.stderr.write(msg) + sys.stderr.write("Error: %s\n" % str(msg)) usage() opts = None