From: marko Date: Thu, 1 Nov 2007 17:31:05 +0000 (+0000) Subject: Add a command line option "-e" or "--eid" for specifying a non-default X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=0d59a7cf1042da837a90499315d26693a6471464;p=imunes.git Add a command line option "-e" or "--eid" for specifying a non-default 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: --- diff --git a/imunes.tcl b/imunes.tcl index 752f9ce..ceda9a7 100755 --- a/imunes.tcl +++ b/imunes.tcl @@ -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. @@ -50,11 +50,26 @@ # 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