summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rwxr-xr-xcmd/arc_summary/arc_summary.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/cmd/arc_summary/arc_summary.py b/cmd/arc_summary/arc_summary.py
index 5da81347c..2472f87ea 100755
--- a/cmd/arc_summary/arc_summary.py
+++ b/cmd/arc_summary/arc_summary.py
@@ -977,9 +977,15 @@ def main():
global show_tunable_descriptions
global alternate_tunable_layout
- opts, args = getopt.getopt(
- sys.argv[1:], "adp:h", ["alternate", "description", "page=", "help"]
- )
+ try:
+ opts, args = getopt.getopt(
+ sys.argv[1:],
+ "adp:h", ["alternate", "description", "page=", "help"]
+ )
+ except getopt.error as e:
+ sys.stderr.write("Error: %s\n" % e.msg)
+ usage()
+ sys.exit(1)
args = {}
for opt, arg in opts:
@@ -991,7 +997,7 @@ def main():
args['p'] = arg
if opt in ('-h', '--help'):
usage()
- sys.exit()
+ sys.exit(0)
Kstat = get_Kstat()
@@ -1006,7 +1012,7 @@ def main():
except IndexError:
sys.stderr.write('the argument to -p must be between 1 and ' +
str(len(unSub)) + '\n')
- sys.exit()
+ sys.exit(1)
else:
pages = unSub