File: Script.xotcl

package info (click to toggle)
xotcl 0.85.3-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,832 kB
  • ctags: 2,734
  • sloc: ansic: 18,065; tcl: 1,256; makefile: 653; sh: 430
file content (30 lines) | stat: -rw-r--r-- 743 bytes parent folder | download
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
28
29
30
#$Id: s.Script.xotcl 1.6 01/03/23 22:07:19+01:00 neumann@somewhere.wu-wien.ac.at $
package provide xotcl::script 0.9

@ @File {description {
  A small package to instantiate an object, that 
  represents a script.
  }
}
@ Class Script {
  description {
    An object of type Script becomes automatically the command
    line arguments evaluated as "-" method calls during creation, e.g.
    <@pre>
      Script s -set r 5
    </@pre>
    and a call with cmd-line "-set v 6" of the script, results in an
    object s with two vars set: r to 5, and v to 6.
  }
}



Class Script
Script proc create args {
  eval lappend args $::argv
  eval next $args
}
Script instproc unknown args {
  puts stderr "$::argv0: Unknown option -$args provided"
}