vovbuild Argument Parsing

Like in all Tcl scripts, command line arguments are passed using the variables argv0 and argv. If you need to pass parameters to the Flow Description, you can consider using the command line.

The best way to separate the vovbuild options from the options to be passed to the flow is to use the double dash "--". The double slash itself is passed to the flow description.

# The following code parses commands of the form:
# % vovbuild -f Flow.tcl -- -type gates -drc 

# Common way to parse command line options:
set blockType "undefined"
set doDrc      0
while { $argv != {} } {
    set arg   [shift]
    switch -glob -- $arg {
        "--"     { }
        "-type"  { set blockType [shift] }
        "-drc"   { set doDrc     1       }
        "-*"     { VovUserError "Unknown option '$arg'" }
        default  { VovUserError "Unknown argument '$arg'" }   
    }  
}