-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstandard.tcl
113 lines (92 loc) · 2.64 KB
/
standard.tcl
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# -*- tcl -*- Copyright (c) 2012-2024 Andreas Kupries
# # ## ### ##### ######## ############# #####################
## Standard recipes.
## - null - no operation.
## - recipes - recipe list
## - help - recipe help
## - gui - standard GUI to recipes.
# # ## ### ##### ######## ############# #####################
kettle recipe define null {
No operation. Debugging helper (use with -trace).
} {} {}
kettle recipe define forever {
No operation, infinite loop. Debugging helper (use with -trace).
} {} {
file mkdir [set x [path tmpfile x]]
puts $x
while {1} {}
}
# # ## ### ##### ######## ############# #####################
kettle recipe define list-recipes {
List all available recipes, without details.
} {} {
io puts [lsort -dict [recipe names]]
}
kettle recipe define help-recipes {
Print the help.
} {} {
recipe help {Usage: }
}
kettle recipe define help-dump {
Print the help in Tcl format.
} {} {
recipe help-dump
}
kettle recipe parent help-recipes help
kettle recipe parent list-recipes list
# # ## ### ##### ######## ############# #####################
kettle recipe define list-options {
List all available options, without details.
} {} {
io puts [lsort -dict [option names]]
}
kettle recipe define help-options {
Print the help about options.
} {} {
option help
}
kettle recipe parent help-options help
kettle recipe parent list-options list
# # ## ### ##### ######## ############# #####################
kettle recipe define show-configuration {
Show the state of the option database.
} {} {
set names [lsort -dict [option names]]
io puts {}
foreach name $names padded [strutil padr $names] {
set value [option get $name]
if {[string match *\n* $value]} {
set value \n[strutil reflow $value "\t "]
}
io puts "\t$padded = $value"
}
}
kettle recipe define show-state {
Show the state
} {} {
set names [lsort -dict [option names @*]]
io puts {}
foreach name $names padded [strutil padr $names] {
set value [option get $name]
if {[string match *\n* $value]} {
set value \n[strutil reflow $value "\t "]
}
io puts "\t$padded = $value"
}
}
kettle recipe parent show-configuration show
kettle recipe parent show-state show
# # ## ### ##### ######## ############# #####################
kettle recipe define meta-status {
Status of meta data for Tcl packages and applications.
} {} {
meta show-status
}
# # ## ### ##### ######## ############# #####################
kettle recipe define gui {
Graphical interface to the system.
} {} {
gui make
}
# # ## ### ##### ######## ############# #####################
return