cmdr
Check-in [64bb90174f]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:New command for output to stderr, plus two higher-level helpers for headers and banners.
Timelines: family | ancestors | descendants | both | say-more
Files: files | file ages | folders
SHA1: 64bb90174fe50dfd22fca54aa47872ef33b2bf38
User & Date: andreask 2015-05-01 22:55:24.453
Context
2015-05-01
23:30
Notes on current state and future directions to work on. Leaf check-in: 4c80a42e4d user: andreask tags: say-more
22:55
New command for output to stderr, plus two higher-level helpers for headers and banners. check-in: 64bb90174f user: andreask tags: say-more
00:06
Tweaked options for "operation" command, extended a bit, plus slider & larson animation classes. check-in: e250dbed44 user: andreask tags: say-more
Changes
Unified Diff Ignore Whitespace Patch
Changes to say.tcl.
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
    namespace export say
}
namespace eval ::cmdr::say {
    namespace export \
	up down forw back \
	erase-screen erase-up erase-down \
	erase-line erase-back erase-forw \
	goto home line add line rewind lock-prefix clear-prefix \
	next next* animate barberpole percent progress-counter progress \
	ping pulse turn larson slider operation \
	\
	auto-width barber-phases progress-phases larson-phases \
	slider-phases pulse-phases turn-phases \
	\
	to

    namespace ensemble create







|

|







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
    namespace export say
}
namespace eval ::cmdr::say {
    namespace export \
	up down forw back \
	erase-screen erase-up erase-down \
	erase-line erase-back erase-forw \
	goto home line add trouble rewind lock-prefix clear-prefix \
	next next* animate barberpole percent progress-counter progress \
	ping pulse turn larson slider operation header banner \
	\
	auto-width barber-phases progress-phases larson-phases \
	slider-phases pulse-phases turn-phases \
	\
	to

    namespace ensemble create
190
191
192
193
194
195
196







197
198
199
200
201
202
203
    debug.cmdr/say {}
    variable pre    {}
    variable prefix {}
    puts  stdout $text
    flush stdout
    return
}








proc ::cmdr::say::rewind {} {
    debug.cmdr/say {}
    variable prefix
    erase-line \r$prefix
    return
}







>
>
>
>
>
>
>







190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
    debug.cmdr/say {}
    variable pre    {}
    variable prefix {}
    puts  stdout $text
    flush stdout
    return
}

proc ::cmdr::say::trouble {text} {
    debug.cmdr/say {}
    puts  stderr $text
    flush stderr
    return
}

proc ::cmdr::say::rewind {} {
    debug.cmdr/say {}
    variable prefix
    erase-line \r$prefix
    return
}
227
228
229
230
231
232
233












234
235
236
237
238
239
240
    debug.cmdr/say {}
    puts  stdout ""
    flush stdout
    return
}

# # ## ### ##### ######## ############# #####################













proc ::cmdr::say::operation {lead script args} {
    debug.cmdr/say {}

    set cmd     {}  ;# -play
    set delay   100 ;# -every
    set trailer OK  ;# -trailer, -no-trailer







>
>
>
>
>
>
>
>
>
>
>
>







234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
    debug.cmdr/say {}
    puts  stdout ""
    flush stdout
    return
}

# # ## ### ##### ######## ############# #####################

proc ::cmdr::say::header {text {filler -}} {
    debug.cmdr/say {}
    line \n${text}\n[string repeat $filler [string length $text]]
    return
}

proc ::cmdr::say::banner {text} {
    debug.cmdr/say {}
    line \n$text
    return
}

proc ::cmdr::say::operation {lead script args} {
    debug.cmdr/say {}

    set cmd     {}  ;# -play
    set delay   100 ;# -every
    set trailer OK  ;# -trailer, -no-trailer