From 29a813e38fbcf7657ff51dc8870e0004ef431484 Mon Sep 17 00:00:00 2001
From: Michael Marsh <mmarsh@cs.umd.edu>
Date: Mon, 19 Feb 2018 08:41:23 -0500
Subject: [PATCH] bug fixes

---
 netem.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/netem.py b/netem.py
index 6ae0d66..1e3456f 100755
--- a/netem.py
+++ b/netem.py
@@ -28,12 +28,16 @@ parser.add_argument('-L', '--loss',
 
 args = parser.parse_args()
 
+errs = False
 if args.device is None:
-    print STDERR, 'You must specify a device with --device.'
-    exit 1
+    print 'You must specify a device with --device.'
+    errs = True
 if args.namespace is None:
-    print STDERR, 'You must specify a network namespace with --namespace.'
-    exit 1
+    print 'You must specify a network namespace with --namespace.'
+    errs = True
+if errs:
+    print 'Run with --help for invocation syntax'
+    exit(1)
 
 # Enable network emulation on the device.
 cmd = ["sudo", "/sbin/ip",
-- 
GitLab