File: commands.tcl

package info (click to toggle)
libapache2-mod-rivet 3.2.2-1
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 6,296 kB
  • sloc: xml: 8,554; tcl: 7,568; ansic: 7,094; sh: 5,017; makefile: 195; sql: 91; lisp: 78
file content (34 lines) | stat: -rw-r--r-- 820 bytes parent folder | download | duplicates (4)
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
31
32
33
34
# -- commands.tcl
#
# testing the output of various commands that 
# provide a swiss knife for formatting, generating, etc.etc.
#


if {[::rivet::var exists cmd]} {

    set cmd [::rivet::var get cmd]
    switch $cmd {
        xml {

            # generic ::rivet::xml usage

            puts [::rivet::xml "a text string" a [list b a1 v1 a2 v2] [list c a1 v1 a2 v2]]
            puts [::rivet::xml "a text string" [list b a1 v1 a2 v2] [list c a1 v1 a2 v2] a]
            puts [::rivet::xml "" [list b a1 v1 a2 v2] [list c a1 v1 a2 v2] a]

            # self closing single element

            puts [::rivet::xml [list a a1 v1 a2 v2]]
            puts -nonewline [::rivet::xml br]
        }
        default {
            puts "invalid argument '$cmd'"
        }
    }

} else {

    puts "no cmd argument provided" 

}