Changeset 2658 for trunk


Ignore:
Timestamp:
Nov 4, 2011, 11:57:32 AM (13 years ago)
Author:
dkearney
Message:

adding --tooldir flag to specify the location of where the tool.xml should have been found, this value is substituted into @tool by Rappture::Tool

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/apps/simsim.in

    r2608 r2658  
    620620    for {set i 0} {$i < $argc} {incr i} {
    621621        set opt [lindex $argv $i]
    622         if {("-t" == $opt) || ("-tool" == $opt) || ("--tool" == $opt)} {
     622        if { ("-t" == $opt)    ||
     623             ("-tool" == $opt) ||
     624             ("--tool" == $opt)   } {
    623625            if {[expr {$i + 1}] < $argc} {
    624626                incr i
    625627                set params(--tool) [lindex $argv $i]
    626628                # need to check to see if file exists, if not raise error
     629            } else {
     630                printHelp
     631            }
     632        } elseif {  ("-tooldir" == $opt) ||
     633                    ("--tooldir" == $opt)    } {
     634            if {[expr {$i + 1}] < $argc} {
     635                incr i
     636                set params(--tooldir) [lindex $argv $i]
     637                # need to check to see if directory exists, if not raise error
    627638            } else {
    628639                printHelp
     
    705716        --runfile ""
    706717        --tool "./tool.xml"
     718        --tooldir ""
    707719        oParams {}
    708720    }
     
    728740
    729741    set xmlobj [Rappture::library $params(--tool)]
    730     set installdir [file dirname $params(--tool)]
     742    if {$params(--tooldir) == ""} {
     743        set installdir [file dirname $params(--tool)]
     744    } else {
     745        set installdir $params(--tooldir)
     746    }
    731747
    732748    # need a better way to do this,
Note: See TracChangeset for help on using the changeset viewer.