]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Add simple command line check for killSalomeWithPort.py script
authorvsr <vsr@opencascade.com>
Fri, 26 Oct 2012 15:10:43 +0000 (15:10 +0000)
committervsr <vsr@opencascade.com>
Fri, 26 Oct 2012 15:10:43 +0000 (15:10 +0000)
bin/killSalomeWithPort.py

index 705c8e3ca8e87cc6b2cfe0bce780011619b20f0d..be71c654b9c07e046b5de7540d96ddb82072ecb2 100755 (executable)
@@ -355,10 +355,19 @@ def killMyPortSpy(pid, port):
     return
 
 if __name__ == "__main__":
+    if len(sys.argv) < 2:
+        print "Usage: "
+        print "  %s <port>" % os.path.basename(sys.argv[0])
+        print
+        print "Kills SALOME session running on specified <port>."
+        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:]: