From 9cb4e26b35c2442c2816dd9e6da28edf80e378c5 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 26 Oct 2012 15:10:43 +0000 Subject: [PATCH] Add simple command line check for killSalomeWithPort.py script --- bin/killSalomeWithPort.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index 705c8e3ca..be71c654b 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -355,10 +355,19 @@ def killMyPortSpy(pid, port): return if __name__ == "__main__": + if len(sys.argv) < 2: + print "Usage: " + print " %s " % os.path.basename(sys.argv[0]) + print + print "Kills SALOME session running on specified ." + sys.exit(1) + pass if sys.argv[1] == "--spy": - pid = sys.argv[2] - port = sys.argv[3] - killMyPortSpy(pid, port) + if len(sys.argv) > 3: + pid = sys.argv[2] + port = sys.argv[3] + killMyPortSpy(pid, port) + pass sys.exit(0) pass for port in sys.argv[1:]: -- 2.39.2