File: parse.tcl

package info (click to toggle)
libapache2-mod-rivet 2.3.3-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 5,156 kB
  • ctags: 1,093
  • sloc: xml: 7,696; tcl: 6,939; ansic: 5,682; sh: 4,862; makefile: 199; sql: 91; lisp: 78
file content (27 lines) | stat: -rwxr-xr-x 602 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# the next line restarts using tclsh \
    exec tclsh "$0" "$@"

# Parse a rivet file and execute it.

if {![info exists argv]} { return }

# more consistent manipulation of auto_path as suggested by
# Harald Oehlmann. Fixes bug #52898

set auto_path [linsert $auto_path 0 [file dirname [info script]]]

package require tclrivet

proc main {} {
    global argv
    for {set i 0} {$i < [llength $argv] - 1} {incr i} {
        source [lindex $argv $i]
    }
    set script [rivet::parserivet [lindex $argv end]]
    if { [catch {eval $script } err] } {
        puts "Error: $err"
    }
}

main