global env

set revn 140
set config 1
set unconfig 0

set i 0
foreach arg $argv {
   switch -glob -- $arg {
      -noconfig       { set config 0; set unconfig 0 }
      -unconfig       { set unconfig 1; set config 0 }
      -installdir     { set installDir       [lindex $argv [expr $i + 1]] }
      -rev            { set revn             [lindex $argv [expr $i + 1]] }
      -scripttosource { set scripttosource   [lindex $argv [expr $i + 1]] }
   }
   incr i
}

catch {source $scripttosource}

if { $config == 1 || $unconfig == 1 } {
   set config_dir "$installDir\\v$revn\\QA_Verification"

   set cmdPath ""
   if { $config == 1 } {
      set cmdPath "$config_dir\\AnsConfigTestBenchQA.exe"
   } else {
      #$unconfig
      set cmdPath "$config_dir\\AnsUnconfigTestBenchQA.exe"
   }

   puts "\nRunning $cmdPath"
   exec $cmdPath -install
}

