]> git.entuzijast.net Git - imunes.git/commitdiff
Add a command line option "-e" or "--eid" for specifying a non-default
authormarko <marko>
Thu, 1 Nov 2007 17:31:05 +0000 (17:31 +0000)
committermarko <marko>
Thu, 1 Nov 2007 17:31:05 +0000 (17:31 +0000)
experiment ID.

This might be particularly usefull in combination with imunes -b
for cleaning up a running / stale experiment.

Bug found by:
Submitted by:
Reviewed by:
Approved by:
Obtained from:

imunes.tcl

index 752f9ce6530d3b284dcd505aa1f1965946ec5615..ceda9a7cbba78896a3de3784312a11223ba18e0b 100755 (executable)
@@ -1,4 +1,4 @@
-# $Id: imunes.tcl,v 1.27 2007/11/01 10:42:27 marko Exp $ 
+# $Id: imunes.tcl,v 1.28 2007/11/01 17:31:05 marko Exp $ 
 #
 # Copyright 2004, 2005 University of Zagreb, Croatia.  All rights reserved.
 #
@@ -41,7 +41,7 @@
 #    Starts imunes in batch or interactive mode. Include procedures from
 #    external files and initializes global variables.
 #
-#      imunes [-b|--batch] [filename]
+#      imunes [-b|--batch] [-e|--eid experiment_id] [filename]
 #    
 #    When starting the program in batch mode the option -b or --batch must 
 #    be specified. 
 #    file "filename" is loaded to imunes.
 #****
 
-if {[lindex $argv 0] == "-b" || [lindex $argv 0] == "--batch"} {
-    set argv [lrange $argv 1 end]
-    set execMode batch
-} else {
-    set execMode interactive
+set execMode interactive
+set eid imunes_[pid]
+
+while { [string index [lindex $argv 0] 0] == "-" } {
+    switch -exact -- [lindex $argv 0] {
+       "-b" -
+       "--batch" {
+           set execMode batch
+           set argv [lrange $argv 1 end]
+       }
+       "-e" -
+       "--eid" {
+           set eid [lindex $argv 1]
+           set argv [lrange $argv 2 end]
+       }
+       default {
+           puts "unrecognized option: [lindex $argv 0]"
+           exit 1
+       }
+    }
 }
 
 # 
@@ -166,7 +181,6 @@ set node_list {}
 set link_list {}
 set annotation_list {}
 set canvas_list {}
-set eid imunes_[pid]
 
 #****v* imunes.tcl/exec_hosts
 # NAME