Browse Source

punk::args and punk::ns improvements, command help with 'i'

master
Julian Noble 1 month ago
parent
commit
de8c5ff7ad
  1. 76
      src/bootsupport/modules/punk-0.1.tm
  2. 140
      src/bootsupport/modules/punk/ansi-0.1.1.tm
  3. 1680
      src/bootsupport/modules/punk/args-0.1.0.tm
  4. 35
      src/bootsupport/modules/punk/config-0.1.tm
  5. 5
      src/bootsupport/modules/punk/console-0.1.1.tm
  6. 19
      src/bootsupport/modules/punk/fileline-0.1.0.tm
  7. 190
      src/bootsupport/modules/punk/lib-0.1.1.tm
  8. 2
      src/bootsupport/modules/punk/mix/commandset/layout-0.1.0.tm
  9. 37
      src/bootsupport/modules/punk/mix/commandset/loadedlib-0.1.0.tm
  10. 70
      src/bootsupport/modules/punk/mix/commandset/module-0.1.0.tm
  11. 1016
      src/bootsupport/modules/punk/ns-0.1.0.tm
  12. 31
      src/bootsupport/modules/punk/path-0.1.0.tm
  13. 23
      src/bootsupport/modules/punk/repl/codethread-0.1.1.tm
  14. 4
      src/bootsupport/modules/shellfilter-0.1.9.tm
  15. 507
      src/bootsupport/modules/textblock-0.1.2.tm
  16. 323
      src/embedded/man/files/_module_termscheme-0.1.0.tm.n
  17. 4
      src/embedded/man/files/punk/_module_ansi-0.1.1.tm.n
  18. 20
      src/embedded/man/files/punk/_module_args-0.1.0.tm.n
  19. 4
      src/embedded/man/files/punk/_module_console-0.1.1.tm.n
  20. 2
      src/embedded/man/files/punk/_module_lib-0.1.1.tm.n
  21. 328
      src/embedded/man/files/punk/_module_safe-0.1.0.tm.n
  22. 326
      src/embedded/man/files/punk/_module_sixel-0.1.0.tm.n
  23. 325
      src/embedded/man/files/punk/args/_module_tclcore-0.1.0.tm.n
  24. 4
      src/embedded/man/files/punk/nav/_module_fs-0.1.0.tm.n
  25. 8
      src/embedded/man/files/punk/repl/_module_codethread-0.1.0.tm.n
  26. 318
      src/embedded/man/files/punk/repl/_module_codethread-0.1.1.tm.n
  27. 47
      src/embedded/man/index.n
  28. 27
      src/embedded/man/toc.n
  29. 9
      src/embedded/md/.doc/tocdoc
  30. 2
      src/embedded/md/.idx
  31. 2
      src/embedded/md/.toc
  32. 2
      src/embedded/md/.xrf
  33. 87
      src/embedded/md/doc/files/_module_termscheme-0.1.0.tm.md
  34. 4
      src/embedded/md/doc/files/punk/_module_ansi-0.1.1.tm.md
  35. 26
      src/embedded/md/doc/files/punk/_module_args-0.1.0.tm.md
  36. 4
      src/embedded/md/doc/files/punk/_module_console-0.1.1.tm.md
  37. 2
      src/embedded/md/doc/files/punk/_module_lib-0.1.1.tm.md
  38. 95
      src/embedded/md/doc/files/punk/_module_safe-0.1.0.tm.md
  39. 89
      src/embedded/md/doc/files/punk/_module_sixel-0.1.0.tm.md
  40. 90
      src/embedded/md/doc/files/punk/args/_module_tclcore-0.1.0.tm.md
  41. 6
      src/embedded/md/doc/files/punk/nav/_module_fs-0.1.0.tm.md
  42. 8
      src/embedded/md/doc/files/punk/repl/_module_codethread-0.1.0.tm.md
  43. 87
      src/embedded/md/doc/files/punk/repl/_module_codethread-0.1.1.tm.md
  44. 18
      src/embedded/md/doc/toc.md
  45. 10
      src/embedded/md/index.md
  46. 18
      src/embedded/md/toc.md
  47. 9
      src/embedded/www/.doc/tocdoc
  48. 2
      src/embedded/www/.idx
  49. 2
      src/embedded/www/.toc
  50. 2
      src/embedded/www/.xrf
  51. 192
      src/embedded/www/doc/files/_module_termscheme-0.1.0.tm.html
  52. 4
      src/embedded/www/doc/files/punk/_module_ansi-0.1.1.tm.html
  53. 24
      src/embedded/www/doc/files/punk/_module_args-0.1.0.tm.html
  54. 2
      src/embedded/www/doc/files/punk/_module_console-0.1.1.tm.html
  55. 1
      src/embedded/www/doc/files/punk/_module_lib-0.1.1.tm.html
  56. 197
      src/embedded/www/doc/files/punk/_module_safe-0.1.0.tm.html
  57. 185
      src/embedded/www/doc/files/punk/_module_sixel-0.1.0.tm.html
  58. 193
      src/embedded/www/doc/files/punk/args/_module_tclcore-0.1.0.tm.html
  59. 8
      src/embedded/www/doc/files/punk/nav/_module_fs-0.1.0.tm.html
  60. 14
      src/embedded/www/doc/files/punk/repl/_module_codethread-0.1.0.tm.html
  61. 187
      src/embedded/www/doc/files/punk/repl/_module_codethread-0.1.1.tm.html
  62. 60
      src/embedded/www/doc/toc.html
  63. 10
      src/embedded/www/index.html
  64. 60
      src/embedded/www/toc.html
  65. 32
      src/modules/argparsingtest-999999.0a1.0.tm
  66. 4
      src/modules/patternpunk-1.1.tm
  67. 26
      src/modules/poshinfo-999999.0a1.0.tm
  68. 76
      src/modules/punk-0.1.tm
  69. 140
      src/modules/punk/ansi-999999.0a1.0.tm
  70. 1680
      src/modules/punk/args-999999.0a1.0.tm
  71. 700
      src/modules/punk/args/tclcore-999999.0a1.0.tm
  72. 3
      src/modules/punk/args/tclcore-buildversion.txt
  73. 57
      src/modules/punk/blockletter-999999.0a1.0.tm
  74. 35
      src/modules/punk/config-0.1.tm
  75. 5
      src/modules/punk/console-999999.0a1.0.tm
  76. 19
      src/modules/punk/fileline-999999.0a1.0.tm
  77. 190
      src/modules/punk/lib-999999.0a1.0.tm
  78. 2
      src/modules/punk/mix/commandset/layout-999999.0a1.0.tm
  79. 26
      src/modules/punk/mix/commandset/loadedlib-999999.0a1.0.tm
  80. 70
      src/modules/punk/mix/commandset/module-999999.0a1.0.tm
  81. 1016
      src/modules/punk/ns-999999.0a1.0.tm
  82. 31
      src/modules/punk/path-999999.0a1.0.tm
  83. 422
      src/modules/punk/repl-0.1.tm
  84. 23
      src/modules/punk/repl/codethread-999999.0a1.0.tm
  85. 116
      src/modules/punk/safe-999999.0a1.0.tm
  86. 2
      src/modules/punk/sixel-999999.0a1.0.tm
  87. 4
      src/modules/shellfilter-0.1.9.tm
  88. 507
      src/modules/textblock-999999.0a1.0.tm
  89. 76
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk-0.1.tm
  90. 140
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/ansi-0.1.1.tm
  91. 1680
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/args-0.1.0.tm
  92. 35
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/config-0.1.tm
  93. 5
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/console-0.1.1.tm
  94. 19
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/fileline-0.1.0.tm
  95. 190
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/lib-0.1.1.tm
  96. 2
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/mix/commandset/layout-0.1.0.tm
  97. 37
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/mix/commandset/loadedlib-0.1.0.tm
  98. 70
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/mix/commandset/module-0.1.0.tm
  99. 1016
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/ns-0.1.0.tm
  100. 31
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/path-0.1.0.tm
  101. Some files were not shown because too many files have changed in this diff Show More

76
src/bootsupport/modules/punk-0.1.tm

@ -9,7 +9,7 @@ namespace eval punk {
zzzload::pkg_require $pkg
}
}
#lazyload twapi
#lazyload twapi ?
catch {package require vfs} ;#attempt load now so we can use faster 'package provide' to test existence later
}
@ -3670,7 +3670,7 @@ namespace eval punk {
incr i
}
#JMN2
#JMN2 - review
#set returnval [lindex $assigned_values 0]
if {[llength $assigned_values] == 1} {
set returnval [join $assigned_values]
@ -7271,55 +7271,59 @@ namespace eval punk {
catch {
package require patternpunk
#lappend chunks [list stderr [>punk . rhs]]
append mascotblock [textblock::frame [>punk . banner -title "Punk Shell" -left Tcl -right [package provide Tcl]]]
append mascotblock [textblock::frame -checkargs 0 [>punk . banner -title "Punk Shell" -left Tcl -right [package provide Tcl]]]
}
set topic [lindex $args end]
set argopts [lrange $args 0 end-1]
set text ""
append text "Punk core navigation commands:\n"
set title "[a+ brightgreen] Punk core navigation commands: "
#todo - load from source code annotation?
set cmdinfo [list]
lappend cmdinfo [list help "This help. To see available subitems type: help topics"]
lappend cmdinfo [list dev "(ensemble command to make new projects/modules and to generate docs)"]
lappend cmdinfo [list a? "view ANSI colours\n e.g a? web"]
lappend cmdinfo [list ./ "view/change directory"]
lappend cmdinfo [list ../ "go up one directory"]
lappend cmdinfo [list ./new "make new directory and switch to it"]
lappend cmdinfo [list n/ "view/change namespace (accepts ns path globs e.g **::*get* to match comands at any level )"]
lappend cmdinfo [list n// "view/change namespace (with command listing)"]
lappend cmdinfo [list nn/ "go up one namespace"]
lappend cmdinfo [list n/new "make child namespace and switch to it"]
set cmds [lsearch -all -inline -index 0 -subindices $cmdinfo *]
set descr [lsearch -all -inline -index 1 -subindices $cmdinfo *]
set widest1 [tcl::mathfunc::max {*}[lmap v $cmds {string length $v}]]
set widest2 [tcl::mathfunc::max {*}[lmap v $descr {string length $v}]]
lappend cmdinfo [list help "?topics?" "This help. To see available subitems type: help topics"]
lappend cmdinfo [list i "cmd ?subcommand...?" "Show usage for a command or ensemble subcommand"]
lappend cmdinfo [list ./ "?subdir?" "view/change directory"]
lappend cmdinfo [list ../ "" "go up one directory"]
lappend cmdinfo [list ./new "subdir" "make new directory and switch to it"]
lappend cmdinfo [list n/ "?glob...?" "view/change namespace\n (accepts ns path globs e.g **::*get* to match comands at any level )"]
lappend cmdinfo [list n// "" "view/change namespace (with command listing)"]
lappend cmdinfo [list "nn/" "" "go up one namespace"]
lappend cmdinfo [list "n/new" "<ns>" "make child namespace and switch to it"]
lappend cmdinfo [list dev "?subcommand?" "(ensemble command to make new projects/modules and to generate docs)"]
lappend cmdinfo [list a? "?subcommand...?" "view ANSI colours\n e.g a? web"]
#set cmds [lsearch -all -inline -index 0 -subindices $cmdinfo *]
#set descr [lsearch -all -inline -index 1 -subindices $cmdinfo *]
#set widest1 [tcl::mathfunc::max {*}[lmap v $cmds {string length $v}]]
#set widest2 [tcl::mathfunc::max {*}[lmap v $descr {string length $v}]]
set t [textblock::class::table new -show_seps 0]
foreach c $cmds d $descr {
#append text " [overtype::left $col1 $c][overtype::left $col2 $d]" \n
$t add_row [list $c $d]
}
set widest1 [$t column_datawidth 0]
$t configure_column 0 -minwidth [expr {$widest1 + 2}]
set widest2 [$t column_datawidth 1]
$t configure_column 1 -minwidth [expr {$widest2 + 1}]
#foreach c $cmds d $descr {
# $t add_row [list $c $d]
#}
foreach row $cmdinfo {
$t add_row $row
}
set width_0 [$t column_datawidth 0]
$t configure_column 0 -minwidth [expr {$width_0 + 2}]
set width_1 [$t column_datawidth 1]
$t configure_column 1 -minwidth [expr {$width_1 + 1}]
$t configure -title $title
set text ""
append text [$t print]
set warningblock ""
set introblock $mascotblock
append introblock \n $text
if {[catch {package require textblock} errM]} {
set introblock $mascotblock
append introblock \n $text
append warningblock \n "WARNING: textblock package couldn't be loaded. Side-by-side display not available"
} else {
set introblock [textblock::join -- " " \n$mascotblock " " $text]
}
#if {[catch {package require textblock} errM]} {
# append warningblock \n "WARNING: textblock package couldn't be loaded. Side-by-side display not available"
#} else {
# set introblock [textblock::join -- " " \n$mascotblock " " $text]
#}
lappend chunks [list stdout $introblock]

140
src/bootsupport/modules/punk/ansi-0.1.1.tm

@ -132,14 +132,29 @@ tcl::namespace::eval punk::ansi::class {
set rendered [overtype::renderspace -cp437 1 -expand_right 0 -wrap 1 -width $w -height $h -appendlines 1 "" [$o_ansistringobj get]]
return $rendered
}
lappend ::punk::ansi::class::PUNKARGS [list {
*id "punk::ansi::class::class_ansi render_to_input_line"
*proc -name "punk::ansi::class::class_ansi render_to_input_line" -help\
"render string from line 0 to line
(experimental/debug)"
-dimensions -type string -help\
"WxH where W is integer width >= 1 and H is integer heigth >= 1"
-minus -type integer -help\
"number of chars to exclude from end"
*values -min 1 -max 1
line -type indexexpression
}]
method render_to_input_line {args} {
if {[llength $args] < 1} {
puts stderr "render_to_input_line usage: ?-dimensions WxH? ?-minus charcount? x"
punk::args::get_by_id "punk::ansi::class::class_ansi render_to_input_line" $args
}
set x [lindex $args end]
set arglist [lrange $args 0 end-1]
if {[llength $arglist] %2 != 0} {
puts stderr "render_to_input_line usage: ?-dimensions WxH? ?-minus charcount? x"
punk::args::get_by_id "punk::ansi::class::class_ansi render_to_input_line" $args
}
set opts [tcl::dict::create\
-dimensions 80x24\
@ -322,6 +337,7 @@ tcl::namespace::eval punk::ansi::class {
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
tcl::namespace::eval punk::ansi {
variable PUNKARGS
#*** !doctools
#[subsection {Namespace punk::ansi}]
#[para] Core API functions for punk::ansi
@ -422,6 +438,8 @@ tcl::namespace::eval punk::ansi {
erase*\
get_*\
hyperlink\
hyperlink_open\
hyperlink_close\
move*\
reset*\
ansistrip*\
@ -554,21 +572,35 @@ tcl::namespace::eval punk::ansi {
$obj destroy
return $result
}
proc example {args} {
set base [punk::repo::find_project]
set default_ansifolder [file join $base src/testansi]
set argd [punk::args::get_dict [tstr -return string {
proc Get_ansifolder {} {
if {[catch {punk::repo::find_project} base]} {
set base ""
}
if {$base eq ""} {
#pwd not avail in safe interp
if {![catch {pwd} CWD]} {
set base $CWD
}
}
return [file join $base src/testansi]
}
lappend PUNKARGS [list -dynamic 1 {
*id punk::ansi::example
*proc -name punk::ansi::example -help "Display .ans image files in a grid that will fit in console
"
-colwidth -default 82 -help "Width of each column - default of 82 will fit a standard 80wide ansi image (when framed)
You can specify a narrower width to truncate images on the right side"
-folder -default "${$default_ansifolder}" -help "Base folder for files if relative paths are used.
-folder -default "${[punk::ansi::Get_ansifolder]}" -help "Base folder for files if relative paths are used.
Defaults to <projectbase>/src/testansi - where projectbase is determined from current directory.
"
*values -min 0 -max -1
files -default {belinda.ans bot.ans flower.ans fish.ans} -multiple true -help "List of filenames - leave empty to display 4 defaults"
}] $args]
} ""]
proc example {args} {
set argd [punk::args::get_by_id punk::ansi::example $args]
set colwidth [dict get $argd opts -colwidth]
set ansifolder [file normalize [dict get $argd opts -folder]]
set fnames [dict get $argd values files]
@ -621,7 +653,7 @@ tcl::namespace::eval punk::ansi {
set subtitle [tcl::dict::get $picinfo status]
}
set title [tcl::dict::get $picinfo filename]
set fr [textblock::frame -width $colwidth -subtitle $subtitle -title $title [tcl::dict::get $picinfo pic]]
set fr [textblock::frame -checkargs 0 -width $colwidth -subtitle $subtitle -title $title [tcl::dict::get $picinfo pic]]
# -- --- --- ---
#we need the max height of a row element to use join_basic instead of join below
# -- --- --- ---
@ -2320,16 +2352,23 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
set sgr_cache [tcl::dict::create]
#sgr_cache clear called by punk::console::ansi when set to off
proc sgr_cache {args} {
set argd [punk::args::get_dict {
*proc -name punk::ansi::sgr_cache -help "Convenience function to view and optionally clear the ansi character attribute cache (ansi SGR codes)
"
-action -default "" -choices "clear" -help "-action clear will unset the keys in the punk::ansi::sgr_cache dict
This is called automatically when setting 'colour false' in the console"
-pretty -default 1 -type boolean -help "use 'pdict punk::ansi::sgr_cache */%str,%ansiview' output"
#punk::args depends on punk::ansi - REVIEW
proc sgr_cache {args} {
set argdef {
*id punk::ansi::sgr_cache
*proc -name punk::ansi::sgr_cache -help\
"Convenience function to view and optionally clear the ansi character attribute cache (ansi SGR codes)
"
-action -default "" -choices "clear" -help\
"-action clear will unset the keys in the punk::ansi::sgr_cache dict
This is called automatically when setting 'colour false' in the console"
-pretty -default 1 -type boolean -help\
"use 'pdict punk::ansi::sgr_cache */%str,%ansiview' output"
*values -min 0 -max 0
} $args]
}
set argd [punk::args::get_dict $argdef $args]
set action [dict get $argd opts -action]
set pretty [dict get $argd opts -pretty]
@ -2372,6 +2411,31 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
return [join $lines \n]
}
lappend PUNKARGS [list {
*id punk::ansi::a+
*proc -name "punk::ansi::a+" -help\
"Returns an ANSI sgr escape sequence based on the list of supplied codes.
"
*values -min 0 -max -1
} [string map [list <choices> [dict keys $SGR_map]] {
code -type string -optional 1 -multiple 1 -choices {<choices>} -choiceprefix 0 -choicerestricted 0 -help\
"SGR code from the list below, or an integer corresponding to the code e.g 31 = red.
A leading capital letter indicates a codename applies to the background colour.
Other accepted codes are:
term-<int> Term-<int> foreground/background where int is 0-255 terminal color
term-<termcolour> Term-<termcolour> foreground/background
rgb-<r>-<g>-<b> Rgb-<r>-<g>-<b> foreground/background where <r> <g> <b> are the
0-255 int values for red, green and blue.
rgb#<hexcode> Rgb#<hexcode> where <hexcode> is a 6 char hex colour e.g rgb#C71585
web-<webcolour> Web-<webcolour>
The acceptable values for <termcolour> and <webcolour> can be queried using
punk::ansi::a? term
and
punk::ansi::a? web"
}]]
proc a+ {args} {
#*** !doctools
#[call [fun a+] [opt {ansicode...}]]
@ -3267,17 +3331,49 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
}
# REVIEW - osc8 replays etc for split lines? - textblock
#Hyperlinks (a.k.a. HTML-like anchors) in terminal emulators https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
#the 'id' parameter logically connects split hyperlinks
#per interp. Rather than try to avoid collisions using something like 'info cmdcount' we will use a simple counter.
#To stop multiple hyperlinks from having ids inadvertently collide - we should do some id mangling/prefixing based on the terminal/window etc
#It is better to use a simple counter with high likelihood of collision so we are more likely to detect problems with ids than to make it more intermittent by using ids that collide only 'rarely'
variable hyperlinkcounter
set hyperlinkcounter 0
proc hyperlink {uri {display ""}} {
variable hyperlinkcounter
if {$display eq ""} {
set display $uri
}
set params "" ;#todo e.g id=xyz123:foo=bar:baz=quux
set uri [punk::ansi::ansistripraw $uri]
#limit uri length we emit based on common limits in other terminals
if {[string length $uri] > 2083} {
error "punk::ansi::hyperlink uri too long: limit 2083"
}
set params "id=punkansi-[incr hyperlinkcounter]" ;#todo e.g id=xyz123:foo=bar:baz=quux
set open "\x1b\]8\;$params\;$uri\x1b\\"
set close "\x1b\]8\;\;\x1b\\"
return ${open}${display}${close}
}
#on windows terminal at least, both uri and id of 2 separated hyperlinks need to match for the hover highlighting to act as a unit.
proc hyperlink_open {uri {id ""}} {
if {$id eq ""} {
set id punkansi-[incr hyperlinkcounter]
}
set uri [punk::ansi::ansistripraw $uri]
if {[string length $uri] > 2083} {
error "punk::ansi::hyperlink uri too long: limit 2083"
}
set id [string map {: . {;} ,} $id] ;#avoid some likely problematic ids. TODO - review, restrict further.
set params "id=$id"
return "\x1b\]8\;$params\;$uri\x1b\\"
}
#It should be ok to close even if no currently active hyperlink (e.g can be used to cleanup if something awry)
proc hyperlink_close {} {
return "\x1b\]8\;\;\x1b\\"
}
# -- --- --- --- ---
proc move {row col} {
#*** !doctools
@ -3837,11 +3933,13 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
#[call [fun ansistrip] [arg text] ]
#[para]Return a string with ansi codes stripped out
#[para]Alternate graphics chars are replaced with modern unicode equivalents (e.g boxdrawing glyphs)
if {[string length $text] < 2} {return $text}
if {[punk::ansi::ta::detect_g0 $text]} {
set text [convert_g0 $text];#Convert ansi borders to unicode line drawing instead of ascii letters
}
if {[string length $text] < 2} {return $text}
set parts [punk::ansi::ta::split_codes $text]
if {[llength $parts] == 1} {return [lindex $parts 0]}
set out ""
#todo - try: join [lsearch -stride 2 -index 0 -subindices -all -inline $parts *] ""
# - (if/when lsearch -stride bug fixed)
@ -3871,6 +3969,7 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
#[para]Return a string with ansi codes stripped out
#[para]Alternate graphics modes will be stripped rather than converted to unicode - exposing the raw ascii characters as they appear without graphics mode.
#[para]ie instead of a horizontal line you may see: qqqqqq
if {[string length $text] < 2} {return $text}
set parts [punk::ansi::ta::split_codes $text]
set out ""
@ -7294,6 +7393,13 @@ tcl::namespace::eval punk::ansi::internal {
}
}
if {![info exists ::punk::args::register::NAMESPACES]} {
namespace eval ::punk::args::register {
set NAMESPACES [list]
}
}
lappend ::punk::args::register::NAMESPACES ::punk::ansi ::punk::ansi::class
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
## Ready
package provide punk::ansi [tcl::namespace::eval punk::ansi {

1680
src/bootsupport/modules/punk/args-0.1.0.tm

File diff suppressed because it is too large Load Diff

35
src/bootsupport/modules/punk/config-0.1.tm

@ -361,11 +361,14 @@ tcl::namespace::eval punk::config {
}
proc configure {args} {
set argd [punk::args::get_dict {
set argdef {
*id punk::config::configure
*proc -name punk::config::configure -help\
"UNIMPLEMENTED"
*values -min 1 -max 1
whichconfig -type string -choices {startup running stop}
} $args]
}
set argd [punk::args::get_dict $argdef $args]
return "unimplemented - $argd"
}
@ -375,6 +378,8 @@ tcl::namespace::eval punk::config {
return [punk::lib::showdict $configdata]
}
#e.g
# copy running-config startup-config
# copy startup-config test-config.cfg
@ -382,16 +387,22 @@ tcl::namespace::eval punk::config {
#review - consider the merge vs overwrite feature of some routers.. where copy to running-config does a merge rather than an overwrite
#This is to allow partial configs to be loaded to running, whereas a save of running to any target is always a complete configuration
proc copy {args} {
set argd [punk::args::get_dict {
*proc -name punk::config::copy -help "Copy a partial or full configuration from one config to another
If a target config has additional settings, then the source config can be considered to be partial with regards to the target.
"
-type -default "" -choices {replace merge} -help "Defaults to merge when target is running-config
Defaults to replace when source is running-config"
set argdef {
*id punk::config::copy
*proc -name punk::config::copy -help\
"Copy a partial or full configuration from one config to another
If a target config has additional settings, then the source config can be considered to be partial with regards to the target.
"
-type -default "" -choices {replace merge} -help\
"Defaults to merge when target is running-config
Defaults to replace when source is running-config"
*values -min 2 -max 2
fromconfig -help "running or startup or file name (not fully implemented)"
toconfig -help "running or startup or file name (not fully implemented)"
} $args]
fromconfig -help\
"running or startup or file name (not fully implemented)"
toconfig -help\
"running or startup or file name (not fully implemented)"
}
set argd [punk::args::get_dict $argdef $args]
set fromconfig [dict get $argd values fromconfig]
set toconfig [dict get $argd values toconfig]
set fromconfig [string map {-config ""} $fromconfig]

5
src/bootsupport/modules/punk/console-0.1.1.tm

@ -81,6 +81,8 @@ namespace eval punk::console {
#*** !doctools
#[list_begin definitions]
variable PUNKARGS
variable tabwidth 8 ;#default only - will attempt to detect and set to that configured in terminal
#Note that windows terminal cooked mode seems to use 8 for interactive use even if set differently
#e.g typing tab characters may still be echoed 8-spaced while writing to stdout my obey the terminal's tab stops.
@ -1187,7 +1189,8 @@ namespace eval punk::console {
*id punk::console::cell_size
-inoutchannels -default {stdin stdout} -type list
*values -min 0 -max 1
newsize -default ""
newsize -default "" -help\
"character cell pixel dimensions WxH"
}
proc cell_size {args} {
set argd [punk::args::get_by_id punk::console::cell_size $args]

19
src/bootsupport/modules/punk/fileline-0.1.0.tm

@ -1251,6 +1251,16 @@ namespace eval punk::fileline {
#[para] Core API functions for punk::fileline
#[list_begin definitions]
punk::args::definition {
*id punk::fileline::get_textinfo
*proc -name punk::fileline::get_textinfo -help\
"return: textinfo object instance"
-file -default {} -type existingfile
-translation -default iso8859-1
-encoding -default "\uFFFF"
-includebom -default 0
*values -min 0 -max 1
}
proc get_textinfo {args} {
#*** !doctools
#[call get_textinfo [opt {option value...}] [opt datachunk]]
@ -1266,14 +1276,7 @@ namespace eval punk::fileline {
#[para]Currently only utf-8, utf-16* and utf-32* are properly supported even though the other BOMs are detected, reported via get_bomid, and stripped from the data.
#[para]GB18030 falls back to cp936/gbk (unless a gb18030 encoding has been installed). Use -encoding iso8859-1 if this isn't suitable and you need to do your own processing of the bytes.
set argument_specification {
-file -default {} -type existingfile
-translation -default iso8859-1
-encoding -default "\uFFFF"
-includebom -default 0
*values -min 0 -max 1
}
lassign [dict values [punk::args::get_dict $argument_specification $args]] opts values
lassign [dict values [punk::args::get_by_id punk::fileline::get_textinfo $args]] opts values
# -- --- --- ---
set opt_file [dict get $opts -file]
set opt_translation [dict get $opts -translation]

190
src/bootsupport/modules/punk/lib-0.1.1.tm

@ -48,8 +48,10 @@
#[list_begin itemized]
package require Tcl 8.6-
package require punk::args
#*** !doctools
#[item] [package {Tcl 8.6-}]
#[item] [package {punk::args}]
# #package require frobz
# #*** !doctools
@ -140,7 +142,7 @@ tcl::namespace::eval punk::lib::check {
proc has_tclbug_lsearch_strideallinline {} {
#bug only occurs with single -index value combined with -stride -all -inline -subindices
#https://core.tcl-lang.org/tcl/tktview/5a1aaa201d
if {[catch {[lsearch -stride 3 -all -inline -index 1 -subindices {a1 a2 a3} *]} result]} {
if {[catch {lsearch -stride 3 -all -inline -index 1 -subindices {a1 a2 a3} *} result]} {
#we aren't looking for an error result - error most likely indicates tcl too old to support -stride
return 0
}
@ -320,7 +322,7 @@ tcl::namespace::eval punk::lib::compat {
if {"::lmap" ne [info commands ::lmap]} {
#puts stderr "Warning - no built-in lpop"
interp alias {} lpop {} ::punk::lib::compat::lmaptcl
interp alias {} lmap {} ::punk::lib::compat::lmaptcl
}
#lmap came in Tcl 8.6 - so probably not much need for a tcl forward compatibility version - but here it is anyway
proc lmaptcl {varnames list script} {
@ -384,6 +386,7 @@ tcl::namespace::eval punk::lib::compat {
# Base namespace
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
namespace eval punk::lib {
variable PUNKARGS
tcl::namespace::export *
variable has_struct_list
set has_struct_list [expr {![catch {package require struct::list}]}]
@ -956,171 +959,8 @@ namespace eval punk::lib {
proc lzipn {args} [info body ::punk::lib::lzipn_tcl9a]
}
#experiment with equiv of js template literals with ${expression} in templates
#e.g tstr {This is the value of x in calling scope ${$x} !}
#e.g tstr -allowcommands {This is the value of x in calling scope ${[set x]} !}
#e.g tstr -allowcommands {This is the value of [lindex $x 0] in calling scope ${[lindex [set x] 0]} !}
proc tstr {args} {
set argd [punk::args::get_dict {
*proc -name punk::lib::tstr -help "A rough equivalent of js template literals"
-allowcommands -default 0 -type none -help "if -allowcommands is true placeholder can contain commands e.g {${plaintext1 [lindex $var 0] plaintext2}}"
-return -default list -choices {dict list string}
*values -min 1 -max 1
templatestring -help "This argument should be a braced string containing placeholders such as ${$var} e.g {The value is ${$var}}
where $var will be substituted from the calling context
The placeholder itself can contain plaintext portions as well as variables.
It can contain commands in square brackets if -allowcommands is true"
} $args]
set templatestring [dict get $argd values templatestring]
set opt_allowcommands [dict get $argd opts -allowcommands]
set opt_return [dict get $argd opts -return]
set nocommands "-nocommands"
if {$opt_allowcommands == 1} {
set nocommands ""
}
#set parts [_tstr_split $templatestring]
set parts [_parse_tstr_parts $templatestring]
set textchunks [list]
#set expressions [list]
set params [list]
set idx 0
foreach {pt expression} $parts {
lappend textchunks $pt
incr idx ;#pt incr
#ignore last expression
if {$idx == [llength $parts]} {
break
}
#lappend expressions $expression
lappend params [uplevel 1 [list subst {*}$nocommands $expression]]
incr idx ;#expression incr
}
switch -- $opt_return {
dict {
return [dict create template $textchunks params $params]
}
list {
return [list $textchunks {*}$params]
}
string {
set out ""
foreach pt $textchunks param $params {
append out $pt $param
}
return $out
}
default {
}
}
}
#test single placeholder tstr args where single placeholder must be an int
proc tstr_test_one {args} {
set argd [punk::args::get_dict {
*proc -name tstr_test_one -help {An example/test of a function designed to be called with a js-style curly-braced Tstr.
example:
set id 2
tstr_test_one {*}[Tstr {Select * from table where id = ${$id} and etc... ;}]
}
*values -min 2 -max 2
template -type list -minlen 2 -maxlen 2 -help "This could be supplied directly as a 2 element list of each half of the sql statement -
but the Tstr method above does this for you, and also passes in the id automatically"
where -type int -help {Integer param for where clause. Tstr mechanism above will pass the id as the second parameter}
} $args]
set template [dict get $argd values template]
set where [dict get $argd values where]
set result [join [list [lindex $template 0] $where [lindex $template 1]] ""]
return $result
}
proc _parse_tstr_parts {templatestring} {
if {$templatestring eq ""} {
return [list]
}
set chars [split $templatestring ""]
set in_placeholder 0
set tchars ""
set echars ""
set parts [list]
set i 0
foreach ch $chars {
if {!$in_placeholder} {
set nextch [lindex $chars [expr {$i+1}]]
if {"$ch$nextch" eq "\$\{"} {
set in_placeholder 2 ;#2 to signify we just entered placeholder
lappend parts $tchars
set tchars ""
} else {
append tchars $ch
}
} else {
if {$ch eq "\}"} {
if {[tcl::info::complete $echars]} {
set in_placeholder 0
lappend parts $echars
set echars ""
} else {
append echars $ch
}
} else {
if {$in_placeholder == 2} {
#skip opening bracket
set in_placeholder 1
} else {
append echars $ch
}
}
}
incr i
}
if {$tchars ne ""} {
lappend parts $tchars
}
if {[llength $parts] % 2 == 0} {
#always trail with pt for consistency with _perlish_split method so we can test other mechanisms with odd-length pt/code../pt style list
lappend parts ""
}
return $parts
}
#based on punk::ansi::ta::_perlish_split
proc _tstr_split {text} {
if {$text eq ""} {
return {}
}
set list [list]
set start 0
#ideally re should allow curlies within but we will probably need a custom parser to do it
#(js allows nested string interpolation)
#set re {\$\{[^\}]*\}}
set re {\$\{(?:(?!\$\{).)*\}}
#eg regexp {\x1b(?:\(0(?:(?:(?!\x1b\(B).)*\x1b\(B)|\)0(?:(?:(?!\x1b\)B).)*\x1b\)B))} $code
#We can get $matchEnd < $matchStart; we need to ensure there is an exit condition for non-greedy empty results REVIEW
while {[regexp -start $start -indices -- $re $text match]} {
lassign $match matchStart matchEnd
#puts "->start $start ->match $matchStart $matchEnd"
if {$matchEnd < $matchStart} {
puts "e:$matchEnd < s:$matchStart"
lappend list [tcl::string::range $text $start $matchStart-1] [tcl::string::index $text $matchStart]
incr start
if {$start >= [tcl::string::length $text]} {
break
}
continue
}
lappend list [tcl::string::range $text $start $matchStart-1] [tcl::string::range $text $matchStart+2 $matchEnd-1]
set start [expr {$matchEnd+1}]
#?
if {$start >= [tcl::string::length $text]} {
break
}
}
return [lappend list [tcl::string::range $text $start end]]
}
namespace import ::punk::args::lib::tstr
#get info about punk nestindex key ie type: list,dict,undetermined
proc nestindex_info {args} {
@ -1184,8 +1024,11 @@ namespace eval punk::lib {
set sep " [punk::ansi::a+ Green]=[punk::ansi::a] "
}
set argspec [string map [list %sep% $sep] {
*proc -name pdict -help {Print dict keys,values to channel
(see also showdict)}
*id punk::lib::pdict
*proc -name pdict -help\
"Print dict keys,values to channel
The pdict function operates on variable names - passing the value to the showdict function which operates on values
(see also showdict)"
*opts -any 1
@ -1222,7 +1065,6 @@ namespace eval punk::lib {
The second level segement in each pattern switches to a dict operation to retrieve the value by key.
When a list operation such as @* is used - integer list indexes are displayed on the left side of the = for that hierarchy level.
The pdict function operates on variable names - passing the value to the showdict function which operates on values
}
}]
#puts stderr "$argspec"
@ -1282,7 +1124,7 @@ namespace eval punk::lib {
-ansibase_keys -default "" -help "ansi list for each level in -substructure. e.g \[list \[a+ red\] \[a+ web-green\]\]"
-substructure -default {}
-ansibase_values -default ""
-keytemplates -default {${$key}} -type list -help "list of templates for keys at each level"
-keytemplates -default {\$\{$key\}} -type list -help "list of templates for keys at each level"
-keysorttype -default "none" -choices {none dictionary ascii integer real}
-keysortdirection -default increasing -choices {increasing decreasing}
*values -min 1 -max -1
@ -1295,6 +1137,7 @@ namespace eval punk::lib {
set opt_keysortdirection [dict get $argd opts -keysortdirection]
set opt_trimright [dict get $argd opts -trimright]
set opt_keytemplates [dict get $argd opts -keytemplates]
puts stderr "---> $opt_keytemplates <---"
set opt_ansibase_keys [dict get $argd opts -ansibase_keys]
set opt_ansibase_values [dict get $argd opts -ansibase_values]
set opt_return [dict get $argd opts -return]
@ -4272,6 +4115,13 @@ tcl::namespace::eval punk::lib::system {
#*** !doctools
#[list_end] [comment {--- end definitions namespace punk::lib::system ---}]
}
if {![info exists ::punk::args::register::NAMESPACES]} {
namespace eval ::punk::args::register {
set ::punk::args::register::NAMESPACES [list] ;#use fully qualified so 8.6 doesn't find existing var in global namespace
}
}
lappend ::punk::args::register::NAMESPACES ::punk::lib
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
## Ready
package provide punk::lib [tcl::namespace::eval punk::lib {

2
src/bootsupport/modules/punk/mix/commandset/layout-0.1.0.tm

@ -35,7 +35,7 @@ namespace eval punk::mix::commandset::layout {
proc files {{layout ""}} {
set argd [punk::args::get_dict {
*values -min 1 -max 1
layout -type string -minlen 1
layout -type string -minsize 1
} [list $layout]]
set allfiles [lib::layout_all_files $layout]

37
src/bootsupport/modules/punk/mix/commandset/loadedlib-0.1.0.tm

@ -26,19 +26,21 @@ package require punk::lib
namespace eval punk::mix::commandset::loadedlib {
namespace export *
#search automatically wrapped in * * - can contain inner * ? globs
proc search {args} {
set argspecs {
*proc -name "punk::mix::commandset::loadedlib search" -help "search all Tcl libraries available to your local interpreter"
-return -type string -default table -choices {table tableobject list lines}
-present -type integer -default 2 -choices {0 1 2} -choicelabels {absent present both} -help "(unimplemented) Display only those that are 0:absent 1:present 2:both"
-highlight -type boolean -default 1 -help "Highlight which version is present with ansi underline and colour"
-refresh -default 0 -type boolean -help "Re-scan the tm and library folders"
searchstrings -default * -multiple 1 -help "Names to search for, may contain glob chars (* ?) e.g *lib*
punk::args::definition {
*id punk::mix::commandset::loadedlib::search
*proc -name "punk::mix::commandset::loadedlib search" -help "search all Tcl libraries available to your local interpreter"
-return -type string -default table -choices {table tableobject list lines}
-present -type integer -default 2 -choices {0 1 2} -choicelabels {absent present both} -help\
"(unimplemented) Display only those that are 0:absent 1:present 2:both"
-highlight -type boolean -default 1 -help "Highlight which version is present with ansi underline and colour"
-refresh -default 0 -type boolean -help "Re-scan the tm and library folders"
searchstrings -default * -multiple 1 -help\
"Names to search for, may contain glob chars (* ?) e.g *lib*
If no glob chars are explicitly specified, the searchstring will be wrapped with star globs.
eg name -> *name*
"
}
set argd [punk::args::get_dict $argspecs $args]
eg name -> *name*"
}
proc search {args} {
set argd [punk::args::get_by_id punk::mix::commandset::loadedlib::search $args]
set searchstrings [dict get $argd values searchstrings]
set opts [dict get $argd opts]
set opt_return [dict get $opts -return]
@ -179,16 +181,7 @@ namespace eval punk::mix::commandset::loadedlib {
return [join $loaded_libs \n]
}
proc info {args} {
set argspecs {
*values -min 1
libname -help "library/package name"
}
set argd [punk::args::get_dict $argspecs $args]
set libname [dict get $argd values libname]
proc info {libname} {
if {[catch {package require natsort}]} {
set has_natsort 0
} else {

70
src/bootsupport/modules/punk/mix/commandset/module-0.1.0.tm

@ -137,23 +137,39 @@ namespace eval punk::mix::commandset::module {
put stderr "get_template_basefolders WARNING - no handler available for the 'punk.templates' capability - template providers will be unable to provide template locations"
}
}
set moduletypes [punk::mix::cli::lib::module_types]
punk::args::definition [subst {
*id punk::mix::commandset::module::new
*proc -name "punk::mix::commandset::module::new" -help\
"Create a new module file in the appropriate folder within src/modules.
If the name given in the module argument is namespaced,
the necessary subfolder(s) will be used or created."
-project -optional 1
-version -default "0.1.0" -help\
"version to use if not specified as part of the module argument.
If a version is specified in the module argument as well as in -version
the higher version number will be used.
"
-license -default <unspecified>
-template -default punk.module
-type -default "[lindex $moduletypes 0]" -choices {$moduletypes}
-force -default 0 -type boolean -help\
"If set true, will overwrite an existing .tm file if there is one.
If false (default) an error will be raised if there is a conflict."
-quiet -default 0 -type boolean -help\
"Suppress information messages on stdout"
*values -min 1 -max 1
module -type string -help\
"Name of module, possibly including a namespace and/or version number
e.g mynamespace::mymodule-1.0"
}]
proc new {args} {
set year [clock format [clock seconds] -format %Y]
set moduletypes [punk::mix::cli::lib::module_types]
# use \uFFFD because unicode replacement char should consistently render as 1 wide
set argspecs [subst {
-project -default \uFFFD
-version -default \uFFFD
-license -default <unspecified>
-template -default punk.module
-type -default \uFFFD -choices {$moduletypes}
-force -default 0 -type boolean
-quiet -default 0 -type boolean
*values -min 1 -max 1
module -type string
}]
set argd [punk::args::get_dict $argspecs $args]
lassign [dict values $argd] leaders opts values
set argd [punk::args::get_by_id punk::mix::commandset::module::new $args]
lassign [dict values $argd] leaders opts values received
set module [dict get $values module]
#set opts [dict merge $defaults $args]
@ -168,13 +184,9 @@ namespace eval punk::mix::commandset::module {
# we need this value before looking at the named argument
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set opt_version_supplied [dict get $opts -version]
if {$opt_version_supplied eq "\uFFFD"} {
set opt_version "0.1.0"
} else {
set opt_version $opt_version_supplied
if {![util::is_valid_tm_version $opt_version]} {
error "deck module.new error - supplied -version $opt_version doesn't appear to be a valid Tcl module version"
}
set opt_version $opt_version_supplied
if {![util::is_valid_tm_version $opt_version]} {
error "deck module.new error - supplied -version $opt_version doesn't appear to be a valid Tcl module version"
}
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
#named argument
@ -194,7 +206,7 @@ namespace eval punk::mix::commandset::module {
} else {
set vmsg "from -version option: $opt_version_supplied"
}
if {$opt_version_supplied ne "\uFFFD"} {
if {"-version" in $received} {
if {$vcompare_is_mversion_bigger != 0} {
#is bigger or smaller
puts stderr "module.new WARNING: version supplied in module argument as well as -version option. Using the higher version number $vmsg"
@ -231,7 +243,6 @@ namespace eval punk::mix::commandset::module {
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
#options
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set opt_project [dict get $opts -project]
set testdir [pwd]
if {![string length [set projectdir [punk::repo::find_project $testdir]]]} {
if {![string length [set projectdir [punk::repo::find_candidate $testdir]]]} {
@ -239,9 +250,10 @@ namespace eval punk::mix::commandset::module {
error "module.new unable to create module in projectdir:$projectdir - directory doesn't appear to meet basic standards $msg"
}
}
if {$opt_project == "\uFFFF"} {
if {![dict exists $received -project]} {
set projectname [file tail $projectdir]
} else {
set opt_project [dict get $opts -project]
set projectname $opt_project
if {$projectname ne [file tail $projectdir]} {
error "module.new -project '$opt_project' doesn't match detected projectname '$projectname' at path: $projectdir"
@ -309,12 +321,6 @@ namespace eval punk::mix::commandset::module {
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set opt_type [dict get $opts -type]
if {$opt_type eq "\uFFFD"} {
set opt_type [lindex [punk::mix::cli::lib::module_types] 0] ;#default to plain
}
if {$opt_type ni [punk::mix::cli::lib::module_types]} {
error "module.new - error - unknown -type '$opt_type' known-types: [punk::mix::cli::lib::module_types]"
}
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set opt_quiet [dict get $opts -quiet]
set opt_force [dict get $opts -force]
@ -407,7 +413,7 @@ namespace eval punk::mix::commandset::module {
set podfile $modulefolder/#modpod-$moduletail-$infile_version/$moduletail-$infile_version.tm
set has_tm [file exists $tmfile]
set has_pod [file exists $podfile]
if {$has_tm && $has_pos} {
if {$has_tm && $has_pod} {
#invalid configuration - bomb out
error "module.new error: Invalid target configuration found. module folder has both a .tm file $tmfile and a modpod file $podfile. Please delete one of them before trying again."
}
@ -448,7 +454,7 @@ namespace eval punk::mix::commandset::module {
}
set buildversionfile [file join $modulefolder ${moduletail}-buildversion.txt]
set existing_build_version ""
if {[file exists $buildversionfile]} {
if {!$opt_force && [file exists $buildversionfile]} {
set buildversiondata [punk::mix::util::fcat $buildversionfile]
set lines [split $buildversiondata \n]
set existing_build_version [string trim [lindex $lines 0]]

1016
src/bootsupport/modules/punk/ns-0.1.0.tm

File diff suppressed because it is too large Load Diff

31
src/bootsupport/modules/punk/path-0.1.0.tm

@ -45,8 +45,10 @@
#[list_begin itemized]
package require Tcl 8.6-
package require punk::args
#*** !doctools
#[item] [package {Tcl 8.6-}]
#[item] [package {punk::args}]
# #package require frobz
# #*** !doctools
@ -642,6 +644,20 @@ namespace eval punk::path {
return $ismatch
}
punk::args::definition {
*id punk::path::treefilenames
-directory -type directory -help\
"folder in which to begin recursive scan for files."
-call-depth-internal -default 0 -type integer
-antiglob_paths -default {} -help\
"list of path patterns to exclude
may include * and ** path segments e.g /usr/**"
*values -min 0 -max -1 -optional 1 -type string
tailglobs -multiple 1 -help\
"Patterns to match against filename portion (last segment) of each file path
within the directory tree being searched."
}
#todo - implement treefiles which acts like dirfiles but allows path globbing in the same way as punk::ns::ns/
#then review if treefiles can replace dirfiles or if both should exist (dirfiles can have literal glob chars in path segments - but that is a rare usecase)
proc treefilenames {args} {
@ -655,22 +671,17 @@ namespace eval punk::path {
#[para] list of path patterns to exclude - may include * and ** path segments e.g /usr/**
#[para]no natsorting - so order is dependent on filesystem
set argd [punk::args::get_dict {
-directory -default "\uFFFF"
-call-depth-internal -default 0 -type integer
-antiglob_paths -default {}
*values -min 0 -max -1 -optional 1 -type string
tailglobs -multiple 1
} $args]
lassign [dict values $argd] leaders opts values
set argd [punk::args::get_by_id punk::path::treefilenames $args]
lassign [dict values $argd] leaders opts values received
set tailglobs [dict values $values]
# -- --- --- --- --- --- ---
set opt_antiglob_paths [dict get $opts -antiglob_paths]
set CALLDEPTH [dict get $opts -call-depth-internal]
# -- --- --- --- --- --- ---
set opt_dir [dict get $opts -directory]
if {$opt_dir eq "\uFFFF"} {
if {![dict exists $received -directory]} {
set opt_dir [pwd]
} else {
set opt_dir [dict get $opts -directory]
}
# -- --- --- --- --- --- ---

23
src/bootsupport/modules/punk/repl/codethread-0.1.1.tm

@ -166,15 +166,15 @@ tcl::namespace::eval punk::repl::codethread {
set errstack [list]
upvar ::punk::config::running running_config
if {[string length [dict get $running_config color_stdout_repl]] && [interp eval code punk::console::colour]} {
lappend outstack [interp eval code [list shellfilter::stack::add stdout ansiwrap -settings [list -colour [dict get $running_config color_stdout_repl]]]]
lappend outstack [interp eval code [list ::shellfilter::stack add stdout ansiwrap -settings [list -colour [dict get $running_config color_stdout_repl]]]]
}
lappend outstack [interp eval code [list shellfilter::stack::add stdout tee_to_var -settings {-varname ::punk::repl::codethread::output_stdout}]]
lappend outstack [interp eval code [list ::shellfilter::stack add stdout tee_to_var -settings {-varname ::punk::repl::codethread::output_stdout}]]
if {[string length [dict get $running_config color_stderr_repl]] && [interp eval code punk::console::colour]} {
lappend errstack [interp eval code [list shellfilter::stack::add stderr ansiwrap -settings [list -colour [dict get $running_config color_stderr_repl]]]]
lappend errstack [interp eval code [list ::shellfilter::stack add stderr ansiwrap -settings [list -colour [dict get $running_config color_stderr_repl]]]]
# #lappend errstack [shellfilter::stack::add stderr ansiwrap -settings [list -colour cyan]]
}
lappend errstack [interp eval code [list shellfilter::stack::add stderr tee_to_var -settings {-varname ::punk::repl::codethread::output_stderr}]]
lappend errstack [interp eval code [list ::shellfilter::stack add stderr tee_to_var -settings {-varname ::punk::repl::codethread::output_stderr}]]
#an experiment
#set errhandle [shellfilter::stack::item_tophandle stderr]
@ -190,7 +190,16 @@ tcl::namespace::eval punk::repl::codethread {
if {[llength $::codeinterp::run_command_cache] > 2000} {
set ::codeinterp::run_command_cache [lrange $::codeinterp::run_command_cache 1750 end][unset ::codeinterp::run_command_cache]
}
tcl::namespace::inscope $::punk::ns::ns_current $::codeinterp::clonescript
if {[string first ":::" $::punk::ns::ns_current]} {
#support for browsing 'odd' (inadvisable) namespaces
#don't use 'namespace exists' - will conflate ::test::x with ::test:::x
#if {$::punk::ns::ns_current in [namespace children [punk::ns::nsprefix $::punk::ns::ns_current]} {
#}
package require punk::ns
punk::ns::nseval_ifexists $::punk::ns::ns_current $::codeinterp::clonescript
} else {
tcl::namespace::inscope $::punk::ns::ns_current $::codeinterp::clonescript
}
}
} result]
@ -221,10 +230,10 @@ tcl::namespace::eval punk::repl::codethread {
#only remove from shellfilter::stack the items we added to stack in this function
foreach s [lreverse $outstack] {
interp eval code [list shellfilter::stack::remove stdout $s]
interp eval code [list ::shellfilter::stack remove stdout $s]
}
foreach s [lreverse $errstack] {
interp eval code [list shellfilter::stack::remove stderr $s]
interp eval code [list ::shellfilter::stack remove stderr $s]
}
thread::cond notify $replthread_cond
}

4
src/bootsupport/modules/shellfilter-0.1.9.tm

@ -1086,7 +1086,9 @@ namespace eval shellfilter::chan {
## note - whether stack is for input or output we maintain it in the same direction - which is in sync with the tcl chan pop chan push concept.
##
namespace eval shellfilter::stack {
#todo - implement as oo
namespace export {[a-z]*}
namespace ensemble create
#todo - implement as oo ?
variable pipelines [list]
proc items {} {

507
src/bootsupport/modules/textblock-0.1.2.tm

@ -92,29 +92,51 @@ tcl::namespace::eval textblock {
#NOTE sha1, although computationally more intensive, tends to be faster than md5 on modern cpus
#(more likely to be optimised for modern cpu features?)
variable use_md5 ;#framecache
set use_md5 1
if {[catch {package require md5}]} {
set use_md5 0
}
#todo - change use_md5 to more generic use_checksum_algorithm function.
# e.g allow md5, sha1, none, etc.
# - perhaps autodetect 32bit vs 64bit (or processortype?) to select a default (also depending on packages available and accelerator presence)
proc use_md5 {{yes_no ""}} {
variable use_md5
if {$yes_no eq ""} {
return $use_md5
}
if {![string is boolean -strict $yes_no]} {
error "textblock::use_md5 requires a boolean (or empty string to query)"
}
if {$yes_no} {
package require md5
set use_md5 1
#(This speed improvement may not apply for short strings)
variable use_hash ;#framecache
set use_hash none ;#slightly faster but uglier layout for viewing frame_cache display
#if {![catch {package require sha1}]} {
# set use_hash sha1
#} elseif {![catch {package require md5}]} {
# set use_hash md5
#} else {
# set use_hash none
#}
proc use_hash {args} {
set choices [list none]
set unavailable [list]
set pkgs [package names]
if {"md5" in $pkgs} {
lappend choices md5
} else {
set use_md5 0
lappend unavailable md5
}
return $use_md5
if {"sha1" in $pkgs} {
lappend choices sha1
} else {
lappend unavailable sha1
}
set choicemsg ""
if {[llength $unavailable]} {
set choicemsg " (unavailable packages: $unavailable)"
}
set argd [punk::args::get_dict [tstr -return string {
*id textblock::use_hash
*proc -name "textblock::use_hash" -help\
"Hashing algorithm to use for framecache lookup.
'none' may be slightly faster but less compact
when viewing textblock::framecache"
*values -min 0 -max 1
hash_algorithm -choices {${$choices}} -optional 1 -help\
"algorithm choice ${$choicemsg}"
}] $args]
variable use_hash
if {![dict exists $argd received hash_algorithm]} {
return $use_hash
}
set use_hash [dict get $argd values hash_algorithm]
}
tcl::namespace::eval class {
variable opts_table_defaults
@ -3997,12 +4019,8 @@ tcl::namespace::eval textblock {
return $t
}
proc periodic {args} {
#For an impressive interactive terminal app (javascript)
# see: https://github.com/spirometaxas/periodic-table-cli
set opts [dict get [punk::args::get_dict {
punk::args::definition {
*id textblock::periodic
*proc -name textblock::periodic -help "A rudimentary periodic table
This is primarily a test of textblock::class::table"
@ -4016,8 +4034,12 @@ tcl::namespace::eval textblock {
-show_edge -default "" -type boolean
-forcecolour -default 0 -type boolean -help "If punk::colour is off - this enables the produced table to still be ansi coloured"
*values -min 0 -max 0
} $args] opts]
}
proc periodic {args} {
#For an impressive interactive terminal app (javascript)
# see: https://github.com/spirometaxas/periodic-table-cli
set opts [dict get [punk::args::get_by_id textblock::periodic $args] opts]
set opt_return [tcl::dict::get $opts -return]
if {[tcl::dict::get $opts -forcecolour]} {
set fc forcecolour
@ -4156,15 +4178,16 @@ tcl::namespace::eval textblock {
dict set conf $k [dict get $opts $k]
}
}
$t configure {*}[dict get $conf]
$t configure \
-frametype_header light\
-ansiborder_header [a+ {*}$fc brightwhite]\
-ansibase_header [a+ {*}$fc Black]\
-ansibase_body [a+ {*}$fc Black]\
-ansiborder_body [a+ {*}$fc black]\
-frametype block
set moreopts [dict create\
-frametype_header light\
-ansiborder_header [a+ {*}$fc brightwhite]\
-ansibase_header [a+ {*}$fc Black]\
-ansibase_body [a+ {*}$fc Black]\
-ansiborder_body [a+ {*}$fc black]\
-frametype block
]
$t configure {*}[dict merge $conf $moreopts]
#-ansiborder_header [a+ {*}$fc web-white]\
@ -4204,9 +4227,9 @@ tcl::namespace::eval textblock {
-header -default "" -type list -multiple 1\
-help "Each supplied -header argument is a header row.
The number of values for each must be <= number of columns"
-show_header -default ""\
-show_header -type boolean\
-help "Whether to show a header row.
Leave as empty string for unspecified/automatic,
Omit for unspecified/automatic,
in which case it will display only if -headers list was supplied."
-action -default "append" -choices {append replace}\
-help "row insertion method if existing -table is supplied
@ -4294,13 +4317,13 @@ tcl::namespace::eval textblock {
if {[llength $colheaders] > 0} {
if {[tcl::dict::get $opts -show_header] eq ""} {
if {![tcl::dict::exists $opts received -show_header]} {
set show_header 1
} else {
set show_header [tcl::dict::get $opts -show_header]
}
} else {
if {[tcl::dict::get $opts -show_header] eq ""} {
if {![tcl::dict::exists $opts received -show_header]} {
set show_header 0
} else {
set show_header [tcl::dict::get $opts -show_header]
@ -4529,7 +4552,7 @@ tcl::namespace::eval textblock {
}
set textblock [textutil::tabify::untabify2 $textblock $tw]
}
if {[punk::ansi::ta::detect $textblock]} {
if {[string length $textblock] > 1 && [punk::ansi::ta::detect $textblock]} {
#ansistripraw slightly faster than ansistrip - and won't affect width (avoid detect_g0/conversions)
set textblock [punk::ansi::ansistripraw $textblock]
}
@ -4553,7 +4576,7 @@ tcl::namespace::eval textblock {
}
set textblock [textutil::tabify::untabify2 $textblock $tw]
}
if {[punk::ansi::ta::detect $textblock]} {
if {[string length $textblock] > 1 && [punk::ansi::ta::detect $textblock]} {
#ansistripraw slightly faster than ansistrip - and won't affect width (avoid detect_g0/conversions)
set textblock [punk::ansi::ansistripraw $textblock]
}
@ -4614,7 +4637,7 @@ tcl::namespace::eval textblock {
set textblock [textutil::tabify::untabify2 $textblock $tw]
}
#ansistripraw on entire block in one go rather than line by line - result should be the same - review - make tests
if {[punk::ansi::ta::detect $textblock]} {
if {[string length $textblock] > 1 && [punk::ansi::ta::detect $textblock]} {
set textblock [punk::ansi::ansistripraw $textblock]
}
if {[tcl::string::last \n $textblock] >= 0} {
@ -7226,12 +7249,19 @@ tcl::namespace::eval textblock {
variable frame_cache
set frame_cache [tcl::dict::create]
punk::args::definition {
*id textblock::frame_cache
*proc -name textblock::frame_cache -help\
"Display or clear the frame cache."
-action -default {} -choices {clear} -help\
"Clear the textblock::frame_cache dictionary"
-pretty -default 1 -help\
"Use 'pdict textblock::frame_cache */*' for prettier output"
*values -min 0 -max 0
}
proc frame_cache {args} {
set argd [punk::args::get_dict {
-action -default {} -choices {clear} -help "Clear the textblock::frame_cache dictionary"
-pretty -default 1 -help "Use 'pdict textblock::frame_cache */*' for prettier output"
*values -min 0 -max 0
} $args]
set argd [punk::args::get_by_id textblock::frame_cache $args]
set action [dict get $argd opts -action]
if {$action ni [list clear ""]} {
@ -7273,6 +7303,71 @@ tcl::namespace::eval textblock {
}
set FRAMETYPES [textblock::frametypes]
set EG [a+ brightblack]
set RST [a]
#todo punk::args alias for centre center etc?
punk::args::definition [punk::lib::tstr -return string {
*id textblock::frame
*proc -name "textblock::frame"\
-help "Frame a block of text with a border."
-checkargs -default 1 -type boolean\
-help "If true do extra argument checks and
provide more comprehensive error info.
Set false for slight performance improvement."
-etabs -default 0\
-help "expanding tabs - experimental/unimplemented."
-type -default light -choices {${$FRAMETYPES}} -choicerestricted 0 -type dict\
-help "Type of border for frame."
-boxlimits -default {hl vl tlc blc trc brc} -type list -help "Limit the border box to listed elements.
passing an empty string will result in no box, but title/subtitle will still appear if supplied.
${$EG}e.g: -frame -boxlimits {} -title things [a+ red White]my\\ncontent${$RST}"
-boxmap -default {} -type dict
-joins -default {} -type list
-title -default "" -type string -regexprefail {\n}\
-help "Frame title placed on topbar - no newlines.
May contain ANSI - no trailing reset required.
${$EG}e.g 1: frame -title My[a+ green]Green[a]Thing
e.g 2: frame -title [a+ red underline]MyThing${$RST}"
-subtitle -default "" -type string -regexprefail {\n}\
-help "Frame subtitle placed on bottombar - no newlines
May contain Ansi - no trailing reset required."
-width -default "" -type int\
-help "Width of resulting frame including borders.
If omitted or empty-string, the width will be determined automatically based on content."
-height -default "" -type int\
-help "Height of resulting frame including borders."
-ansiborder -default "" -type ansistring\
-help "Ansi escape sequence to set border attributes.
${$EG}e.g 1: frame -ansiborder [a+ web-red] contents
e.g 2: frame -ansiborder \"\\x1b\\\[31m\" contents${$RST}"
-ansibase -default "" -type ansistring\
-help "Default ANSI attributes within frame."
-blockalign -default centre -choices {left right centre}\
-help "Alignment of the content block within the frame."
-pad -default 1 -type boolean -help "Whether to pad within the ANSI so content background
extends within the content block inside the frame.
Has no effect if no ANSI in content."
-textalign -default left -choices {left right centre}\
-help "Alignment of text within the content block. (centre unimplemented)"
-ellipsis -default 1 -type boolean\
-help "Whether to show elipsis for truncated content and title/subtitle."
-usecache -default 1 -type boolean
-buildcache -default 1 -type boolean
-crm_mode -default 0 -type boolean\
-help "Show ANSI control characters within frame contents.
(Control Representation Mode)
Frame width doesn't adapt and content may be truncated
so -width may need to be manually set to display more."
*values -min 0 -max 1
contents -default "" -type string\
-help "Frame contents - may be a block of text containing newlines and ANSI.
Text may be 'ragged' - ie unequal line-lengths.
No trailing ANSI reset required.
${$EG}e.g: frame \"[a+ blue White] \\nMy blue foreground text on\\nwhite background\\n\"${$RST}"
}]
#options before content argument - which is allowed to be absent
#frame performance (noticeable with complex tables even of modest size) is improved somewhat by frame_cache - but is still (2024) a fairly expensive operation.
#
@ -7283,7 +7378,7 @@ tcl::namespace::eval textblock {
# - but we would need to maintain support for the rendered-string based operations too.
proc frame {args} {
variable frametypes
variable use_md5
variable use_hash
#counterintuitively - in-proc dict create each time is generally slightly faster than linked namespace var
set opts [tcl::dict::create\
@ -7311,20 +7406,19 @@ tcl::namespace::eval textblock {
# for ansi art - -pad 0 is likely to be preferable
set has_contents 0
set arglist $args
set optlist $args ;#initial only - content will be removed
#no solo opts for frame
if {[llength $args] %2 == 0} {
if {[lindex $args end-1] eq "--"} {
set contents [lpop arglist end]
set contents [lpop optlist end]
set has_contents 1
lpop arglist end ;#drop the end-of-opts flag
lpop optlist end ;#drop the end-of-opts flag
} else {
set arglist $args
set optlist $args
set contents ""
}
} else {
#set arglist [lrange $args 0 end-1]
#set contents [lindex $args end]
set contents [lpop arglist end]
set contents [lpop optlist end]
set has_contents 1
}
@ -7333,7 +7427,7 @@ tcl::namespace::eval textblock {
#use -buildcache 1 with -usecache 0 for debugging cache issues so we can inspect using textblock::frame_cache
set optnames [tcl::dict::keys $opts]
set opts_ok 1 ;#default assumption
foreach {k v} $arglist {
foreach {k v} $optlist {
set k2 [tcl::prefix::match -error "" $optnames $k]
switch -- $k2 {
-etabs - -type - -boxlimits - -boxmap - -joins
@ -7355,70 +7449,9 @@ tcl::namespace::eval textblock {
set check_args [dict get $opts -checkargs]
#only use punk::args if check_args is true or our basic checks failed
if {!$opts_ok || $check_args} {
#error "Usage frame ?-type unicode|altg|ascii|<dict hl (c) vl (c) tlc (c) trc (c) blc (c) brc (c)>? ?-title <ansitext>? ?-subtitle <ansitext>? ?-width <columns>? ?-ansiborder <ansi_sgr>? ?-boxlimits hl|hlt|hlb|vl|vll|vlr|tlc|blc|brc? ?-joins left|right|up|down? <contents>"
set FRAMETYPES [textblock::frametypes]
set EG [a+ brightblack]
set RST [a]
set argd [punk::args::get_dict [punk::lib::tstr -return string {
*proc -name "textblock::frame"\
-help "Frame a block of text with a border."
-checkargs -default 1 -type boolean\
-help "If true do extra argument checks and
provide more comprehensive error info.
Set false for slight performance improvement."
-etabs -default 0\
-help "expanding tabs - experimental/unimplemented."
-type -default light -choices {${$FRAMETYPES}} -choicerestricted 0 -type dict\
-help "Type of border for frame."
-boxlimits -default {hl vl tlc blc trc brc} -type list -help "Limit the border box to listed elements.
passing an empty string will result in no box, but title/subtitle will still appear if supplied.
${$EG}e.g: -frame -boxlimits {} -title things [a+ red White]my\\ncontent${$RST}"
-boxmap -default {} -type dict
-joins -default {} -type list
-title -default "" -type string -regexprefail {\n}\
-help "Frame title placed on topbar - no newlines.
May contain ANSI - no trailing reset required.
${$EG}e.g 1: frame -title My[a+ green]Green[a]Thing
e.g 2: frame -title [a+ red underline]MyThing${$RST}"
-subtitle -default "" -type string -regexprefail {\n}\
-help "Frame subtitle placed on bottombar - no newlines
May contain Ansi - no trailing reset required."
-width -default "" -type int\
-help "Width of resulting frame including borders.
If omitted or empty-string, the width will be determined automatically based on content."
-height -default "" -type int\
-help "Height of resulting frame including borders."
-ansiborder -default "" -type ansistring\
-help "Ansi escape sequence to set border attributes.
${$EG}e.g 1: frame -ansiborder [a+ web-red] contents
e.g 2: frame -ansiborder \"\\x1b\\\[31m\" contents${$RST}"
-ansibase -default "" -type ansistring\
-help "Default ANSI attributes within frame."
-blockalign -default centre -choices {left right centre}\
-help "Alignment of the content block within the frame."
-pad -default 1 -type boolean -help "Whether to pad within the ANSI so content background
extends within the content block inside the frame.
Has no effect if no ANSI in content."
-textalign -default left -choices {left right centre}\
-help "Alignment of text within the content block. (centre unimplemented)"
-ellipsis -default 1 -type boolean\
-help "Whether to show elipsis for truncated content and title/subtitle."
-usecache -default 1 -type boolean
-buildcache -default 1 -type boolean
-crm_mode -default 0 -type boolean\
-help "Show ANSI control characters within frame contents.
(Control Representation Mode)
Frame width doesn't adapt and content may be truncated
so -width may need to be manually set to display more."
*values -min 0 -max 1
contents -default "" -type string\
-help "Frame contents - may be a block of text containing newlines and ANSI.
Text may be 'ragged' - ie unequal line-lengths.
No trailing ANSI reset required.
${$EG}e.g: frame \"[a+ blue White] \\nMy blue foreground text on\\nwhite background\\n\"${$RST}"
}] $args]
#never need to checkargs if only one argument supplied even if it looks like an option - as it will be treated as data to frame
if {[llength $args] != 1 && (!$opts_ok || $check_args)} {
set argd [punk::args::get_by_id textblock::frame $args]
set opts [dict get $argd opts]
set contents [dict get $argd values contents]
}
@ -7446,7 +7479,10 @@ tcl::namespace::eval textblock {
set opt_ansiborder [tcl::dict::get $opts -ansiborder]
set opt_ansibase [tcl::dict::get $opts -ansibase] ;#experimental
set opt_ellipsis [tcl::dict::get $opts -ellipsis]
set opt_blockalign [tcl::dict::get $opts -blockalign]
set opt_textalign [tcl::dict::get $opts -textalign]
set custom_keys [list hl hlt hlb vl vll vlr tlc trc blc brc]
set known_frametypes $frametypes ;# light, heavey etc as defined in the ::textblock::frametypes variable
@ -7463,107 +7499,26 @@ tcl::namespace::eval textblock {
set framedef $ftype
}
set is_boxlimits_ok 1
set exact_boxlimits [list]
foreach v $opt_boxlimits {
switch -- $v {
hl {
lappend exact_boxlimits hlt hlb
}
vl {
lappend exact_boxlimits vll vlr
}
hlt - hlb - vll - vlr - tlc - trc - blc - brc {
lappend exact_boxlimits $v
}
default {
#k not in custom_keys
set is_boxlimits_ok 0
break
}
}
}
#review vllj etc?
if {!$is_boxlimits_ok} {
error "frame option -boxlimits '$opt_boxlimits' must contain only values from the set: hl,hlt,hlb,vl,vll,vlr,tlc,trc,blc,brc"
}
set exact_boxlimits [lsort -unique $exact_boxlimits]
#if check_args?
set is_joins_ok 1
foreach v $opt_joins {
lassign [split $v -] direction target
switch -- $direction {
left - right - up - down {}
default {
set is_joins_ok 0
break
}
}
switch -- $target {
"" - light - light_b - light_c - heavy - heavy_b - heavy_c - ascii - altg - arc - arc_b - arc_c - double - custom - block - block1 - block2 {}
default {
set is_joins_ok 0
break
}
}
}
if {!$is_joins_ok} {
error "frame option -joins '$opt_joins' must contain only values from the set: left,right,up,down with targets heavy,light,ascii,altg,arc,double,block,block1,custom e.g down-light"
}
set is_boxmap_ok 1
tcl::dict::for {boxelement subst} $opt_boxmap {
switch -- $boxelement {
hl - hlt - hlb - vl - vll - vlr - tlc - trc - blc - brc {}
hltj - hlbj - vllj - vlrj {}
default {
set is_boxmap_ok 0
break
}
}
}
if {!$is_boxmap_ok} {
error "frame option -boxmap '$opt_boxmap' must contain only keys from the set: hl,hlt,hlb,vl,vll,vlr,tlc,trc,blc,brc,hltj,hlbj,vllj,vlrj"
}
#sorted order down left right up
#1 x choose 4
#4 x choose 3
#6 x choose 2
#4 x choose 1
#15 combos
set join_directions [list]
#targets - light,heavy (double?) - seem to be some required glyphs missing from unicode
#e.g down-light, up-heavy
set join_targets [tcl::dict::create left "" down "" right "" up ""]
foreach jt $opt_joins {
lassign [split $jt -] direction target
if {$target ne ""} {
tcl::dict::set join_targets $direction $target
}
lappend join_directions $direction
}
set join_directions [lsort -unique $join_directions]
set do_joins [::join $join_directions _]
#REVIEW - now done in framedef?
#set join_directions [list]
##targets - light,heavy (double?) - seem to be some required glyphs missing from unicode
##e.g down-light, up-heavy
#set join_targets [tcl::dict::create left "" down "" right "" up ""]
#foreach jt $opt_joins {
# lassign [split $jt -] direction target
# if {$target ne ""} {
# tcl::dict::set join_targets $direction $target
# }
# lappend join_directions $direction
#}
#set join_directions [lsort -unique $join_directions]
#set do_joins [::join $join_directions _]
#JMN
switch -- $opt_blockalign {
left - right - centre - center {}
default {
error "frame option -blockalign must be left|right|centre|center - received: $opt_blockalign"
}
}
#these are all valid commands for overtype::<cmd>
# -- --- --- --- --- ---
set opt_textalign [tcl::dict::get $opts -textalign]
switch -- $opt_textalign {
left - right - centre - center {}
default {
error "frame option -textalign must be left|right|centre|center - received: $opt_textalign"
}
}
# -- --- --- --- --- ---
@ -7634,20 +7589,28 @@ tcl::namespace::eval textblock {
# -- --- --- --- --- --- --- --- ---
variable frame_cache
#review - custom frame affects frame_inner_width - exclude from caching?
#set cache_key [concat $arglist $frame_inner_width $frame_inner_height]
#set cache_key [concat $optlist $frame_inner_width $frame_inner_height]
#jmn
#set hashables [concat $arglist $frame_inner_width $frame_inner_height]
set hashables [list {*}$arglist $frame_inner_width $frame_inner_height]
#set hashables [concat $optlist $frame_inner_width $frame_inner_height]
set hashables [list {*}$optlist $frame_inner_width $frame_inner_height]
if {$use_md5} {
#package require md5 ;#already required at package load
if {[package vsatisfies [package present md5] 2- ] } {
set hash [md5::md5 -hex [encoding convertto utf-8 $hashables]] ;#need fast and unique to content - not cryptographic - review
} else {
set hash [md5::md5 [encoding convertto utf-8 $hashables]]
switch -- $use_hash {
sha1 {
package require sha1
set hash [sha1::sha1 [encoding convertto utf-8 $hashables]]
}
md5 {
package require md5
if {[package vsatisfies [package present md5] 2- ] } {
set hash [md5::md5 -hex [encoding convertto utf-8 $hashables]] ;#need fast and unique to content - not cryptographic - review
} else {
set hash [md5::md5 [encoding convertto utf-8 $hashables]]
}
}
none {
set hash $hashables
}
} else {
set hash $hashables
}
set cache_key "$hash-$frame_inner_width-$frame_inner_height-actualcontentwidth:$actual_contentwidth"
@ -7709,11 +7672,94 @@ tcl::namespace::eval textblock {
set used [tcl::dict::get $frame_cache $cache_key used]
tcl::dict::set frame_cache $cache_key used [expr {$used+1}] ;#update existing record
set is_cached 1
}
# -- --- --- --- --- --- --- --- ---
if {!$is_cached} {
# -- --- --- --- ---
# -- --- --- --- ---
set is_joins_ok 1
foreach v $opt_joins {
lassign [split $v -] direction target
switch -- $direction {
left - right - up - down {}
default {
set is_joins_ok 0
break
}
}
switch -- $target {
"" - light - light_b - light_c - heavy - heavy_b - heavy_c - ascii - altg - arc - arc_b - arc_c - double - custom - block - block1 - block2 {}
default {
set is_joins_ok 0
break
}
}
}
if {!$is_joins_ok} {
error "frame option -joins '$opt_joins' must contain only values from the set: left,right,up,down with targets heavy,light,ascii,altg,arc,double,block,block1,custom e.g down-light"
}
# -- --- --- --- --- ---
set is_boxmap_ok 1
tcl::dict::for {boxelement subst} $opt_boxmap {
switch -- $boxelement {
hl - hlt - hlb - vl - vll - vlr - tlc - trc - blc - brc {}
hltj - hlbj - vllj - vlrj {}
default {
set is_boxmap_ok 0
break
}
}
}
if {!$is_boxmap_ok} {
error "frame option -boxmap '$opt_boxmap' must contain only keys from the set: hl,hlt,hlb,vl,vll,vlr,tlc,trc,blc,brc,hltj,hlbj,vllj,vlrj"
}
# -- --- --- --- --- ---
#these are all valid commands for overtype::<cmd>
switch -- $opt_textalign {
left - right - centre - center {}
default {
error "frame option -textalign must be left|right|centre|center - received: $opt_textalign"
}
}
# -- --- --- --- --- ---
switch -- $opt_blockalign {
left - right - centre - center {}
default {
error "frame option -blockalign must be left|right|centre|center - received: $opt_blockalign"
}
}
# -- --- --- --- ---
# -- --- --- --- ---
set is_boxlimits_ok 1
set exact_boxlimits [list]
foreach v $opt_boxlimits {
switch -- $v {
hl {
lappend exact_boxlimits hlt hlb
}
vl {
lappend exact_boxlimits vll vlr
}
hlt - hlb - vll - vlr - tlc - trc - blc - brc {
lappend exact_boxlimits $v
}
default {
#k not in custom_keys
set is_boxlimits_ok 0
break
}
}
}
#review vllj etc?
if {!$is_boxlimits_ok} {
error "frame option -boxlimits '$opt_boxlimits' must contain only values from the set: hl,hlt,hlb,vl,vll,vlr,tlc,trc,blc,brc"
}
set exact_boxlimits [lsort -unique $exact_boxlimits]
# -- --- --- --- --- ---
set rst [a]
#set column [tcl::string::repeat " " $frame_inner_width] ;#default - may need to override for custom frame
set underlayline [tcl::string::repeat " " $frame_inner_width]
@ -8038,6 +8084,9 @@ tcl::namespace::eval textblock {
;#end !$is_cached
}
#use the same mechanism to build the final frame - whether from cache or template
if {$actual_contentwidth == 0} {
set fs [tcl::string::map [list $FSUB " "] $template]

323
src/embedded/man/files/_module_termscheme-0.1.0.tm.n

@ -0,0 +1,323 @@
'\"
'\" Generated from file '_module_termscheme-0\&.1\&.0\&.tm\&.man' by tcllib/doctools with format 'nroff'
'\" Copyright (c) 2024
'\"
.TH "shellspy_module_termscheme" 0 0\&.1\&.0 doc "-"
.\" The -*- nroff -*- definitions below are for supplemental macros used
.\" in Tcl/Tk manual entries.
.\"
.\" .AP type name in/out ?indent?
.\" Start paragraph describing an argument to a library procedure.
.\" type is type of argument (int, etc.), in/out is either "in", "out",
.\" or "in/out" to describe whether procedure reads or modifies arg,
.\" and indent is equivalent to second arg of .IP (shouldn't ever be
.\" needed; use .AS below instead)
.\"
.\" .AS ?type? ?name?
.\" Give maximum sizes of arguments for setting tab stops. Type and
.\" name are examples of largest possible arguments that will be passed
.\" to .AP later. If args are omitted, default tab stops are used.
.\"
.\" .BS
.\" Start box enclosure. From here until next .BE, everything will be
.\" enclosed in one large box.
.\"
.\" .BE
.\" End of box enclosure.
.\"
.\" .CS
.\" Begin code excerpt.
.\"
.\" .CE
.\" End code excerpt.
.\"
.\" .VS ?version? ?br?
.\" Begin vertical sidebar, for use in marking newly-changed parts
.\" of man pages. The first argument is ignored and used for recording
.\" the version when the .VS was added, so that the sidebars can be
.\" found and removed when they reach a certain age. If another argument
.\" is present, then a line break is forced before starting the sidebar.
.\"
.\" .VE
.\" End of vertical sidebar.
.\"
.\" .DS
.\" Begin an indented unfilled display.
.\"
.\" .DE
.\" End of indented unfilled display.
.\"
.\" .SO ?manpage?
.\" Start of list of standard options for a Tk widget. The manpage
.\" argument defines where to look up the standard options; if
.\" omitted, defaults to "options". The options follow on successive
.\" lines, in three columns separated by tabs.
.\"
.\" .SE
.\" End of list of standard options for a Tk widget.
.\"
.\" .OP cmdName dbName dbClass
.\" Start of description of a specific option. cmdName gives the
.\" option's name as specified in the class command, dbName gives
.\" the option's name in the option database, and dbClass gives
.\" the option's class in the option database.
.\"
.\" .UL arg1 arg2
.\" Print arg1 underlined, then print arg2 normally.
.\"
.\" .QW arg1 ?arg2?
.\" Print arg1 in quotes, then arg2 normally (for trailing punctuation).
.\"
.\" .PQ arg1 ?arg2?
.\" Print an open parenthesis, arg1 in quotes, then arg2 normally
.\" (for trailing punctuation) and then a closing parenthesis.
.\"
.\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
.if t .wh -1.3i ^B
.nr ^l \n(.l
.ad b
.\" # Start an argument description
.de AP
.ie !"\\$4"" .TP \\$4
.el \{\
. ie !"\\$2"" .TP \\n()Cu
. el .TP 15
.\}
.ta \\n()Au \\n()Bu
.ie !"\\$3"" \{\
\&\\$1 \\fI\\$2\\fP (\\$3)
.\".b
.\}
.el \{\
.br
.ie !"\\$2"" \{\
\&\\$1 \\fI\\$2\\fP
.\}
.el \{\
\&\\fI\\$1\\fP
.\}
.\}
..
.\" # define tabbing values for .AP
.de AS
.nr )A 10n
.if !"\\$1"" .nr )A \\w'\\$1'u+3n
.nr )B \\n()Au+15n
.\"
.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
.nr )C \\n()Bu+\\w'(in/out)'u+2n
..
.AS Tcl_Interp Tcl_CreateInterp in/out
.\" # BS - start boxed text
.\" # ^y = starting y location
.\" # ^b = 1
.de BS
.br
.mk ^y
.nr ^b 1u
.if n .nf
.if n .ti 0
.if n \l'\\n(.lu\(ul'
.if n .fi
..
.\" # BE - end boxed text (draw box now)
.de BE
.nf
.ti 0
.mk ^t
.ie n \l'\\n(^lu\(ul'
.el \{\
.\" Draw four-sided box normally, but don't draw top of
.\" box if the box started on an earlier page.
.ie !\\n(^b-1 \{\
\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
.\}
.el \}\
\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
.\}
.\}
.fi
.br
.nr ^b 0
..
.\" # VS - start vertical sidebar
.\" # ^Y = starting y location
.\" # ^v = 1 (for troff; for nroff this doesn't matter)
.de VS
.if !"\\$2"" .br
.mk ^Y
.ie n 'mc \s12\(br\s0
.el .nr ^v 1u
..
.\" # VE - end of vertical sidebar
.de VE
.ie n 'mc
.el \{\
.ev 2
.nf
.ti 0
.mk ^t
\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
.sp -1
.fi
.ev
.\}
.nr ^v 0
..
.\" # Special macro to handle page bottom: finish off current
.\" # box/sidebar if in box/sidebar mode, then invoked standard
.\" # page bottom macro.
.de ^B
.ev 2
'ti 0
'nf
.mk ^t
.if \\n(^b \{\
.\" Draw three-sided box if this is the box's first page,
.\" draw two sides but no top otherwise.
.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
.\}
.if \\n(^v \{\
.nr ^x \\n(^tu+1v-\\n(^Yu
\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
.\}
.bp
'fi
.ev
.if \\n(^b \{\
.mk ^y
.nr ^b 2
.\}
.if \\n(^v \{\
.mk ^Y
.\}
..
.\" # DS - begin display
.de DS
.RS
.nf
.sp
..
.\" # DE - end display
.de DE
.fi
.RE
.sp
..
.\" # SO - start of list of standard options
.de SO
'ie '\\$1'' .ds So \\fBoptions\\fR
'el .ds So \\fB\\$1\\fR
.SH "STANDARD OPTIONS"
.LP
.nf
.ta 5.5c 11c
.ft B
..
.\" # SE - end of list of standard options
.de SE
.fi
.ft R
.LP
See the \\*(So manual entry for details on the standard options.
..
.\" # OP - start of full description for a single option
.de OP
.LP
.nf
.ta 4c
Command-Line Name: \\fB\\$1\\fR
Database Name: \\fB\\$2\\fR
Database Class: \\fB\\$3\\fR
.fi
.IP
..
.\" # CS - begin code excerpt
.de CS
.RS
.nf
.ta .25i .5i .75i 1i
..
.\" # CE - end code excerpt
.de CE
.fi
.RE
..
.\" # UL - underline word
.de UL
\\$1\l'|0\(ul'\\$2
..
.\" # QW - apply quotation marks to word
.de QW
.ie '\\*(lq'"' ``\\$1''\\$2
.\"" fix emacs highlighting
.el \\*(lq\\$1\\*(rq\\$2
..
.\" # PQ - apply parens and quotation marks to word
.de PQ
.ie '\\*(lq'"' (``\\$1''\\$2)\\$3
.\"" fix emacs highlighting
.el (\\*(lq\\$1\\*(rq\\$2)\\$3
..
.\" # QR - quoted range
.de QR
.ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3
.\"" fix emacs highlighting
.el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3
..
.\" # MT - "empty" string
.de MT
.QW ""
..
.BS
.SH NAME
shellspy_module_termscheme \- Module API
.SH SYNOPSIS
package require \fBtermscheme \fR
.sp
.BE
.SH DESCRIPTION
.PP
-
.SH OVERVIEW
.PP
overview of termscheme
.SS CONCEPTS
.PP
-
.SS DEPENDENCIES
.PP
packages used by termscheme
.IP \(bu
\fBTcl 8\&.6\fR
.PP
.SH API
.SS "NAMESPACE TERMSCHEME::CLASS"
.PP
class definitions
if { eq ""} {
.PP
}
}
++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
.SS "NAMESPACE TERMSCHEME"
.PP
Core API functions for termscheme
.PP
.SS "NAMESPACE TERMSCHEME::LIB"
.PP
Secondary functions that are part of the API
.PP
.SH INTERNAL
tcl::namespace::eval termscheme::system {
.SS "NAMESPACE TERMSCHEME::SYSTEM"
.PP
Internal functions that are not part of the API
.SH KEYWORDS
module
.SH COPYRIGHT
.nf
Copyright (c) 2024
.fi

4
src/embedded/man/files/punk/_module_ansi-0.1.1.tm.n

@ -362,7 +362,7 @@ package require \fBpunk::ansi \fR
.sp
\fBansistrip\fR \fItext\fR
.sp
\fBansistrip\fR \fItext\fR
\fBansistrip2\fR \fItext\fR
.sp
\fBansistripraw\fR \fItext\fR
.sp
@ -637,7 +637,7 @@ Return a string with ansi codes stripped out
.sp
Alternate graphics chars are replaced with modern unicode equivalents (e\&.g boxdrawing glyphs)
.TP
\fBansistrip\fR \fItext\fR
\fBansistrip2\fR \fItext\fR
.sp
Return a string with ansi codes stripped out
.sp

20
src/embedded/man/files/punk/_module_args-0.1.0.tm.n

@ -276,7 +276,7 @@ punkshell_module_punk::args \- args parsing
.SH SYNOPSIS
package require \fBpunk::args \fR
.sp
\fBget_dict\fR \fIoptionspecs\fR \fIrawargs\fR ?option value\&.\&.\&.?
\fBget_dict\fR \fIoptionspecs\fR \fIrawargs\fR
.sp
.BE
.SH DESCRIPTION
@ -325,7 +325,7 @@ The basic principle is that a call to punk::args::get_dict is made near the begi
#setting -type none indicates a flag that doesn't take a value (solo flag)
-nocomplain -type none
*values -min 1 -max -1
} $args]] opts values
} $args]] leaders opts values
puts "translation is [dict get $opts -translation]"
foreach f [dict values $values] {
@ -339,7 +339,7 @@ The lines beginning with * are optional in most cases and can be used to set def
.PP
- the above example would work just fine with only the -<optionname> lines, but would allow zero filenames to be supplied as no -min value is set for *values
.PP
valid * lines being with *proc *opts *values
valid * lines being with *proc *leaders *opts *values
.PP
lines beginning with a dash define options - a name can optionally be given to each trailing positional argument\&.
.PP
@ -363,7 +363,7 @@ It also demonstrates an inital argument 'category' that is outside of the scope
*values -min 2 -max 2
fileA -type existingfile 1
fileB -type existingfile 1
} $args]] opts values
} $args]] leaders opts values
puts "$category fileA: [dict get $values fileA]"
puts "$category fileB: [dict get $values fileB]"
}
@ -488,15 +488,19 @@ packages used by punk::args
\fBTcl 8\&.6-\fR
.PP
.SH API
.SS "NAMESPACE PUNK::ARGS::CLASS"
.SS "NAMESPACE PUNK::ARGS"
.PP
cooperative namespace punk::args::register
.PP
punk::args aware packages may add their own namespace to the public list variable NAMESPACES before or after punk::args is loaded
.PP
class definitions
The punk::args package will then test for a public list variable <namepace>::PUNKARGS containing argument definitions when it needs to\&.
.PP
.SS "NAMESPACE PUNK::ARGS"
.PP
Core API functions for punk::args
.TP
\fBget_dict\fR \fIoptionspecs\fR \fIrawargs\fR ?option value\&.\&.\&.?
\fBget_dict\fR \fIoptionspecs\fR \fIrawargs\fR
.sp
Parse rawargs as a sequence of zero or more option-value pairs followed by zero or more values
.sp
@ -525,7 +529,7 @@ where the valid keys for each option specification are: -default -type -range -c
.sp
comment lines begining with # are ignored and can be placed anywhere except within a multiline value where it would become part of that value
.sp
lines beginning with *proc *opts or *values also take -key val pairs and can be used to set defaults and control settings\&.
lines beginning with *proc *leaders *opts or *values also take -key val pairs and can be used to set defaults and control settings\&.
.sp
*opts or *values lines can appear multiple times with defaults affecting flags/values that follow\&.
.TP

4
src/embedded/man/files/punk/_module_console-0.1.1.tm.n

@ -298,7 +298,11 @@ packages used by punk::console
.IP \(bu
\fBTcl 8\&.6-\fR
.IP \(bu
\fBThread\fR
.IP \(bu
\fBpunk::ansi\fR
.IP \(bu
\fBpunk::args\fR
.PP
.SH API
.SS "NAMESPACE PUNK::CONSOLE"

2
src/embedded/man/files/punk/_module_lib-0.1.1.tm.n

@ -355,6 +355,8 @@ This requirement for no strong dependencies, means that many utility functions t
packages used by punk::lib
.IP \(bu
\fBTcl 8\&.6-\fR
.IP \(bu
\fBpunk::args\fR
.PP
.SH API
.SS "NAMESPACE PUNK::LIB::COMPAT"

328
src/embedded/man/files/punk/_module_safe-0.1.0.tm.n

@ -0,0 +1,328 @@
'\"
'\" Generated from file '_module_safe-0\&.1\&.0\&.tm\&.man' by tcllib/doctools with format 'nroff'
'\" Copyright (c) 2024
'\"
.TH "punkshell_module_punk::safe" 0 0\&.1\&.0 doc "punk::safe - safebase interpreters"
.\" The -*- nroff -*- definitions below are for supplemental macros used
.\" in Tcl/Tk manual entries.
.\"
.\" .AP type name in/out ?indent?
.\" Start paragraph describing an argument to a library procedure.
.\" type is type of argument (int, etc.), in/out is either "in", "out",
.\" or "in/out" to describe whether procedure reads or modifies arg,
.\" and indent is equivalent to second arg of .IP (shouldn't ever be
.\" needed; use .AS below instead)
.\"
.\" .AS ?type? ?name?
.\" Give maximum sizes of arguments for setting tab stops. Type and
.\" name are examples of largest possible arguments that will be passed
.\" to .AP later. If args are omitted, default tab stops are used.
.\"
.\" .BS
.\" Start box enclosure. From here until next .BE, everything will be
.\" enclosed in one large box.
.\"
.\" .BE
.\" End of box enclosure.
.\"
.\" .CS
.\" Begin code excerpt.
.\"
.\" .CE
.\" End code excerpt.
.\"
.\" .VS ?version? ?br?
.\" Begin vertical sidebar, for use in marking newly-changed parts
.\" of man pages. The first argument is ignored and used for recording
.\" the version when the .VS was added, so that the sidebars can be
.\" found and removed when they reach a certain age. If another argument
.\" is present, then a line break is forced before starting the sidebar.
.\"
.\" .VE
.\" End of vertical sidebar.
.\"
.\" .DS
.\" Begin an indented unfilled display.
.\"
.\" .DE
.\" End of indented unfilled display.
.\"
.\" .SO ?manpage?
.\" Start of list of standard options for a Tk widget. The manpage
.\" argument defines where to look up the standard options; if
.\" omitted, defaults to "options". The options follow on successive
.\" lines, in three columns separated by tabs.
.\"
.\" .SE
.\" End of list of standard options for a Tk widget.
.\"
.\" .OP cmdName dbName dbClass
.\" Start of description of a specific option. cmdName gives the
.\" option's name as specified in the class command, dbName gives
.\" the option's name in the option database, and dbClass gives
.\" the option's class in the option database.
.\"
.\" .UL arg1 arg2
.\" Print arg1 underlined, then print arg2 normally.
.\"
.\" .QW arg1 ?arg2?
.\" Print arg1 in quotes, then arg2 normally (for trailing punctuation).
.\"
.\" .PQ arg1 ?arg2?
.\" Print an open parenthesis, arg1 in quotes, then arg2 normally
.\" (for trailing punctuation) and then a closing parenthesis.
.\"
.\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
.if t .wh -1.3i ^B
.nr ^l \n(.l
.ad b
.\" # Start an argument description
.de AP
.ie !"\\$4"" .TP \\$4
.el \{\
. ie !"\\$2"" .TP \\n()Cu
. el .TP 15
.\}
.ta \\n()Au \\n()Bu
.ie !"\\$3"" \{\
\&\\$1 \\fI\\$2\\fP (\\$3)
.\".b
.\}
.el \{\
.br
.ie !"\\$2"" \{\
\&\\$1 \\fI\\$2\\fP
.\}
.el \{\
\&\\fI\\$1\\fP
.\}
.\}
..
.\" # define tabbing values for .AP
.de AS
.nr )A 10n
.if !"\\$1"" .nr )A \\w'\\$1'u+3n
.nr )B \\n()Au+15n
.\"
.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
.nr )C \\n()Bu+\\w'(in/out)'u+2n
..
.AS Tcl_Interp Tcl_CreateInterp in/out
.\" # BS - start boxed text
.\" # ^y = starting y location
.\" # ^b = 1
.de BS
.br
.mk ^y
.nr ^b 1u
.if n .nf
.if n .ti 0
.if n \l'\\n(.lu\(ul'
.if n .fi
..
.\" # BE - end boxed text (draw box now)
.de BE
.nf
.ti 0
.mk ^t
.ie n \l'\\n(^lu\(ul'
.el \{\
.\" Draw four-sided box normally, but don't draw top of
.\" box if the box started on an earlier page.
.ie !\\n(^b-1 \{\
\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
.\}
.el \}\
\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
.\}
.\}
.fi
.br
.nr ^b 0
..
.\" # VS - start vertical sidebar
.\" # ^Y = starting y location
.\" # ^v = 1 (for troff; for nroff this doesn't matter)
.de VS
.if !"\\$2"" .br
.mk ^Y
.ie n 'mc \s12\(br\s0
.el .nr ^v 1u
..
.\" # VE - end of vertical sidebar
.de VE
.ie n 'mc
.el \{\
.ev 2
.nf
.ti 0
.mk ^t
\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
.sp -1
.fi
.ev
.\}
.nr ^v 0
..
.\" # Special macro to handle page bottom: finish off current
.\" # box/sidebar if in box/sidebar mode, then invoked standard
.\" # page bottom macro.
.de ^B
.ev 2
'ti 0
'nf
.mk ^t
.if \\n(^b \{\
.\" Draw three-sided box if this is the box's first page,
.\" draw two sides but no top otherwise.
.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
.\}
.if \\n(^v \{\
.nr ^x \\n(^tu+1v-\\n(^Yu
\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
.\}
.bp
'fi
.ev
.if \\n(^b \{\
.mk ^y
.nr ^b 2
.\}
.if \\n(^v \{\
.mk ^Y
.\}
..
.\" # DS - begin display
.de DS
.RS
.nf
.sp
..
.\" # DE - end display
.de DE
.fi
.RE
.sp
..
.\" # SO - start of list of standard options
.de SO
'ie '\\$1'' .ds So \\fBoptions\\fR
'el .ds So \\fB\\$1\\fR
.SH "STANDARD OPTIONS"
.LP
.nf
.ta 5.5c 11c
.ft B
..
.\" # SE - end of list of standard options
.de SE
.fi
.ft R
.LP
See the \\*(So manual entry for details on the standard options.
..
.\" # OP - start of full description for a single option
.de OP
.LP
.nf
.ta 4c
Command-Line Name: \\fB\\$1\\fR
Database Name: \\fB\\$2\\fR
Database Class: \\fB\\$3\\fR
.fi
.IP
..
.\" # CS - begin code excerpt
.de CS
.RS
.nf
.ta .25i .5i .75i 1i
..
.\" # CE - end code excerpt
.de CE
.fi
.RE
..
.\" # UL - underline word
.de UL
\\$1\l'|0\(ul'\\$2
..
.\" # QW - apply quotation marks to word
.de QW
.ie '\\*(lq'"' ``\\$1''\\$2
.\"" fix emacs highlighting
.el \\*(lq\\$1\\*(rq\\$2
..
.\" # PQ - apply parens and quotation marks to word
.de PQ
.ie '\\*(lq'"' (``\\$1''\\$2)\\$3
.\"" fix emacs highlighting
.el (\\*(lq\\$1\\*(rq\\$2)\\$3
..
.\" # QR - quoted range
.de QR
.ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3
.\"" fix emacs highlighting
.el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3
..
.\" # MT - "empty" string
.de MT
.QW ""
..
.BS
.SH NAME
punkshell_module_punk::safe \- Module API
.SH SYNOPSIS
package require \fBpunk::safe \fR
.sp
\fBsetSyncMode\fR \fIargs\fR
.sp
.BE
.SH DESCRIPTION
.PP
-
.SH OVERVIEW
.PP
overview of punk::safe
.SS CONCEPTS
.PP
-
.SS DEPENDENCIES
.PP
packages used by punk::safe
.IP \(bu
\fBTcl 8\&.6\fR
.IP \(bu
\fBpunk::args\fR
.PP
.SH API
.SS "NAMESPACE PUNK::SAFE::CLASS"
.PP
class definitions
if { eq ""} {
.PP
}
}
++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
.SS "NAMESPACE PUNK::SAFE::LIB"
.PP
Secondary functions that are part of the API
.PP
.SS "NAMESPACE PUNK::SAFE"
.PP
Core API functions for punk::safe
.TP
\fBsetSyncMode\fR \fIargs\fR
.PP
.SH INTERNAL
.SS "NAMESPACE PUNK::SAFE::SYSTEM"
.PP
Internal functions that are not part of the API
.SH KEYWORDS
module
.SH COPYRIGHT
.nf
Copyright (c) 2024
.fi

326
src/embedded/man/files/punk/_module_sixel-0.1.0.tm.n

@ -0,0 +1,326 @@
'\"
'\" Generated from file '_module_sixel-0\&.1\&.0\&.tm\&.man' by tcllib/doctools with format 'nroff'
'\" Copyright (c) 2024
'\"
.TH "punkshell_module_punk::sixel" 0 0\&.1\&.0 doc "experimental sixel functions"
.\" The -*- nroff -*- definitions below are for supplemental macros used
.\" in Tcl/Tk manual entries.
.\"
.\" .AP type name in/out ?indent?
.\" Start paragraph describing an argument to a library procedure.
.\" type is type of argument (int, etc.), in/out is either "in", "out",
.\" or "in/out" to describe whether procedure reads or modifies arg,
.\" and indent is equivalent to second arg of .IP (shouldn't ever be
.\" needed; use .AS below instead)
.\"
.\" .AS ?type? ?name?
.\" Give maximum sizes of arguments for setting tab stops. Type and
.\" name are examples of largest possible arguments that will be passed
.\" to .AP later. If args are omitted, default tab stops are used.
.\"
.\" .BS
.\" Start box enclosure. From here until next .BE, everything will be
.\" enclosed in one large box.
.\"
.\" .BE
.\" End of box enclosure.
.\"
.\" .CS
.\" Begin code excerpt.
.\"
.\" .CE
.\" End code excerpt.
.\"
.\" .VS ?version? ?br?
.\" Begin vertical sidebar, for use in marking newly-changed parts
.\" of man pages. The first argument is ignored and used for recording
.\" the version when the .VS was added, so that the sidebars can be
.\" found and removed when they reach a certain age. If another argument
.\" is present, then a line break is forced before starting the sidebar.
.\"
.\" .VE
.\" End of vertical sidebar.
.\"
.\" .DS
.\" Begin an indented unfilled display.
.\"
.\" .DE
.\" End of indented unfilled display.
.\"
.\" .SO ?manpage?
.\" Start of list of standard options for a Tk widget. The manpage
.\" argument defines where to look up the standard options; if
.\" omitted, defaults to "options". The options follow on successive
.\" lines, in three columns separated by tabs.
.\"
.\" .SE
.\" End of list of standard options for a Tk widget.
.\"
.\" .OP cmdName dbName dbClass
.\" Start of description of a specific option. cmdName gives the
.\" option's name as specified in the class command, dbName gives
.\" the option's name in the option database, and dbClass gives
.\" the option's class in the option database.
.\"
.\" .UL arg1 arg2
.\" Print arg1 underlined, then print arg2 normally.
.\"
.\" .QW arg1 ?arg2?
.\" Print arg1 in quotes, then arg2 normally (for trailing punctuation).
.\"
.\" .PQ arg1 ?arg2?
.\" Print an open parenthesis, arg1 in quotes, then arg2 normally
.\" (for trailing punctuation) and then a closing parenthesis.
.\"
.\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
.if t .wh -1.3i ^B
.nr ^l \n(.l
.ad b
.\" # Start an argument description
.de AP
.ie !"\\$4"" .TP \\$4
.el \{\
. ie !"\\$2"" .TP \\n()Cu
. el .TP 15
.\}
.ta \\n()Au \\n()Bu
.ie !"\\$3"" \{\
\&\\$1 \\fI\\$2\\fP (\\$3)
.\".b
.\}
.el \{\
.br
.ie !"\\$2"" \{\
\&\\$1 \\fI\\$2\\fP
.\}
.el \{\
\&\\fI\\$1\\fP
.\}
.\}
..
.\" # define tabbing values for .AP
.de AS
.nr )A 10n
.if !"\\$1"" .nr )A \\w'\\$1'u+3n
.nr )B \\n()Au+15n
.\"
.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
.nr )C \\n()Bu+\\w'(in/out)'u+2n
..
.AS Tcl_Interp Tcl_CreateInterp in/out
.\" # BS - start boxed text
.\" # ^y = starting y location
.\" # ^b = 1
.de BS
.br
.mk ^y
.nr ^b 1u
.if n .nf
.if n .ti 0
.if n \l'\\n(.lu\(ul'
.if n .fi
..
.\" # BE - end boxed text (draw box now)
.de BE
.nf
.ti 0
.mk ^t
.ie n \l'\\n(^lu\(ul'
.el \{\
.\" Draw four-sided box normally, but don't draw top of
.\" box if the box started on an earlier page.
.ie !\\n(^b-1 \{\
\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
.\}
.el \}\
\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
.\}
.\}
.fi
.br
.nr ^b 0
..
.\" # VS - start vertical sidebar
.\" # ^Y = starting y location
.\" # ^v = 1 (for troff; for nroff this doesn't matter)
.de VS
.if !"\\$2"" .br
.mk ^Y
.ie n 'mc \s12\(br\s0
.el .nr ^v 1u
..
.\" # VE - end of vertical sidebar
.de VE
.ie n 'mc
.el \{\
.ev 2
.nf
.ti 0
.mk ^t
\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
.sp -1
.fi
.ev
.\}
.nr ^v 0
..
.\" # Special macro to handle page bottom: finish off current
.\" # box/sidebar if in box/sidebar mode, then invoked standard
.\" # page bottom macro.
.de ^B
.ev 2
'ti 0
'nf
.mk ^t
.if \\n(^b \{\
.\" Draw three-sided box if this is the box's first page,
.\" draw two sides but no top otherwise.
.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
.\}
.if \\n(^v \{\
.nr ^x \\n(^tu+1v-\\n(^Yu
\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
.\}
.bp
'fi
.ev
.if \\n(^b \{\
.mk ^y
.nr ^b 2
.\}
.if \\n(^v \{\
.mk ^Y
.\}
..
.\" # DS - begin display
.de DS
.RS
.nf
.sp
..
.\" # DE - end display
.de DE
.fi
.RE
.sp
..
.\" # SO - start of list of standard options
.de SO
'ie '\\$1'' .ds So \\fBoptions\\fR
'el .ds So \\fB\\$1\\fR
.SH "STANDARD OPTIONS"
.LP
.nf
.ta 5.5c 11c
.ft B
..
.\" # SE - end of list of standard options
.de SE
.fi
.ft R
.LP
See the \\*(So manual entry for details on the standard options.
..
.\" # OP - start of full description for a single option
.de OP
.LP
.nf
.ta 4c
Command-Line Name: \\fB\\$1\\fR
Database Name: \\fB\\$2\\fR
Database Class: \\fB\\$3\\fR
.fi
.IP
..
.\" # CS - begin code excerpt
.de CS
.RS
.nf
.ta .25i .5i .75i 1i
..
.\" # CE - end code excerpt
.de CE
.fi
.RE
..
.\" # UL - underline word
.de UL
\\$1\l'|0\(ul'\\$2
..
.\" # QW - apply quotation marks to word
.de QW
.ie '\\*(lq'"' ``\\$1''\\$2
.\"" fix emacs highlighting
.el \\*(lq\\$1\\*(rq\\$2
..
.\" # PQ - apply parens and quotation marks to word
.de PQ
.ie '\\*(lq'"' (``\\$1''\\$2)\\$3
.\"" fix emacs highlighting
.el (\\*(lq\\$1\\*(rq\\$2)\\$3
..
.\" # QR - quoted range
.de QR
.ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3
.\"" fix emacs highlighting
.el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3
..
.\" # MT - "empty" string
.de MT
.QW ""
..
.BS
.SH NAME
punkshell_module_punk::sixel \- punk::sixel API
.SH SYNOPSIS
package require \fBpunk::sixel \fR
.sp
.BE
.SH DESCRIPTION
.PP
Experimental support functions for working with sixel data
.PP
For real sixel work a version written in a systems language such as c or zig may be required\&.
.SH OVERVIEW
.PP
overview of punk::sixel
.SS CONCEPTS
.PP
-
.SS DEPENDENCIES
.PP
packages used by punk::sixel
.IP \(bu
\fBTcl 8\&.6\fR
.IP \(bu
\fBpunk::args\fR
.IP \(bu
\fBpunk::console\fR
.IP \(bu
\fBpunk::ansi\fR
.PP
.SH API
.SS "NAMESPACE PUNK::SIXEL::CLASS"
.PP
class definitions
if { eq ""} {
.PP
}
}
++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
.SS "NAMESPACE PUNK::SIXEL"
.PP
Core API functions for punk::sixel
.PP
.SS "NAMESPACE PUNK::SIXEL::LIB"
.PP
Secondary functions that are part of the API
.PP
.SH KEYWORDS
experimental, module
.SH COPYRIGHT
.nf
Copyright (c) 2024
.fi

325
src/embedded/man/files/punk/args/_module_tclcore-0.1.0.tm.n

@ -0,0 +1,325 @@
'\"
'\" Generated from file '_module_tclcore-0\&.1\&.0\&.tm\&.man' by tcllib/doctools with format 'nroff'
'\" Copyright (c) 2025
'\"
.TH "punkshell_module_punk::args::tclcore" 0 0\&.1\&.0 doc "tcl core argument definitions"
.\" The -*- nroff -*- definitions below are for supplemental macros used
.\" in Tcl/Tk manual entries.
.\"
.\" .AP type name in/out ?indent?
.\" Start paragraph describing an argument to a library procedure.
.\" type is type of argument (int, etc.), in/out is either "in", "out",
.\" or "in/out" to describe whether procedure reads or modifies arg,
.\" and indent is equivalent to second arg of .IP (shouldn't ever be
.\" needed; use .AS below instead)
.\"
.\" .AS ?type? ?name?
.\" Give maximum sizes of arguments for setting tab stops. Type and
.\" name are examples of largest possible arguments that will be passed
.\" to .AP later. If args are omitted, default tab stops are used.
.\"
.\" .BS
.\" Start box enclosure. From here until next .BE, everything will be
.\" enclosed in one large box.
.\"
.\" .BE
.\" End of box enclosure.
.\"
.\" .CS
.\" Begin code excerpt.
.\"
.\" .CE
.\" End code excerpt.
.\"
.\" .VS ?version? ?br?
.\" Begin vertical sidebar, for use in marking newly-changed parts
.\" of man pages. The first argument is ignored and used for recording
.\" the version when the .VS was added, so that the sidebars can be
.\" found and removed when they reach a certain age. If another argument
.\" is present, then a line break is forced before starting the sidebar.
.\"
.\" .VE
.\" End of vertical sidebar.
.\"
.\" .DS
.\" Begin an indented unfilled display.
.\"
.\" .DE
.\" End of indented unfilled display.
.\"
.\" .SO ?manpage?
.\" Start of list of standard options for a Tk widget. The manpage
.\" argument defines where to look up the standard options; if
.\" omitted, defaults to "options". The options follow on successive
.\" lines, in three columns separated by tabs.
.\"
.\" .SE
.\" End of list of standard options for a Tk widget.
.\"
.\" .OP cmdName dbName dbClass
.\" Start of description of a specific option. cmdName gives the
.\" option's name as specified in the class command, dbName gives
.\" the option's name in the option database, and dbClass gives
.\" the option's class in the option database.
.\"
.\" .UL arg1 arg2
.\" Print arg1 underlined, then print arg2 normally.
.\"
.\" .QW arg1 ?arg2?
.\" Print arg1 in quotes, then arg2 normally (for trailing punctuation).
.\"
.\" .PQ arg1 ?arg2?
.\" Print an open parenthesis, arg1 in quotes, then arg2 normally
.\" (for trailing punctuation) and then a closing parenthesis.
.\"
.\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
.if t .wh -1.3i ^B
.nr ^l \n(.l
.ad b
.\" # Start an argument description
.de AP
.ie !"\\$4"" .TP \\$4
.el \{\
. ie !"\\$2"" .TP \\n()Cu
. el .TP 15
.\}
.ta \\n()Au \\n()Bu
.ie !"\\$3"" \{\
\&\\$1 \\fI\\$2\\fP (\\$3)
.\".b
.\}
.el \{\
.br
.ie !"\\$2"" \{\
\&\\$1 \\fI\\$2\\fP
.\}
.el \{\
\&\\fI\\$1\\fP
.\}
.\}
..
.\" # define tabbing values for .AP
.de AS
.nr )A 10n
.if !"\\$1"" .nr )A \\w'\\$1'u+3n
.nr )B \\n()Au+15n
.\"
.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
.nr )C \\n()Bu+\\w'(in/out)'u+2n
..
.AS Tcl_Interp Tcl_CreateInterp in/out
.\" # BS - start boxed text
.\" # ^y = starting y location
.\" # ^b = 1
.de BS
.br
.mk ^y
.nr ^b 1u
.if n .nf
.if n .ti 0
.if n \l'\\n(.lu\(ul'
.if n .fi
..
.\" # BE - end boxed text (draw box now)
.de BE
.nf
.ti 0
.mk ^t
.ie n \l'\\n(^lu\(ul'
.el \{\
.\" Draw four-sided box normally, but don't draw top of
.\" box if the box started on an earlier page.
.ie !\\n(^b-1 \{\
\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
.\}
.el \}\
\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
.\}
.\}
.fi
.br
.nr ^b 0
..
.\" # VS - start vertical sidebar
.\" # ^Y = starting y location
.\" # ^v = 1 (for troff; for nroff this doesn't matter)
.de VS
.if !"\\$2"" .br
.mk ^Y
.ie n 'mc \s12\(br\s0
.el .nr ^v 1u
..
.\" # VE - end of vertical sidebar
.de VE
.ie n 'mc
.el \{\
.ev 2
.nf
.ti 0
.mk ^t
\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
.sp -1
.fi
.ev
.\}
.nr ^v 0
..
.\" # Special macro to handle page bottom: finish off current
.\" # box/sidebar if in box/sidebar mode, then invoked standard
.\" # page bottom macro.
.de ^B
.ev 2
'ti 0
'nf
.mk ^t
.if \\n(^b \{\
.\" Draw three-sided box if this is the box's first page,
.\" draw two sides but no top otherwise.
.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
.\}
.if \\n(^v \{\
.nr ^x \\n(^tu+1v-\\n(^Yu
\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
.\}
.bp
'fi
.ev
.if \\n(^b \{\
.mk ^y
.nr ^b 2
.\}
.if \\n(^v \{\
.mk ^Y
.\}
..
.\" # DS - begin display
.de DS
.RS
.nf
.sp
..
.\" # DE - end display
.de DE
.fi
.RE
.sp
..
.\" # SO - start of list of standard options
.de SO
'ie '\\$1'' .ds So \\fBoptions\\fR
'el .ds So \\fB\\$1\\fR
.SH "STANDARD OPTIONS"
.LP
.nf
.ta 5.5c 11c
.ft B
..
.\" # SE - end of list of standard options
.de SE
.fi
.ft R
.LP
See the \\*(So manual entry for details on the standard options.
..
.\" # OP - start of full description for a single option
.de OP
.LP
.nf
.ta 4c
Command-Line Name: \\fB\\$1\\fR
Database Name: \\fB\\$2\\fR
Database Class: \\fB\\$3\\fR
.fi
.IP
..
.\" # CS - begin code excerpt
.de CS
.RS
.nf
.ta .25i .5i .75i 1i
..
.\" # CE - end code excerpt
.de CE
.fi
.RE
..
.\" # UL - underline word
.de UL
\\$1\l'|0\(ul'\\$2
..
.\" # QW - apply quotation marks to word
.de QW
.ie '\\*(lq'"' ``\\$1''\\$2
.\"" fix emacs highlighting
.el \\*(lq\\$1\\*(rq\\$2
..
.\" # PQ - apply parens and quotation marks to word
.de PQ
.ie '\\*(lq'"' (``\\$1''\\$2)\\$3
.\"" fix emacs highlighting
.el (\\*(lq\\$1\\*(rq\\$2)\\$3
..
.\" # QR - quoted range
.de QR
.ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3
.\"" fix emacs highlighting
.el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3
..
.\" # MT - "empty" string
.de MT
.QW ""
..
.BS
.SH NAME
punkshell_module_punk::args::tclcore \- punk::args definitions for tcl core commands
.SH SYNOPSIS
package require \fBpunk::args::tclcore \fR
.sp
.BE
.SH DESCRIPTION
.PP
-
.SH OVERVIEW
.PP
overview of punk::args::tclcore
.SS CONCEPTS
.PP
-
.SS DEPENDENCIES
.PP
packages used by punk::args::tclcore
.IP \(bu
\fBTcl 8\&.6\fR
.IP \(bu
\fBpunk::args\fR
.PP
.SH API
.SS "NAMESPACE PUNK::ARGS::TCLCORE::CLASS"
.PP
class definitions
if { eq ""} {
.PP
}
}
++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
.SS "NAMESPACE PUNK::ARGS::TCLCORE"
.PP
Core API functions for punk::args::tclcore
.PP
.SS "NAMESPACE PUNK::ARGS::TCLCORE::LIB"
.PP
Secondary functions that are part of the API
.PP
.SH INTERNAL
tcl::namespace::eval punk::args::tclcore::system {
.SS "NAMESPACE PUNK::ARGS::TCLCORE::SYSTEM"
.PP
Internal functions that are not part of the API
.SH KEYWORDS
module
.SH COPYRIGHT
.nf
Copyright (c) 2025
.fi

4
src/embedded/man/files/punk/nav/_module_fs-0.1.0.tm.n

@ -2,7 +2,7 @@
'\" Generated from file '_module_fs-0\&.1\&.0\&.tm\&.man' by tcllib/doctools with format 'nroff'
'\" Copyright (c) 2024
'\"
.TH "shellspy_module_punk::nav::fs" 0 0\&.1\&.0 doc "fs nav"
.TH "punkshell_module_punk::nav::fs" 0 0\&.1\&.0 doc "fs nav"
.\" The -*- nroff -*- definitions below are for supplemental macros used
.\" in Tcl/Tk manual entries.
.\"
@ -272,7 +272,7 @@ Database Class: \\fB\\$3\\fR
..
.BS
.SH NAME
shellspy_module_punk::nav::fs \- punk::nav::fs console filesystem navigation
punkshell_module_punk::nav::fs \- punk::nav::fs console filesystem navigation
.SH SYNOPSIS
package require \fBpunk::nav::fs \fR
.sp

8
src/embedded/man/files/punk/repl/_module_codethread-0.1.0.tm.n

@ -2,7 +2,7 @@
'\" Generated from file '_module_codethread-0\&.1\&.0\&.tm\&.man' by tcllib/doctools with format 'nroff'
'\" Copyright (c) 2024
'\"
.TH "shellspy_module_punk::repl::codethread" 0 0\&.1\&.0 doc "codethread for repl - root interpreter"
.TH "punkshell_module_punk::repl::codethread" 0 0\&.1\&.0 doc "codethread for repl - root interpreter"
.\" The -*- nroff -*- definitions below are for supplemental macros used
.\" in Tcl/Tk manual entries.
.\"
@ -272,7 +272,7 @@ Database Class: \\fB\\$3\\fR
..
.BS
.SH NAME
shellspy_module_punk::repl::codethread \- Module repl codethread
punkshell_module_punk::repl::codethread \- Module repl codethread
.SH SYNOPSIS
package require \fBpunk::repl::codethread \fR
.sp
@ -296,11 +296,7 @@ packages used by punk::repl::codethread
.SS "NAMESPACE PUNK::REPL::CODETHREAD::CLASS"
.PP
class definitions
if { eq ""} {
.PP
}
}
++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
.SS "NAMESPACE PUNK::REPL::CODETHREAD"
.PP
Core API functions for punk::repl::codethread

318
src/embedded/man/files/punk/repl/_module_codethread-0.1.1.tm.n

@ -0,0 +1,318 @@
'\"
'\" Generated from file '_module_codethread-0\&.1\&.1\&.tm\&.man' by tcllib/doctools with format 'nroff'
'\" Copyright (c) 2024
'\"
.TH "punkshell_module_punk::repl::codethread" 0 0\&.1\&.1 doc "codethread for repl - root interpreter"
.\" The -*- nroff -*- definitions below are for supplemental macros used
.\" in Tcl/Tk manual entries.
.\"
.\" .AP type name in/out ?indent?
.\" Start paragraph describing an argument to a library procedure.
.\" type is type of argument (int, etc.), in/out is either "in", "out",
.\" or "in/out" to describe whether procedure reads or modifies arg,
.\" and indent is equivalent to second arg of .IP (shouldn't ever be
.\" needed; use .AS below instead)
.\"
.\" .AS ?type? ?name?
.\" Give maximum sizes of arguments for setting tab stops. Type and
.\" name are examples of largest possible arguments that will be passed
.\" to .AP later. If args are omitted, default tab stops are used.
.\"
.\" .BS
.\" Start box enclosure. From here until next .BE, everything will be
.\" enclosed in one large box.
.\"
.\" .BE
.\" End of box enclosure.
.\"
.\" .CS
.\" Begin code excerpt.
.\"
.\" .CE
.\" End code excerpt.
.\"
.\" .VS ?version? ?br?
.\" Begin vertical sidebar, for use in marking newly-changed parts
.\" of man pages. The first argument is ignored and used for recording
.\" the version when the .VS was added, so that the sidebars can be
.\" found and removed when they reach a certain age. If another argument
.\" is present, then a line break is forced before starting the sidebar.
.\"
.\" .VE
.\" End of vertical sidebar.
.\"
.\" .DS
.\" Begin an indented unfilled display.
.\"
.\" .DE
.\" End of indented unfilled display.
.\"
.\" .SO ?manpage?
.\" Start of list of standard options for a Tk widget. The manpage
.\" argument defines where to look up the standard options; if
.\" omitted, defaults to "options". The options follow on successive
.\" lines, in three columns separated by tabs.
.\"
.\" .SE
.\" End of list of standard options for a Tk widget.
.\"
.\" .OP cmdName dbName dbClass
.\" Start of description of a specific option. cmdName gives the
.\" option's name as specified in the class command, dbName gives
.\" the option's name in the option database, and dbClass gives
.\" the option's class in the option database.
.\"
.\" .UL arg1 arg2
.\" Print arg1 underlined, then print arg2 normally.
.\"
.\" .QW arg1 ?arg2?
.\" Print arg1 in quotes, then arg2 normally (for trailing punctuation).
.\"
.\" .PQ arg1 ?arg2?
.\" Print an open parenthesis, arg1 in quotes, then arg2 normally
.\" (for trailing punctuation) and then a closing parenthesis.
.\"
.\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
.if t .wh -1.3i ^B
.nr ^l \n(.l
.ad b
.\" # Start an argument description
.de AP
.ie !"\\$4"" .TP \\$4
.el \{\
. ie !"\\$2"" .TP \\n()Cu
. el .TP 15
.\}
.ta \\n()Au \\n()Bu
.ie !"\\$3"" \{\
\&\\$1 \\fI\\$2\\fP (\\$3)
.\".b
.\}
.el \{\
.br
.ie !"\\$2"" \{\
\&\\$1 \\fI\\$2\\fP
.\}
.el \{\
\&\\fI\\$1\\fP
.\}
.\}
..
.\" # define tabbing values for .AP
.de AS
.nr )A 10n
.if !"\\$1"" .nr )A \\w'\\$1'u+3n
.nr )B \\n()Au+15n
.\"
.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
.nr )C \\n()Bu+\\w'(in/out)'u+2n
..
.AS Tcl_Interp Tcl_CreateInterp in/out
.\" # BS - start boxed text
.\" # ^y = starting y location
.\" # ^b = 1
.de BS
.br
.mk ^y
.nr ^b 1u
.if n .nf
.if n .ti 0
.if n \l'\\n(.lu\(ul'
.if n .fi
..
.\" # BE - end boxed text (draw box now)
.de BE
.nf
.ti 0
.mk ^t
.ie n \l'\\n(^lu\(ul'
.el \{\
.\" Draw four-sided box normally, but don't draw top of
.\" box if the box started on an earlier page.
.ie !\\n(^b-1 \{\
\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
.\}
.el \}\
\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
.\}
.\}
.fi
.br
.nr ^b 0
..
.\" # VS - start vertical sidebar
.\" # ^Y = starting y location
.\" # ^v = 1 (for troff; for nroff this doesn't matter)
.de VS
.if !"\\$2"" .br
.mk ^Y
.ie n 'mc \s12\(br\s0
.el .nr ^v 1u
..
.\" # VE - end of vertical sidebar
.de VE
.ie n 'mc
.el \{\
.ev 2
.nf
.ti 0
.mk ^t
\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
.sp -1
.fi
.ev
.\}
.nr ^v 0
..
.\" # Special macro to handle page bottom: finish off current
.\" # box/sidebar if in box/sidebar mode, then invoked standard
.\" # page bottom macro.
.de ^B
.ev 2
'ti 0
'nf
.mk ^t
.if \\n(^b \{\
.\" Draw three-sided box if this is the box's first page,
.\" draw two sides but no top otherwise.
.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
.\}
.if \\n(^v \{\
.nr ^x \\n(^tu+1v-\\n(^Yu
\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
.\}
.bp
'fi
.ev
.if \\n(^b \{\
.mk ^y
.nr ^b 2
.\}
.if \\n(^v \{\
.mk ^Y
.\}
..
.\" # DS - begin display
.de DS
.RS
.nf
.sp
..
.\" # DE - end display
.de DE
.fi
.RE
.sp
..
.\" # SO - start of list of standard options
.de SO
'ie '\\$1'' .ds So \\fBoptions\\fR
'el .ds So \\fB\\$1\\fR
.SH "STANDARD OPTIONS"
.LP
.nf
.ta 5.5c 11c
.ft B
..
.\" # SE - end of list of standard options
.de SE
.fi
.ft R
.LP
See the \\*(So manual entry for details on the standard options.
..
.\" # OP - start of full description for a single option
.de OP
.LP
.nf
.ta 4c
Command-Line Name: \\fB\\$1\\fR
Database Name: \\fB\\$2\\fR
Database Class: \\fB\\$3\\fR
.fi
.IP
..
.\" # CS - begin code excerpt
.de CS
.RS
.nf
.ta .25i .5i .75i 1i
..
.\" # CE - end code excerpt
.de CE
.fi
.RE
..
.\" # UL - underline word
.de UL
\\$1\l'|0\(ul'\\$2
..
.\" # QW - apply quotation marks to word
.de QW
.ie '\\*(lq'"' ``\\$1''\\$2
.\"" fix emacs highlighting
.el \\*(lq\\$1\\*(rq\\$2
..
.\" # PQ - apply parens and quotation marks to word
.de PQ
.ie '\\*(lq'"' (``\\$1''\\$2)\\$3
.\"" fix emacs highlighting
.el (\\*(lq\\$1\\*(rq\\$2)\\$3
..
.\" # QR - quoted range
.de QR
.ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3
.\"" fix emacs highlighting
.el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3
..
.\" # MT - "empty" string
.de MT
.QW ""
..
.BS
.SH NAME
punkshell_module_punk::repl::codethread \- Module repl codethread
.SH SYNOPSIS
package require \fBpunk::repl::codethread \fR
.sp
.BE
.SH DESCRIPTION
.PP
This is part of the infrastructure required for the punk::repl to operate
.SH OVERVIEW
.PP
overview of punk::repl::codethread
.SS CONCEPTS
.PP
-
.SS DEPENDENCIES
.PP
packages used by punk::repl::codethread
.IP \(bu
\fBTcl 8\&.6\fR
.PP
.SH API
.SS "NAMESPACE PUNK::REPL::CODETHREAD::CLASS"
.PP
class definitions
.PP
.SS "NAMESPACE PUNK::REPL::CODETHREAD"
.PP
Core API functions for punk::repl::codethread
.PP
.SS "NAMESPACE PUNK::REPL::CODETHREAD::LIB"
.PP
Secondary functions that are part of the API
.PP
.SH INTERNAL
.SS "NAMESPACE PUNK::REPL::CODETHREAD::SYSTEM"
.PP
Internal functions that are not part of the API
.SH KEYWORDS
module, repl
.SH COPYRIGHT
.nf
Copyright (c) 2024
.fi

47
src/embedded/man/index.n

@ -430,6 +430,9 @@ punkshell_module_punk::cesu
.TP
\fBfiles/punk/_module_flib-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::flib
.TP
\fBfiles/punk/_module_sixel-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::sixel
.RE
fake
.RS
@ -461,11 +464,11 @@ filesystem
\fBfiles/punk/_module_island-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::island
.TP
\fBfiles/punk/nav/_module_fs-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::nav::fs
.TP
\fBfiles/punk/_module_path-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::path
.TP
\fBfiles/punk/nav/_module_fs-0\&.1\&.0\&.tm\&.n\fR
shellspy_module_punk::nav::fs
.RE
frame
.RS
@ -539,6 +542,9 @@ punkshell_module_punk::ansi
\fBfiles/punk/_module_args-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::args
.TP
\fBfiles/punk/args/_module_tclcore-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::args::tclcore
.TP
\fBfiles/punk/_module_assertion-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::assertion
.TP
@ -575,15 +581,30 @@ punkshell_module_punk::island
\fBfiles/punk/_module_lib-0\&.1\&.1\&.tm\&.n\fR
punkshell_module_punk::lib
.TP
\fBfiles/punk/nav/_module_fs-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::nav::fs
.TP
\fBfiles/punk/_module_packagepreference-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::packagepreference
.TP
\fBfiles/punk/_module_path-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::path
.TP
\fBfiles/punk/repl/_module_codethread-0\&.1\&.1\&.tm\&.n\fR
punkshell_module_punk::repl::codethread
.TP
\fBfiles/punk/repl/_module_codethread-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::repl::codethread
.TP
\fBfiles/punk/_module_rest-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::rest
.TP
\fBfiles/punk/_module_safe-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::safe
.TP
\fBfiles/punk/_module_sixel-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::sixel
.TP
\fBfiles/punk/_module_sshrun-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::sshrun
.TP
@ -608,15 +629,12 @@ punkshell_module_textblock
\fBfiles/_module_textblock-0\&.1\&.2\&.tm\&.n\fR
punkshell_module_textblock
.TP
\fBfiles/punk/nav/_module_fs-0\&.1\&.0\&.tm\&.n\fR
shellspy_module_punk::nav::fs
.TP
\fBfiles/punk/repl/_module_codethread-0\&.1\&.0\&.tm\&.n\fR
shellspy_module_punk::repl::codethread
.TP
\fBfiles/punk/_module_zip-0\&.1\&.0\&.tm\&.n\fR
shellspy_module_punk::zip
.TP
\fBfiles/_module_termscheme-0\&.1\&.0\&.tm\&.n\fR
shellspy_module_termscheme
.TP
\fBfiles/_module_tomlish-1\&.1\&.1\&.tm\&.n\fR
tomlish_module_tomlish
.RE
@ -704,8 +722,11 @@ punkshell__project_changes
\fBfiles/project_intro\&.n\fR
punkshell__project_intro
.TP
\fBfiles/punk/repl/_module_codethread-0\&.1\&.1\&.tm\&.n\fR
punkshell_module_punk::repl::codethread
.TP
\fBfiles/punk/repl/_module_codethread-0\&.1\&.0\&.tm\&.n\fR
shellspy_module_punk::repl::codethread
punkshell_module_punk::repl::codethread
.RE
rest
.RS
@ -785,11 +806,11 @@ punkshell_module_punk::ansi
\fBfiles/punk/_module_console-0\&.1\&.1\&.tm\&.n\fR
punkshell_module_punk::console
.TP
\fBfiles/punk/nav/_module_fs-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::nav::fs
.TP
\fBfiles/_module_textblock-0\&.1\&.2\&.tm\&.n\fR
punkshell_module_textblock
.TP
\fBfiles/punk/nav/_module_fs-0\&.1\&.0\&.tm\&.n\fR
shellspy_module_punk::nav::fs
.RE
text
.RS

27
src/embedded/man/toc.n

@ -309,6 +309,9 @@ doc
\fBpunkshell_module_punk::args\fR
\fIfiles/punk/_module_args-0\&.1\&.0\&.tm\&.n\fR: args parsing
.TP
\fBpunkshell_module_punk::args::tclcore\fR
\fIfiles/punk/args/_module_tclcore-0\&.1\&.0\&.tm\&.n\fR: punk::args definitions for tcl core commands
.TP
\fBpunkshell_module_punk::assertion\fR
\fIfiles/punk/_module_assertion-0\&.1\&.0\&.tm\&.n\fR: assertion alternative to control::assert
.TP
@ -348,15 +351,30 @@ doc
\fBpunkshell_module_punk::mix::commandset::project\fR
\fIfiles/punk/mix/commandset/_module_project-0\&.1\&.0\&.tm\&.n\fR: dec commandset - project
.TP
\fBpunkshell_module_punk::nav::fs\fR
\fIfiles/punk/nav/_module_fs-0\&.1\&.0\&.tm\&.n\fR: punk::nav::fs console filesystem navigation
.TP
\fBpunkshell_module_punk::packagepreference\fR
\fIfiles/punk/_module_packagepreference-0\&.1\&.0\&.tm\&.n\fR: punkshell package/module loading
.TP
\fBpunkshell_module_punk::path\fR
\fIfiles/punk/_module_path-0\&.1\&.0\&.tm\&.n\fR: Filesystem path utilities
.TP
\fBpunkshell_module_punk::repl::codethread\fR
\fIfiles/punk/repl/_module_codethread-0\&.1\&.1\&.tm\&.n\fR: Module repl codethread
.TP
\fBpunkshell_module_punk::repl::codethread\fR
\fIfiles/punk/repl/_module_codethread-0\&.1\&.0\&.tm\&.n\fR: Module repl codethread
.TP
\fBpunkshell_module_punk::rest\fR
\fIfiles/punk/_module_rest-0\&.1\&.0\&.tm\&.n\fR: punk::rest
.TP
\fBpunkshell_module_punk::safe\fR
\fIfiles/punk/_module_safe-0\&.1\&.0\&.tm\&.n\fR: Module API
.TP
\fBpunkshell_module_punk::sixel\fR
\fIfiles/punk/_module_sixel-0\&.1\&.0\&.tm\&.n\fR: punk::sixel API
.TP
\fBpunkshell_module_punk::sshrun\fR
\fIfiles/punk/_module_sshrun-0\&.1\&.0\&.tm\&.n\fR: Tcl procedures to execute tcl scripts in remote hosts
.TP
@ -381,14 +399,11 @@ doc
\fBpunkshell_module_textblock\fR
\fIfiles/_module_textblock-0\&.1\&.2\&.tm\&.n\fR: punk textblock functions
.TP
\fBshellspy_module_punk::nav::fs\fR
\fIfiles/punk/nav/_module_fs-0\&.1\&.0\&.tm\&.n\fR: punk::nav::fs console filesystem navigation
.TP
\fBshellspy_module_punk::repl::codethread\fR
\fIfiles/punk/repl/_module_codethread-0\&.1\&.0\&.tm\&.n\fR: Module repl codethread
.TP
\fBshellspy_module_punk::zip\fR
\fIfiles/punk/_module_zip-0\&.1\&.0\&.tm\&.n\fR: Module API
.TP
\fBshellspy_module_termscheme\fR
\fIfiles/_module_termscheme-0\&.1\&.0\&.tm\&.n\fR: Module API
.TP
\fBtomlish_module_tomlish\fR
\fIfiles/_module_tomlish-1\&.1\&.1\&.tm\&.n\fR: tomlish toml parser

9
src/embedded/md/.doc/tocdoc

@ -11,6 +11,7 @@
[item doc/files/punk/_module_aliascore-0.1.0.tm.md punkshell_module_punk::aliascore {punkshell command aliases}]
[item doc/files/punk/_module_ansi-0.1.1.tm.md punkshell_module_punk::ansi {Ansi string functions}]
[item doc/files/punk/_module_args-0.1.0.tm.md punkshell_module_punk::args {args parsing}]
[item doc/files/punk/args/_module_tclcore-0.1.0.tm.md punkshell_module_punk::args::tclcore {punk::args definitions for tcl core commands}]
[item doc/files/punk/_module_assertion-0.1.0.tm.md punkshell_module_punk::assertion {assertion alternative to control::assert}]
[item doc/files/punk/_module_blockletter-0.1.0.tm.md punkshell_module_punk::blockletter {punk::blockletter frame-based large lettering test/logo}]
[item doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap {capability provider and handler plugin system}]
@ -24,9 +25,14 @@
[item doc/files/punk/_module_island-0.1.0.tm.md punkshell_module_punk::island {filesystem islands for safe interps}]
[item doc/files/punk/_module_lib-0.1.1.tm.md punkshell_module_punk::lib {punk general utility functions}]
[item doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md punkshell_module_punk::mix::commandset::project {dec commandset - project}]
[item doc/files/punk/nav/_module_fs-0.1.0.tm.md punkshell_module_punk::nav::fs {punk::nav::fs console filesystem navigation}]
[item doc/files/punk/_module_packagepreference-0.1.0.tm.md punkshell_module_punk::packagepreference {punkshell package/module loading}]
[item doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path {Filesystem path utilities}]
[item doc/files/punk/repl/_module_codethread-0.1.0.tm.md punkshell_module_punk::repl::codethread {Module repl codethread}]
[item doc/files/punk/repl/_module_codethread-0.1.1.tm.md punkshell_module_punk::repl::codethread {Module repl codethread}]
[item doc/files/punk/_module_rest-0.1.0.tm.md punkshell_module_punk::rest punk::rest]
[item doc/files/punk/_module_safe-0.1.0.tm.md punkshell_module_punk::safe {Module API}]
[item doc/files/punk/_module_sixel-0.1.0.tm.md punkshell_module_punk::sixel {punk::sixel API}]
[item doc/files/punk/_module_sshrun-0.1.0.tm.md punkshell_module_punk::sshrun {Tcl procedures to execute tcl scripts in remote hosts}]
[item doc/files/punk/_module_trie-0.1.0.tm.md punkshell_module_punk::trie {punk::trie API}]
[item doc/files/punk/_module_uc-0.1.0.tm.md punkshell_module_punk::uc {Module API}]
@ -35,8 +41,7 @@
[item doc/files/punk/mix/commandset/_module_scriptwrap-0.1.0.tm.md punkshell_module_scriptwrap {scriptwrap polyglot tool}]
[item doc/files/_module_textblock-0.1.1.tm.md punkshell_module_textblock {punk textblock functions}]
[item doc/files/_module_textblock-0.1.2.tm.md punkshell_module_textblock {punk textblock functions}]
[item doc/files/punk/nav/_module_fs-0.1.0.tm.md shellspy_module_punk::nav::fs {punk::nav::fs console filesystem navigation}]
[item doc/files/punk/repl/_module_codethread-0.1.0.tm.md shellspy_module_punk::repl::codethread {Module repl codethread}]
[item doc/files/punk/_module_zip-0.1.0.tm.md shellspy_module_punk::zip {Module API}]
[item doc/files/_module_termscheme-0.1.0.tm.md shellspy_module_termscheme {Module API}]
[item doc/files/_module_tomlish-1.1.1.tm.md tomlish_module_tomlish {tomlish toml parser}]
[toc_end]

2
src/embedded/md/.idx

File diff suppressed because one or more lines are too long

2
src/embedded/md/.toc

@ -1 +1 @@
doc {doc/toc {{doc/files/punk/_module_uc-0.1.0.tm.md punkshell_module_punk::uc {Module API}} {doc/files/punk/_module_lib-0.1.1.tm.md punkshell_module_punk::lib {punk general utility functions}} {doc/files/punk/_module_cesu-0.1.0.tm.md punkshell_module_punk::cesu {CESU compatibility ehcoding scheme for utf-16: 8-Bit (CESU-8) ??}} {doc/files/punk/_module_assertion-0.1.0.tm.md punkshell_module_punk::assertion {assertion alternative to control::assert}} {doc/files/project_intro.md punkshell__project_intro {Introduction to punkshell}} {doc/files/_module_modpod-0.1.2.tm.md modpod_module_modpod {Module API}} {doc/files/punk/_module_experiment-0.1.0.tm.md punkshell_module_punk::experiment {Module API}} {doc/files/_module_poshinfo-0.1.0.tm.md punkshell_module_poshinfo {poshinfo prompt theme tool}} {doc/files/_module_argparsingtest-0.1.0.tm.md punkshell_module_argparsingtest {Module API}} {doc/files/punk/_module_sshrun-0.1.0.tm.md punkshell_module_punk::sshrun {Tcl procedures to execute tcl scripts in remote hosts}} {doc/files/punk/_module_packagepreference-0.1.0.tm.md punkshell_module_punk::packagepreference {punkshell package/module loading}} {doc/files/punk/_module_island-0.1.0.tm.md punkshell_module_punk::island {filesystem islands for safe interps}} {doc/files/punk/_module_aliascore-0.1.0.tm.md punkshell_module_punk::aliascore {punkshell command aliases}} {doc/files/main.md punkshell {punkshell - Core}} {doc/files/punk/_module_console-0.1.1.tm.md punkshell_module_punk::console {punk console}} {doc/files/_module_textblock-0.1.1.tm.md punkshell_module_textblock {punk textblock functions}} {doc/files/_module_overtype-1.6.5.tm.md overtype_module_overtype {overtype text layout - ansi aware}} {doc/files/punk/_module_flib-0.1.0.tm.md punkshell_module_punk::flib {flib experimental}} {doc/files/_module_tomlish-1.1.1.tm.md tomlish_module_tomlish {tomlish toml parser}} {doc/files/_module_textblock-0.1.2.tm.md punkshell_module_textblock {punk textblock functions}} {doc/files/punk/mix/commandset/_module_scriptwrap-0.1.0.tm.md punkshell_module_scriptwrap {scriptwrap polyglot tool}} {doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md punkshell_module_punk::mix::commandset::project {dec commandset - project}} {doc/files/punk/_module_rest-0.1.0.tm.md punkshell_module_punk::rest punk::rest} {doc/files/punk/_module_basictelnet-0.1.0.tm.md punkshell::basictelnet {basic telnet client - DKF/Wiki}} {doc/files/_module_fauxlink-0.1.1.tm.md fauxlink_module_fauxlink {faux link application shortcuts}} {doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline {file line-handling utilities}} {doc/files/punk/_module_zip-0.1.0.tm.md shellspy_module_punk::zip {Module API}} {doc/files/punk/_module_winlnk-0.1.0.tm.md punkshell_module_punk::winlnk {windows shortcut .lnk library}} {doc/files/punk/_module_blockletter-0.1.0.tm.md punkshell_module_punk::blockletter {punk::blockletter frame-based large lettering test/logo}} {doc/files/punk/_module_zip-0.1.1.tm.md punkshell_module_punk::zip {Module API}} {doc/files/punk/_module_trie-0.1.0.tm.md punkshell_module_punk::trie {punk::trie API}} {doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap {capability provider and handler plugin system}} {doc/files/punk/_module_ansi-0.1.1.tm.md punkshell_module_punk::ansi {Ansi string functions}} {doc/files/punk/repl/_module_codethread-0.1.0.tm.md shellspy_module_punk::repl::codethread {Module repl codethread}} {doc/files/punk/nav/_module_fs-0.1.0.tm.md shellspy_module_punk::nav::fs {punk::nav::fs console filesystem navigation}} {doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path {Filesystem path utilities}} {doc/files/punk/_module_args-0.1.0.tm.md punkshell_module_punk::args {args parsing}} {doc/files/project_changes.md punkshell__project_changes {punkshell Changes}} {doc/files/punk/_module_encmime-0.1.0.tm.md punkshell_module_punk::encmime {mime encodings related subset of tcllib mime}} {doc/files/punk/_module_char-0.1.0.tm.md punkshell_module_punk::char {character-set and unicode utilities}}}}
doc {doc/toc {{doc/files/punk/args/_module_tclcore-0.1.0.tm.md punkshell_module_punk::args::tclcore {punk::args definitions for tcl core commands}} {doc/files/punk/_module_uc-0.1.0.tm.md punkshell_module_punk::uc {Module API}} {doc/files/punk/_module_lib-0.1.1.tm.md punkshell_module_punk::lib {punk general utility functions}} {doc/files/punk/_module_cesu-0.1.0.tm.md punkshell_module_punk::cesu {CESU compatibility ehcoding scheme for utf-16: 8-Bit (CESU-8) ??}} {doc/files/punk/_module_assertion-0.1.0.tm.md punkshell_module_punk::assertion {assertion alternative to control::assert}} {doc/files/project_intro.md punkshell__project_intro {Introduction to punkshell}} {doc/files/_module_modpod-0.1.2.tm.md modpod_module_modpod {Module API}} {doc/files/punk/_module_experiment-0.1.0.tm.md punkshell_module_punk::experiment {Module API}} {doc/files/_module_poshinfo-0.1.0.tm.md punkshell_module_poshinfo {poshinfo prompt theme tool}} {doc/files/_module_argparsingtest-0.1.0.tm.md punkshell_module_argparsingtest {Module API}} {doc/files/punk/_module_sshrun-0.1.0.tm.md punkshell_module_punk::sshrun {Tcl procedures to execute tcl scripts in remote hosts}} {doc/files/punk/_module_packagepreference-0.1.0.tm.md punkshell_module_punk::packagepreference {punkshell package/module loading}} {doc/files/punk/_module_island-0.1.0.tm.md punkshell_module_punk::island {filesystem islands for safe interps}} {doc/files/punk/_module_aliascore-0.1.0.tm.md punkshell_module_punk::aliascore {punkshell command aliases}} {doc/files/main.md punkshell {punkshell - Core}} {doc/files/punk/_module_console-0.1.1.tm.md punkshell_module_punk::console {punk console}} {doc/files/_module_textblock-0.1.1.tm.md punkshell_module_textblock {punk textblock functions}} {doc/files/_module_overtype-1.6.5.tm.md overtype_module_overtype {overtype text layout - ansi aware}} {doc/files/punk/_module_sixel-0.1.0.tm.md punkshell_module_punk::sixel {punk::sixel API}} {doc/files/punk/_module_flib-0.1.0.tm.md punkshell_module_punk::flib {flib experimental}} {doc/files/_module_tomlish-1.1.1.tm.md tomlish_module_tomlish {tomlish toml parser}} {doc/files/_module_textblock-0.1.2.tm.md punkshell_module_textblock {punk textblock functions}} {doc/files/punk/mix/commandset/_module_scriptwrap-0.1.0.tm.md punkshell_module_scriptwrap {scriptwrap polyglot tool}} {doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md punkshell_module_punk::mix::commandset::project {dec commandset - project}} {doc/files/punk/_module_rest-0.1.0.tm.md punkshell_module_punk::rest punk::rest} {doc/files/punk/_module_basictelnet-0.1.0.tm.md punkshell::basictelnet {basic telnet client - DKF/Wiki}} {doc/files/_module_fauxlink-0.1.1.tm.md fauxlink_module_fauxlink {faux link application shortcuts}} {doc/files/punk/_module_safe-0.1.0.tm.md punkshell_module_punk::safe {Module API}} {doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline {file line-handling utilities}} {doc/files/_module_termscheme-0.1.0.tm.md shellspy_module_termscheme {Module API}} {doc/files/punk/_module_zip-0.1.0.tm.md shellspy_module_punk::zip {Module API}} {doc/files/punk/_module_winlnk-0.1.0.tm.md punkshell_module_punk::winlnk {windows shortcut .lnk library}} {doc/files/punk/_module_blockletter-0.1.0.tm.md punkshell_module_punk::blockletter {punk::blockletter frame-based large lettering test/logo}} {doc/files/punk/_module_zip-0.1.1.tm.md punkshell_module_punk::zip {Module API}} {doc/files/punk/_module_trie-0.1.0.tm.md punkshell_module_punk::trie {punk::trie API}} {doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap {capability provider and handler plugin system}} {doc/files/punk/_module_ansi-0.1.1.tm.md punkshell_module_punk::ansi {Ansi string functions}} {doc/files/punk/repl/_module_codethread-0.1.0.tm.md punkshell_module_punk::repl::codethread {Module repl codethread}} {doc/files/punk/nav/_module_fs-0.1.0.tm.md punkshell_module_punk::nav::fs {punk::nav::fs console filesystem navigation}} {doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path {Filesystem path utilities}} {doc/files/punk/_module_args-0.1.0.tm.md punkshell_module_punk::args {args parsing}} {doc/files/project_changes.md punkshell__project_changes {punkshell Changes}} {doc/files/punk/repl/_module_codethread-0.1.1.tm.md punkshell_module_punk::repl::codethread {Module repl codethread}} {doc/files/punk/_module_encmime-0.1.0.tm.md punkshell_module_punk::encmime {mime encodings related subset of tcllib mime}} {doc/files/punk/_module_char-0.1.0.tm.md punkshell_module_punk::char {character-set and unicode utilities}}}}

2
src/embedded/md/.xrf

File diff suppressed because one or more lines are too long

87
src/embedded/md/doc/files/_module_termscheme-0.1.0.tm.md

@ -0,0 +1,87 @@
[//000000001]: # (shellspy\_module\_termscheme \- \-)
[//000000002]: # (Generated from file '\_module\_termscheme\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown')
[//000000003]: # (Copyright &copy; 2024)
[//000000004]: # (shellspy\_module\_termscheme\(0\) 0\.1\.0 doc "\-")
<hr> [ <a href="../../toc.md">Main Table Of Contents</a> &#124; <a
href="../toc.md">Table Of Contents</a> &#124; <a
href="../../index.md">Keyword Index</a> ] <hr>
# NAME
shellspy\_module\_termscheme \- Module API
# <a name='toc'></a>Table Of Contents
- [Table Of Contents](#toc)
- [Synopsis](#synopsis)
- [Description](#section1)
- [Overview](#section2)
- [Concepts](#subsection1)
- [dependencies](#subsection2)
- [API](#section3)
- [Namespace termscheme::class](#subsection3)
- [Namespace termscheme](#subsection4)
- [Namespace termscheme::lib](#subsection5)
- [Internal](#section4)
- [Namespace termscheme::system](#subsection6)
- [Keywords](#keywords)
- [Copyright](#copyright)
# <a name='synopsis'></a>SYNOPSIS
package require termscheme
# <a name='description'></a>DESCRIPTION
\-
# <a name='section2'></a>Overview
overview of termscheme
## <a name='subsection1'></a>Concepts
\-
## <a name='subsection2'></a>dependencies
packages used by termscheme
- __Tcl 8\.6__
# <a name='section3'></a>API
## <a name='subsection3'></a>Namespace termscheme::class
class definitions if \{ eq ""\} \{
## <a name='subsection4'></a>Namespace termscheme
## <a name='subsection5'></a>Namespace termscheme::lib
# <a name='section4'></a>Internal
## <a name='subsection6'></a>Namespace termscheme::system
# <a name='keywords'></a>KEYWORDS
[module](\.\./\.\./index\.md\#module)
# <a name='copyright'></a>COPYRIGHT
Copyright &copy; 2024

4
src/embedded/md/doc/files/punk/_module_ansi-0.1.1.tm.md

@ -87,7 +87,7 @@ package require punk::ansi
[__request\_tabstops__](#41)
[__titleset__ *windowtitles*](#42)
[__ansistrip__ *text*](#43)
[__ansistrip__ *text*](#44)
[__ansistrip2__ *text*](#44)
[__ansistripraw__ *text*](#45)
[__is\_sgr\_reset__ *code*](#46)
[__has\_sgr\_leadingreset__ *code*](#47)
@ -384,7 +384,7 @@ Core API functions for punk::ansi
Alternate graphics chars are replaced with modern unicode equivalents \(e\.g
boxdrawing glyphs\)
- <a name='44'></a>__ansistrip__ *text*
- <a name='44'></a>__ansistrip2__ *text*
Return a string with ansi codes stripped out

26
src/embedded/md/doc/files/punk/_module_args-0.1.0.tm.md

@ -30,7 +30,7 @@ punkshell\_module\_punk::args \- args parsing
- [API](#section3)
- [Namespace punk::args::class](#subsection4)
- [Namespace punk::args](#subsection4)
- [Namespace punk::args](#subsection5)
@ -48,7 +48,7 @@ punkshell\_module\_punk::args \- args parsing
package require punk::args
[__get\_dict__ *optionspecs* *rawargs* ?option value\.\.\.?](#1)
[__get\_dict__ *optionspecs* *rawargs*](#1)
# <a name='description'></a>DESCRIPTION
@ -97,7 +97,7 @@ e\.g
#setting -type none indicates a flag that doesn't take a value (solo flag)
-nocomplain -type none
*values -min 1 -max -1
} $args]] opts values
} $args]] leaders opts values
puts "translation is [dict get $opts -translation]"
foreach f [dict values $values] {
@ -111,7 +111,7 @@ defaults and some extra controls
\- the above example would work just fine with only the \-<optionname> lines, but
would allow zero filenames to be supplied as no \-min value is set for \*values
valid \* lines being with \*proc \*opts \*values
valid \* lines being with \*proc \*leaders \*opts \*values
lines beginning with a dash define options \- a name can optionally be given to
each trailing positional argument\.
@ -138,7 +138,7 @@ for punk::args processing \- allowing leading and trailing positional arguments
*values -min 2 -max 2
fileA -type existingfile 1
fileB -type existingfile 1
} $args]] opts values
} $args]] leaders opts values
puts "$category fileA: [dict get $values fileA]"
puts "$category fileB: [dict get $values fileB]"
}
@ -271,13 +271,19 @@ packages used by punk::args
# <a name='section3'></a>API
## <a name='subsection4'></a>Namespace punk::args::class
## <a name='subsection5'></a>Namespace punk::args
cooperative namespace punk::args::register
punk::args aware packages may add their own namespace to the public list
variable NAMESPACES before or after punk::args is loaded
class definitions
The punk::args package will then test for a public list variable
<namepace>::PUNKARGS containing argument definitions when it needs to\.
## <a name='subsection5'></a>Namespace punk::args
- <a name='1'></a>__get\_dict__ *optionspecs* *rawargs* ?option value\.\.\.?
- <a name='1'></a>__get\_dict__ *optionspecs* *rawargs*
Parse rawargs as a sequence of zero or more option\-value pairs followed by
zero or more values
@ -311,8 +317,8 @@ class definitions
comment lines begining with \# are ignored and can be placed anywhere
except within a multiline value where it would become part of that value
lines beginning with \*proc \*opts or \*values also take \-key val pairs and
can be used to set defaults and control settings\.
lines beginning with \*proc \*leaders \*opts or \*values also take \-key val
pairs and can be used to set defaults and control settings\.
\*opts or \*values lines can appear multiple times with defaults affecting
flags/values that follow\.

4
src/embedded/md/doc/files/punk/_module_console-0.1.1.tm.md

@ -57,8 +57,12 @@ packages used by punk::console
- __Tcl 8\.6\-__
- __Thread__
- __punk::ansi__
- __punk::args__
# <a name='section3'></a>API
## <a name='subsection3'></a>Namespace punk::console

2
src/embedded/md/doc/files/punk/_module_lib-0.1.1.tm.md

@ -102,6 +102,8 @@ packages used by punk::lib
- __Tcl 8\.6\-__
- __punk::args__
# <a name='section3'></a>API
## <a name='subsection3'></a>Namespace punk::lib::compat

95
src/embedded/md/doc/files/punk/_module_safe-0.1.0.tm.md

@ -0,0 +1,95 @@
[//000000001]: # (punkshell\_module\_punk::safe \- punk::safe \- safebase interpreters)
[//000000002]: # (Generated from file '\_module\_safe\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown')
[//000000003]: # (Copyright &copy; 2024)
[//000000004]: # (punkshell\_module\_punk::safe\(0\) 0\.1\.0 doc "punk::safe \- safebase interpreters")
<hr> [ <a href="../../../toc.md">Main Table Of Contents</a> &#124; <a
href="../../toc.md">Table Of Contents</a> &#124; <a
href="../../../index.md">Keyword Index</a> ] <hr>
# NAME
punkshell\_module\_punk::safe \- Module API
# <a name='toc'></a>Table Of Contents
- [Table Of Contents](#toc)
- [Synopsis](#synopsis)
- [Description](#section1)
- [Overview](#section2)
- [Concepts](#subsection1)
- [dependencies](#subsection2)
- [API](#section3)
- [Namespace punk::safe::class](#subsection3)
- [Namespace punk::safe::lib](#subsection4)
- [Namespace punk::safe](#subsection5)
- [Internal](#section4)
- [Namespace punk::safe::system](#subsection6)
- [Keywords](#keywords)
- [Copyright](#copyright)
# <a name='synopsis'></a>SYNOPSIS
package require punk::safe
[__setSyncMode__ *args*](#1)
# <a name='description'></a>DESCRIPTION
\-
# <a name='section2'></a>Overview
overview of punk::safe
## <a name='subsection1'></a>Concepts
\-
## <a name='subsection2'></a>dependencies
packages used by punk::safe
- __Tcl 8\.6__
- __punk::args__
# <a name='section3'></a>API
## <a name='subsection3'></a>Namespace punk::safe::class
class definitions if \{ eq ""\} \{
## <a name='subsection4'></a>Namespace punk::safe::lib
## <a name='subsection5'></a>Namespace punk::safe
- <a name='1'></a>__setSyncMode__ *args*
# <a name='section4'></a>Internal
## <a name='subsection6'></a>Namespace punk::safe::system
Internal functions that are not part of the API
# <a name='keywords'></a>KEYWORDS
[module](\.\./\.\./\.\./index\.md\#module)
# <a name='copyright'></a>COPYRIGHT
Copyright &copy; 2024

89
src/embedded/md/doc/files/punk/_module_sixel-0.1.0.tm.md

@ -0,0 +1,89 @@
[//000000001]: # (punkshell\_module\_punk::sixel \- experimental sixel functions)
[//000000002]: # (Generated from file '\_module\_sixel\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown')
[//000000003]: # (Copyright &copy; 2024)
[//000000004]: # (punkshell\_module\_punk::sixel\(0\) 0\.1\.0 doc "experimental sixel functions")
<hr> [ <a href="../../../toc.md">Main Table Of Contents</a> &#124; <a
href="../../toc.md">Table Of Contents</a> &#124; <a
href="../../../index.md">Keyword Index</a> ] <hr>
# NAME
punkshell\_module\_punk::sixel \- punk::sixel API
# <a name='toc'></a>Table Of Contents
- [Table Of Contents](#toc)
- [Synopsis](#synopsis)
- [Description](#section1)
- [Overview](#section2)
- [Concepts](#subsection1)
- [dependencies](#subsection2)
- [API](#section3)
- [Namespace punk::sixel::class](#subsection3)
- [Namespace punk::sixel](#subsection4)
- [Namespace punk::sixel::lib](#subsection5)
- [Keywords](#keywords)
- [Copyright](#copyright)
# <a name='synopsis'></a>SYNOPSIS
package require punk::sixel
# <a name='description'></a>DESCRIPTION
Experimental support functions for working with sixel data
For real sixel work a version written in a systems language such as c or zig may
be required\.
# <a name='section2'></a>Overview
overview of punk::sixel
## <a name='subsection1'></a>Concepts
\-
## <a name='subsection2'></a>dependencies
packages used by punk::sixel
- __Tcl 8\.6__
- __punk::args__
- __punk::console__
- __punk::ansi__
# <a name='section3'></a>API
## <a name='subsection3'></a>Namespace punk::sixel::class
class definitions if \{ eq ""\} \{
## <a name='subsection4'></a>Namespace punk::sixel
## <a name='subsection5'></a>Namespace punk::sixel::lib
# <a name='keywords'></a>KEYWORDS
[experimental](\.\./\.\./\.\./index\.md\#experimental),
[module](\.\./\.\./\.\./index\.md\#module)
# <a name='copyright'></a>COPYRIGHT
Copyright &copy; 2024

90
src/embedded/md/doc/files/punk/args/_module_tclcore-0.1.0.tm.md

@ -0,0 +1,90 @@
[//000000001]: # (punkshell\_module\_punk::args::tclcore \- tcl core argument definitions)
[//000000002]: # (Generated from file '\_module\_tclcore\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown')
[//000000003]: # (Copyright &copy; 2025)
[//000000004]: # (punkshell\_module\_punk::args::tclcore\(0\) 0\.1\.0 doc "tcl core argument definitions")
<hr> [ <a href="../../../../toc.md">Main Table Of Contents</a> &#124; <a
href="../../../toc.md">Table Of Contents</a> &#124; <a
href="../../../../index.md">Keyword Index</a> ] <hr>
# NAME
punkshell\_module\_punk::args::tclcore \- punk::args definitions for tcl core
commands
# <a name='toc'></a>Table Of Contents
- [Table Of Contents](#toc)
- [Synopsis](#synopsis)
- [Description](#section1)
- [Overview](#section2)
- [Concepts](#subsection1)
- [dependencies](#subsection2)
- [API](#section3)
- [Namespace punk::args::tclcore::class](#subsection3)
- [Namespace punk::args::tclcore](#subsection4)
- [Namespace punk::args::tclcore::lib](#subsection5)
- [Internal](#section4)
- [Namespace punk::args::tclcore::system](#subsection6)
- [Keywords](#keywords)
- [Copyright](#copyright)
# <a name='synopsis'></a>SYNOPSIS
package require punk::args::tclcore
# <a name='description'></a>DESCRIPTION
\-
# <a name='section2'></a>Overview
overview of punk::args::tclcore
## <a name='subsection1'></a>Concepts
\-
## <a name='subsection2'></a>dependencies
packages used by punk::args::tclcore
- __Tcl 8\.6__
- __punk::args__
# <a name='section3'></a>API
## <a name='subsection3'></a>Namespace punk::args::tclcore::class
class definitions if \{ eq ""\} \{
## <a name='subsection4'></a>Namespace punk::args::tclcore
## <a name='subsection5'></a>Namespace punk::args::tclcore::lib
# <a name='section4'></a>Internal
## <a name='subsection6'></a>Namespace punk::args::tclcore::system
# <a name='keywords'></a>KEYWORDS
[module](\.\./\.\./\.\./\.\./index\.md\#module)
# <a name='copyright'></a>COPYRIGHT
Copyright &copy; 2025

6
src/embedded/md/doc/files/punk/nav/_module_fs-0.1.0.tm.md

@ -1,8 +1,8 @@
[//000000001]: # (shellspy\_module\_punk::nav::fs \- fs nav)
[//000000001]: # (punkshell\_module\_punk::nav::fs \- fs nav)
[//000000002]: # (Generated from file '\_module\_fs\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown')
[//000000003]: # (Copyright &copy; 2024)
[//000000004]: # (shellspy\_module\_punk::nav::fs\(0\) 0\.1\.0 doc "fs nav")
[//000000004]: # (punkshell\_module\_punk::nav::fs\(0\) 0\.1\.0 doc "fs nav")
<hr> [ <a href="../../../../toc.md">Main Table Of Contents</a> &#124; <a
href="../../../toc.md">Table Of Contents</a> &#124; <a
@ -10,7 +10,7 @@ href="../../../../index.md">Keyword Index</a> ] <hr>
# NAME
shellspy\_module\_punk::nav::fs \- punk::nav::fs console filesystem navigation
punkshell\_module\_punk::nav::fs \- punk::nav::fs console filesystem navigation
# <a name='toc'></a>Table Of Contents

8
src/embedded/md/doc/files/punk/repl/_module_codethread-0.1.0.tm.md

@ -1,8 +1,8 @@
[//000000001]: # (shellspy\_module\_punk::repl::codethread \- codethread for repl \- root interpreter)
[//000000001]: # (punkshell\_module\_punk::repl::codethread \- codethread for repl \- root interpreter)
[//000000002]: # (Generated from file '\_module\_codethread\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown')
[//000000003]: # (Copyright &copy; 2024)
[//000000004]: # (shellspy\_module\_punk::repl::codethread\(0\) 0\.1\.0 doc "codethread for repl \- root interpreter")
[//000000004]: # (punkshell\_module\_punk::repl::codethread\(0\) 0\.1\.0 doc "codethread for repl \- root interpreter")
<hr> [ <a href="../../../../toc.md">Main Table Of Contents</a> &#124; <a
href="../../../toc.md">Table Of Contents</a> &#124; <a
@ -10,7 +10,7 @@ href="../../../../index.md">Keyword Index</a> ] <hr>
# NAME
shellspy\_module\_punk::repl::codethread \- Module repl codethread
punkshell\_module\_punk::repl::codethread \- Module repl codethread
# <a name='toc'></a>Table Of Contents
@ -68,7 +68,7 @@ packages used by punk::repl::codethread
## <a name='subsection3'></a>Namespace punk::repl::codethread::class
class definitions if \{ eq ""\} \{
class definitions
## <a name='subsection4'></a>Namespace punk::repl::codethread

87
src/embedded/md/doc/files/punk/repl/_module_codethread-0.1.1.tm.md

@ -0,0 +1,87 @@
[//000000001]: # (punkshell\_module\_punk::repl::codethread \- codethread for repl \- root interpreter)
[//000000002]: # (Generated from file '\_module\_codethread\-0\.1\.1\.tm\.man' by tcllib/doctools with format 'markdown')
[//000000003]: # (Copyright &copy; 2024)
[//000000004]: # (punkshell\_module\_punk::repl::codethread\(0\) 0\.1\.1 doc "codethread for repl \- root interpreter")
<hr> [ <a href="../../../../toc.md">Main Table Of Contents</a> &#124; <a
href="../../../toc.md">Table Of Contents</a> &#124; <a
href="../../../../index.md">Keyword Index</a> ] <hr>
# NAME
punkshell\_module\_punk::repl::codethread \- Module repl codethread
# <a name='toc'></a>Table Of Contents
- [Table Of Contents](#toc)
- [Synopsis](#synopsis)
- [Description](#section1)
- [Overview](#section2)
- [Concepts](#subsection1)
- [dependencies](#subsection2)
- [API](#section3)
- [Namespace punk::repl::codethread::class](#subsection3)
- [Namespace punk::repl::codethread](#subsection4)
- [Namespace punk::repl::codethread::lib](#subsection5)
- [Internal](#section4)
- [Namespace punk::repl::codethread::system](#subsection6)
- [Keywords](#keywords)
- [Copyright](#copyright)
# <a name='synopsis'></a>SYNOPSIS
package require punk::repl::codethread
# <a name='description'></a>DESCRIPTION
This is part of the infrastructure required for the punk::repl to operate
# <a name='section2'></a>Overview
overview of punk::repl::codethread
## <a name='subsection1'></a>Concepts
\-
## <a name='subsection2'></a>dependencies
packages used by punk::repl::codethread
- __Tcl 8\.6__
# <a name='section3'></a>API
## <a name='subsection3'></a>Namespace punk::repl::codethread::class
class definitions
## <a name='subsection4'></a>Namespace punk::repl::codethread
## <a name='subsection5'></a>Namespace punk::repl::codethread::lib
# <a name='section4'></a>Internal
## <a name='subsection6'></a>Namespace punk::repl::codethread::system
# <a name='keywords'></a>KEYWORDS
[module](\.\./\.\./\.\./\.\./index\.md\#module), [repl](\.\./\.\./\.\./\.\./index\.md\#repl)
# <a name='copyright'></a>COPYRIGHT
Copyright &copy; 2024

18
src/embedded/md/doc/toc.md

@ -27,6 +27,8 @@
- [punkshell\_module\_punk::args](doc/files/punk/\_module\_args\-0\.1\.0\.tm\.md) args parsing
- [punkshell\_module\_punk::args::tclcore](doc/files/punk/args/\_module\_tclcore\-0\.1\.0\.tm\.md) punk::args definitions for tcl core commands
- [punkshell\_module\_punk::assertion](doc/files/punk/\_module\_assertion\-0\.1\.0\.tm\.md) assertion alternative to control::assert
- [punkshell\_module\_punk::blockletter](doc/files/punk/\_module\_blockletter\-0\.1\.0\.tm\.md) punk::blockletter frame\-based large lettering test/logo
@ -53,12 +55,22 @@
- [punkshell\_module\_punk::mix::commandset::project](doc/files/punk/mix/commandset/\_module\_project\-0\.1\.0\.tm\.md) dec commandset \- project
- [punkshell\_module\_punk::nav::fs](doc/files/punk/nav/\_module\_fs\-0\.1\.0\.tm\.md) punk::nav::fs console filesystem navigation
- [punkshell\_module\_punk::packagepreference](doc/files/punk/\_module\_packagepreference\-0\.1\.0\.tm\.md) punkshell package/module loading
- [punkshell\_module\_punk::path](doc/files/punk/\_module\_path\-0\.1\.0\.tm\.md) Filesystem path utilities
- [punkshell\_module\_punk::repl::codethread](doc/files/punk/repl/\_module\_codethread\-0\.1\.0\.tm\.md) Module repl codethread
- [punkshell\_module\_punk::repl::codethread](doc/files/punk/repl/\_module\_codethread\-0\.1\.1\.tm\.md) Module repl codethread
- [punkshell\_module\_punk::rest](doc/files/punk/\_module\_rest\-0\.1\.0\.tm\.md) punk::rest
- [punkshell\_module\_punk::safe](doc/files/punk/\_module\_safe\-0\.1\.0\.tm\.md) Module API
- [punkshell\_module\_punk::sixel](doc/files/punk/\_module\_sixel\-0\.1\.0\.tm\.md) punk::sixel API
- [punkshell\_module\_punk::sshrun](doc/files/punk/\_module\_sshrun\-0\.1\.0\.tm\.md) Tcl procedures to execute tcl scripts in remote hosts
- [punkshell\_module\_punk::trie](doc/files/punk/\_module\_trie\-0\.1\.0\.tm\.md) punk::trie API
@ -75,10 +87,8 @@
- [punkshell\_module\_textblock](doc/files/\_module\_textblock\-0\.1\.2\.tm\.md) punk textblock functions
- [shellspy\_module\_punk::nav::fs](doc/files/punk/nav/\_module\_fs\-0\.1\.0\.tm\.md) punk::nav::fs console filesystem navigation
- [shellspy\_module\_punk::repl::codethread](doc/files/punk/repl/\_module\_codethread\-0\.1\.0\.tm\.md) Module repl codethread
- [shellspy\_module\_punk::zip](doc/files/punk/\_module\_zip\-0\.1\.0\.tm\.md) Module API
- [shellspy\_module\_termscheme](doc/files/\_module\_termscheme\-0\.1\.0\.tm\.md) Module API
- [tomlish\_module\_tomlish](doc/files/\_module\_tomlish\-1\.1\.1\.tm\.md) tomlish toml parser

10
src/embedded/md/index.md

@ -57,7 +57,7 @@
|---|---|
|<a name='encoding'></a>encoding|[punkshell\_module\_punk::cesu](doc/files/punk/\_module\_cesu\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::fileline](doc/files/punk/\_module\_fileline\-0\.1\.0\.tm\.md)|
|<a name='encodings'></a>encodings|[punkshell\_module\_punk::char](doc/files/punk/\_module\_char\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::encmime](doc/files/punk/\_module\_encmime\-0\.1\.0\.tm\.md)|
|<a name='experimental'></a>experimental|[punkshell\_module\_punk::cesu](doc/files/punk/\_module\_cesu\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::flib](doc/files/punk/\_module\_flib\-0\.1\.0\.tm\.md)|
|<a name='experimental'></a>experimental|[punkshell\_module\_punk::cesu](doc/files/punk/\_module\_cesu\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::flib](doc/files/punk/\_module\_flib\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::sixel](doc/files/punk/\_module\_sixel\-0\.1\.0\.tm\.md)|
#### <a name='cF'></a>Keywords: F
@ -68,7 +68,7 @@
|<a name='faux'></a>faux|[fauxlink\_module\_fauxlink](doc/files/\_module\_fauxlink\-0\.1\.1\.tm\.md)|
|<a name='file'></a>file|[punkshell\_module\_punk::fileline](doc/files/punk/\_module\_fileline\-0\.1\.0\.tm\.md)|
|<a name='fileformat'></a>fileformat|[punkshell\_module\_punk::zip](doc/files/punk/\_module\_zip\-0\.1\.1\.tm\.md)|
|<a name='filesystem'></a>filesystem|[punkshell\_module\_punk::island](doc/files/punk/\_module\_island\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::path](doc/files/punk/\_module\_path\-0\.1\.0\.tm\.md) &#183; [shellspy\_module\_punk::nav::fs](doc/files/punk/nav/\_module\_fs\-0\.1\.0\.tm\.md)|
|<a name='filesystem'></a>filesystem|[punkshell\_module\_punk::island](doc/files/punk/\_module\_island\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::nav::fs](doc/files/punk/nav/\_module\_fs\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::path](doc/files/punk/\_module\_path\-0\.1\.0\.tm\.md)|
|<a name='frame'></a>frame|[punkshell\_module\_textblock](doc/files/\_module\_textblock\-0\.1\.2\.tm\.md)|
@ -100,7 +100,7 @@
|||
|---|---|
|<a name='module'></a>module|[modpod\_module\_modpod](doc/files/\_module\_modpod\-0\.1\.2\.tm\.md) &#183; [overtype\_module\_overtype](doc/files/\_module\_overtype\-1\.6\.5\.tm\.md) &#183; [punkshell::basictelnet](doc/files/punk/\_module\_basictelnet\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_argparsingtest](doc/files/\_module\_argparsingtest\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_poshinfo](doc/files/\_module\_poshinfo\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::aliascore](doc/files/punk/\_module\_aliascore\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::ansi](doc/files/punk/\_module\_ansi\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_punk::args](doc/files/punk/\_module\_args\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::assertion](doc/files/punk/\_module\_assertion\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::blockletter](doc/files/punk/\_module\_blockletter\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::cap](doc/files/punk/\_module\_cap\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::cesu](doc/files/punk/\_module\_cesu\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::char](doc/files/punk/\_module\_char\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::console](doc/files/punk/\_module\_console\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_punk::encmime](doc/files/punk/\_module\_encmime\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::experiment](doc/files/punk/\_module\_experiment\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::fileline](doc/files/punk/\_module\_fileline\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::flib](doc/files/punk/\_module\_flib\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::island](doc/files/punk/\_module\_island\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::lib](doc/files/punk/\_module\_lib\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_punk::packagepreference](doc/files/punk/\_module\_packagepreference\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::path](doc/files/punk/\_module\_path\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::rest](doc/files/punk/\_module\_rest\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::sshrun](doc/files/punk/\_module\_sshrun\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::trie](doc/files/punk/\_module\_trie\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::uc](doc/files/punk/\_module\_uc\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::winlnk](doc/files/punk/\_module\_winlnk\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::zip](doc/files/punk/\_module\_zip\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_scriptwrap](doc/files/punk/mix/commandset/\_module\_scriptwrap\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_textblock](doc/files/\_module\_textblock\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_textblock](doc/files/\_module\_textblock\-0\.1\.2\.tm\.md) &#183; [shellspy\_module\_punk::nav::fs](doc/files/punk/nav/\_module\_fs\-0\.1\.0\.tm\.md) &#183; [shellspy\_module\_punk::repl::codethread](doc/files/punk/repl/\_module\_codethread\-0\.1\.0\.tm\.md) &#183; [shellspy\_module\_punk::zip](doc/files/punk/\_module\_zip\-0\.1\.0\.tm\.md) &#183; [tomlish\_module\_tomlish](doc/files/\_module\_tomlish\-1\.1\.1\.tm\.md)|
|<a name='module'></a>module|[modpod\_module\_modpod](doc/files/\_module\_modpod\-0\.1\.2\.tm\.md) &#183; [overtype\_module\_overtype](doc/files/\_module\_overtype\-1\.6\.5\.tm\.md) &#183; [punkshell::basictelnet](doc/files/punk/\_module\_basictelnet\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_argparsingtest](doc/files/\_module\_argparsingtest\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_poshinfo](doc/files/\_module\_poshinfo\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::aliascore](doc/files/punk/\_module\_aliascore\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::ansi](doc/files/punk/\_module\_ansi\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_punk::args](doc/files/punk/\_module\_args\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::args::tclcore](doc/files/punk/args/\_module\_tclcore\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::assertion](doc/files/punk/\_module\_assertion\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::blockletter](doc/files/punk/\_module\_blockletter\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::cap](doc/files/punk/\_module\_cap\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::cesu](doc/files/punk/\_module\_cesu\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::char](doc/files/punk/\_module\_char\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::console](doc/files/punk/\_module\_console\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_punk::encmime](doc/files/punk/\_module\_encmime\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::experiment](doc/files/punk/\_module\_experiment\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::fileline](doc/files/punk/\_module\_fileline\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::flib](doc/files/punk/\_module\_flib\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::island](doc/files/punk/\_module\_island\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::lib](doc/files/punk/\_module\_lib\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_punk::nav::fs](doc/files/punk/nav/\_module\_fs\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::packagepreference](doc/files/punk/\_module\_packagepreference\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::path](doc/files/punk/\_module\_path\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::repl::codethread](doc/files/punk/repl/\_module\_codethread\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::repl::codethread](doc/files/punk/repl/\_module\_codethread\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_punk::rest](doc/files/punk/\_module\_rest\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::safe](doc/files/punk/\_module\_safe\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::sixel](doc/files/punk/\_module\_sixel\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::sshrun](doc/files/punk/\_module\_sshrun\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::trie](doc/files/punk/\_module\_trie\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::uc](doc/files/punk/\_module\_uc\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::winlnk](doc/files/punk/\_module\_winlnk\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::zip](doc/files/punk/\_module\_zip\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_scriptwrap](doc/files/punk/mix/commandset/\_module\_scriptwrap\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_textblock](doc/files/\_module\_textblock\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_textblock](doc/files/\_module\_textblock\-0\.1\.2\.tm\.md) &#183; [shellspy\_module\_punk::zip](doc/files/punk/\_module\_zip\-0\.1\.0\.tm\.md) &#183; [shellspy\_module\_termscheme](doc/files/\_module\_termscheme\-0\.1\.0\.tm\.md) &#183; [tomlish\_module\_tomlish](doc/files/\_module\_tomlish\-1\.1\.1\.tm\.md)|
#### <a name='cP'></a>Keywords: P
@ -124,7 +124,7 @@
|||
|---|---|
|<a name='repl'></a>repl|[punkshell](doc/files/main\.md) &#183; [punkshell\_\_project\_changes](doc/files/project\_changes\.md) &#183; [punkshell\_\_project\_intro](doc/files/project\_intro\.md) &#183; [shellspy\_module\_punk::repl::codethread](doc/files/punk/repl/\_module\_codethread\-0\.1\.0\.tm\.md)|
|<a name='repl'></a>repl|[punkshell](doc/files/main\.md) &#183; [punkshell\_\_project\_changes](doc/files/project\_changes\.md) &#183; [punkshell\_\_project\_intro](doc/files/project\_intro\.md) &#183; [punkshell\_module\_punk::repl::codethread](doc/files/punk/repl/\_module\_codethread\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::repl::codethread](doc/files/punk/repl/\_module\_codethread\-0\.1\.1\.tm\.md)|
|<a name='rest'></a>rest|[punkshell\_module\_punk::rest](doc/files/punk/\_module\_rest\-0\.1\.0\.tm\.md)|
@ -146,7 +146,7 @@
|---|---|
|<a name='table'></a>table|[punkshell\_module\_textblock](doc/files/\_module\_textblock\-0\.1\.2\.tm\.md)|
|<a name='telnet'></a>telnet|[punkshell::basictelnet](doc/files/punk/\_module\_basictelnet\-0\.1\.0\.tm\.md)|
|<a name='terminal'></a>terminal|[punkshell::basictelnet](doc/files/punk/\_module\_basictelnet\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_poshinfo](doc/files/\_module\_poshinfo\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::ansi](doc/files/punk/\_module\_ansi\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_punk::console](doc/files/punk/\_module\_console\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_textblock](doc/files/\_module\_textblock\-0\.1\.2\.tm\.md) &#183; [shellspy\_module\_punk::nav::fs](doc/files/punk/nav/\_module\_fs\-0\.1\.0\.tm\.md)|
|<a name='terminal'></a>terminal|[punkshell::basictelnet](doc/files/punk/\_module\_basictelnet\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_poshinfo](doc/files/\_module\_poshinfo\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_punk::ansi](doc/files/punk/\_module\_ansi\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_punk::console](doc/files/punk/\_module\_console\-0\.1\.1\.tm\.md) &#183; [punkshell\_module\_punk::nav::fs](doc/files/punk/nav/\_module\_fs\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_textblock](doc/files/\_module\_textblock\-0\.1\.2\.tm\.md)|
|<a name='text'></a>text|[overtype\_module\_overtype](doc/files/\_module\_overtype\-1\.6\.5\.tm\.md) &#183; [punkshell\_module\_punk::fileline](doc/files/punk/\_module\_fileline\-0\.1\.0\.tm\.md) &#183; [punkshell\_module\_textblock](doc/files/\_module\_textblock\-0\.1\.2\.tm\.md)|
|<a name='theme'></a>theme|[punkshell\_module\_poshinfo](doc/files/\_module\_poshinfo\-0\.1\.0\.tm\.md)|
|<a name='toml'></a>toml|[fauxlink\_module\_fauxlink](doc/files/\_module\_fauxlink\-0\.1\.1\.tm\.md) &#183; [tomlish\_module\_tomlish](doc/files/\_module\_tomlish\-1\.1\.1\.tm\.md)|

18
src/embedded/md/toc.md

@ -27,6 +27,8 @@
- [punkshell\_module\_punk::args](doc/files/punk/\_module\_args\-0\.1\.0\.tm\.md) args parsing
- [punkshell\_module\_punk::args::tclcore](doc/files/punk/args/\_module\_tclcore\-0\.1\.0\.tm\.md) punk::args definitions for tcl core commands
- [punkshell\_module\_punk::assertion](doc/files/punk/\_module\_assertion\-0\.1\.0\.tm\.md) assertion alternative to control::assert
- [punkshell\_module\_punk::blockletter](doc/files/punk/\_module\_blockletter\-0\.1\.0\.tm\.md) punk::blockletter frame\-based large lettering test/logo
@ -53,12 +55,22 @@
- [punkshell\_module\_punk::mix::commandset::project](doc/files/punk/mix/commandset/\_module\_project\-0\.1\.0\.tm\.md) dec commandset \- project
- [punkshell\_module\_punk::nav::fs](doc/files/punk/nav/\_module\_fs\-0\.1\.0\.tm\.md) punk::nav::fs console filesystem navigation
- [punkshell\_module\_punk::packagepreference](doc/files/punk/\_module\_packagepreference\-0\.1\.0\.tm\.md) punkshell package/module loading
- [punkshell\_module\_punk::path](doc/files/punk/\_module\_path\-0\.1\.0\.tm\.md) Filesystem path utilities
- [punkshell\_module\_punk::repl::codethread](doc/files/punk/repl/\_module\_codethread\-0\.1\.0\.tm\.md) Module repl codethread
- [punkshell\_module\_punk::repl::codethread](doc/files/punk/repl/\_module\_codethread\-0\.1\.1\.tm\.md) Module repl codethread
- [punkshell\_module\_punk::rest](doc/files/punk/\_module\_rest\-0\.1\.0\.tm\.md) punk::rest
- [punkshell\_module\_punk::safe](doc/files/punk/\_module\_safe\-0\.1\.0\.tm\.md) Module API
- [punkshell\_module\_punk::sixel](doc/files/punk/\_module\_sixel\-0\.1\.0\.tm\.md) punk::sixel API
- [punkshell\_module\_punk::sshrun](doc/files/punk/\_module\_sshrun\-0\.1\.0\.tm\.md) Tcl procedures to execute tcl scripts in remote hosts
- [punkshell\_module\_punk::trie](doc/files/punk/\_module\_trie\-0\.1\.0\.tm\.md) punk::trie API
@ -75,10 +87,8 @@
- [punkshell\_module\_textblock](doc/files/\_module\_textblock\-0\.1\.2\.tm\.md) punk textblock functions
- [shellspy\_module\_punk::nav::fs](doc/files/punk/nav/\_module\_fs\-0\.1\.0\.tm\.md) punk::nav::fs console filesystem navigation
- [shellspy\_module\_punk::repl::codethread](doc/files/punk/repl/\_module\_codethread\-0\.1\.0\.tm\.md) Module repl codethread
- [shellspy\_module\_punk::zip](doc/files/punk/\_module\_zip\-0\.1\.0\.tm\.md) Module API
- [shellspy\_module\_termscheme](doc/files/\_module\_termscheme\-0\.1\.0\.tm\.md) Module API
- [tomlish\_module\_tomlish](doc/files/\_module\_tomlish\-1\.1\.1\.tm\.md) tomlish toml parser

9
src/embedded/www/.doc/tocdoc

@ -11,6 +11,7 @@
[item doc/files/punk/_module_aliascore-0.1.0.tm.html punkshell_module_punk::aliascore {punkshell command aliases}]
[item doc/files/punk/_module_ansi-0.1.1.tm.html punkshell_module_punk::ansi {Ansi string functions}]
[item doc/files/punk/_module_args-0.1.0.tm.html punkshell_module_punk::args {args parsing}]
[item doc/files/punk/args/_module_tclcore-0.1.0.tm.html punkshell_module_punk::args::tclcore {punk::args definitions for tcl core commands}]
[item doc/files/punk/_module_assertion-0.1.0.tm.html punkshell_module_punk::assertion {assertion alternative to control::assert}]
[item doc/files/punk/_module_blockletter-0.1.0.tm.html punkshell_module_punk::blockletter {punk::blockletter frame-based large lettering test/logo}]
[item doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap {capability provider and handler plugin system}]
@ -24,9 +25,14 @@
[item doc/files/punk/_module_island-0.1.0.tm.html punkshell_module_punk::island {filesystem islands for safe interps}]
[item doc/files/punk/_module_lib-0.1.1.tm.html punkshell_module_punk::lib {punk general utility functions}]
[item doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html punkshell_module_punk::mix::commandset::project {dec commandset - project}]
[item doc/files/punk/nav/_module_fs-0.1.0.tm.html punkshell_module_punk::nav::fs {punk::nav::fs console filesystem navigation}]
[item doc/files/punk/_module_packagepreference-0.1.0.tm.html punkshell_module_punk::packagepreference {punkshell package/module loading}]
[item doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path {Filesystem path utilities}]
[item doc/files/punk/repl/_module_codethread-0.1.0.tm.html punkshell_module_punk::repl::codethread {Module repl codethread}]
[item doc/files/punk/repl/_module_codethread-0.1.1.tm.html punkshell_module_punk::repl::codethread {Module repl codethread}]
[item doc/files/punk/_module_rest-0.1.0.tm.html punkshell_module_punk::rest punk::rest]
[item doc/files/punk/_module_safe-0.1.0.tm.html punkshell_module_punk::safe {Module API}]
[item doc/files/punk/_module_sixel-0.1.0.tm.html punkshell_module_punk::sixel {punk::sixel API}]
[item doc/files/punk/_module_sshrun-0.1.0.tm.html punkshell_module_punk::sshrun {Tcl procedures to execute tcl scripts in remote hosts}]
[item doc/files/punk/_module_trie-0.1.0.tm.html punkshell_module_punk::trie {punk::trie API}]
[item doc/files/punk/_module_uc-0.1.0.tm.html punkshell_module_punk::uc {Module API}]
@ -35,8 +41,7 @@
[item doc/files/punk/mix/commandset/_module_scriptwrap-0.1.0.tm.html punkshell_module_scriptwrap {scriptwrap polyglot tool}]
[item doc/files/_module_textblock-0.1.1.tm.html punkshell_module_textblock {punk textblock functions}]
[item doc/files/_module_textblock-0.1.2.tm.html punkshell_module_textblock {punk textblock functions}]
[item doc/files/punk/nav/_module_fs-0.1.0.tm.html shellspy_module_punk::nav::fs {punk::nav::fs console filesystem navigation}]
[item doc/files/punk/repl/_module_codethread-0.1.0.tm.html shellspy_module_punk::repl::codethread {Module repl codethread}]
[item doc/files/punk/_module_zip-0.1.0.tm.html shellspy_module_punk::zip {Module API}]
[item doc/files/_module_termscheme-0.1.0.tm.html shellspy_module_termscheme {Module API}]
[item doc/files/_module_tomlish-1.1.1.tm.html tomlish_module_tomlish {tomlish toml parser}]
[toc_end]

2
src/embedded/www/.idx

File diff suppressed because one or more lines are too long

2
src/embedded/www/.toc

@ -1 +1 @@
doc {doc/toc {{doc/files/punk/_module_zip-0.1.1.tm.html punkshell_module_punk::zip {Module API}} {doc/files/punk/_module_trie-0.1.0.tm.html punkshell_module_punk::trie {punk::trie API}} {doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap {capability provider and handler plugin system}} {doc/files/punk/_module_ansi-0.1.1.tm.html punkshell_module_punk::ansi {Ansi string functions}} {doc/files/punk/repl/_module_codethread-0.1.0.tm.html shellspy_module_punk::repl::codethread {Module repl codethread}} {doc/files/punk/nav/_module_fs-0.1.0.tm.html shellspy_module_punk::nav::fs {punk::nav::fs console filesystem navigation}} {doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path {Filesystem path utilities}} {doc/files/punk/_module_args-0.1.0.tm.html punkshell_module_punk::args {args parsing}} {doc/files/project_changes.html punkshell__project_changes {punkshell Changes}} {doc/files/punk/_module_encmime-0.1.0.tm.html punkshell_module_punk::encmime {mime encodings related subset of tcllib mime}} {doc/files/punk/_module_char-0.1.0.tm.html punkshell_module_punk::char {character-set and unicode utilities}} {doc/files/punk/_module_uc-0.1.0.tm.html punkshell_module_punk::uc {Module API}} {doc/files/punk/_module_lib-0.1.1.tm.html punkshell_module_punk::lib {punk general utility functions}} {doc/files/punk/_module_cesu-0.1.0.tm.html punkshell_module_punk::cesu {CESU compatibility ehcoding scheme for utf-16: 8-Bit (CESU-8) ??}} {doc/files/punk/_module_assertion-0.1.0.tm.html punkshell_module_punk::assertion {assertion alternative to control::assert}} {doc/files/project_intro.html punkshell__project_intro {Introduction to punkshell}} {doc/files/_module_modpod-0.1.2.tm.html modpod_module_modpod {Module API}} {doc/files/punk/_module_experiment-0.1.0.tm.html punkshell_module_punk::experiment {Module API}} {doc/files/_module_poshinfo-0.1.0.tm.html punkshell_module_poshinfo {poshinfo prompt theme tool}} {doc/files/_module_argparsingtest-0.1.0.tm.html punkshell_module_argparsingtest {Module API}} {doc/files/punk/_module_sshrun-0.1.0.tm.html punkshell_module_punk::sshrun {Tcl procedures to execute tcl scripts in remote hosts}} {doc/files/punk/_module_packagepreference-0.1.0.tm.html punkshell_module_punk::packagepreference {punkshell package/module loading}} {doc/files/punk/_module_island-0.1.0.tm.html punkshell_module_punk::island {filesystem islands for safe interps}} {doc/files/punk/_module_aliascore-0.1.0.tm.html punkshell_module_punk::aliascore {punkshell command aliases}} {doc/files/main.html punkshell {punkshell - Core}} {doc/files/punk/_module_console-0.1.1.tm.html punkshell_module_punk::console {punk console}} {doc/files/_module_textblock-0.1.1.tm.html punkshell_module_textblock {punk textblock functions}} {doc/files/_module_overtype-1.6.5.tm.html overtype_module_overtype {overtype text layout - ansi aware}} {doc/files/punk/_module_flib-0.1.0.tm.html punkshell_module_punk::flib {flib experimental}} {doc/files/_module_tomlish-1.1.1.tm.html tomlish_module_tomlish {tomlish toml parser}} {doc/files/_module_textblock-0.1.2.tm.html punkshell_module_textblock {punk textblock functions}} {doc/files/punk/mix/commandset/_module_scriptwrap-0.1.0.tm.html punkshell_module_scriptwrap {scriptwrap polyglot tool}} {doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html punkshell_module_punk::mix::commandset::project {dec commandset - project}} {doc/files/punk/_module_rest-0.1.0.tm.html punkshell_module_punk::rest punk::rest} {doc/files/punk/_module_basictelnet-0.1.0.tm.html punkshell::basictelnet {basic telnet client - DKF/Wiki}} {doc/files/_module_fauxlink-0.1.1.tm.html fauxlink_module_fauxlink {faux link application shortcuts}} {doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline {file line-handling utilities}} {doc/files/punk/_module_zip-0.1.0.tm.html shellspy_module_punk::zip {Module API}} {doc/files/punk/_module_winlnk-0.1.0.tm.html punkshell_module_punk::winlnk {windows shortcut .lnk library}} {doc/files/punk/_module_blockletter-0.1.0.tm.html punkshell_module_punk::blockletter {punk::blockletter frame-based large lettering test/logo}}}}
doc {doc/toc {{doc/files/punk/_module_zip-0.1.1.tm.html punkshell_module_punk::zip {Module API}} {doc/files/punk/_module_trie-0.1.0.tm.html punkshell_module_punk::trie {punk::trie API}} {doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap {capability provider and handler plugin system}} {doc/files/punk/_module_ansi-0.1.1.tm.html punkshell_module_punk::ansi {Ansi string functions}} {doc/files/punk/repl/_module_codethread-0.1.0.tm.html punkshell_module_punk::repl::codethread {Module repl codethread}} {doc/files/punk/nav/_module_fs-0.1.0.tm.html punkshell_module_punk::nav::fs {punk::nav::fs console filesystem navigation}} {doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path {Filesystem path utilities}} {doc/files/punk/_module_args-0.1.0.tm.html punkshell_module_punk::args {args parsing}} {doc/files/project_changes.html punkshell__project_changes {punkshell Changes}} {doc/files/punk/repl/_module_codethread-0.1.1.tm.html punkshell_module_punk::repl::codethread {Module repl codethread}} {doc/files/punk/_module_encmime-0.1.0.tm.html punkshell_module_punk::encmime {mime encodings related subset of tcllib mime}} {doc/files/punk/_module_char-0.1.0.tm.html punkshell_module_punk::char {character-set and unicode utilities}} {doc/files/punk/args/_module_tclcore-0.1.0.tm.html punkshell_module_punk::args::tclcore {punk::args definitions for tcl core commands}} {doc/files/punk/_module_uc-0.1.0.tm.html punkshell_module_punk::uc {Module API}} {doc/files/punk/_module_lib-0.1.1.tm.html punkshell_module_punk::lib {punk general utility functions}} {doc/files/punk/_module_cesu-0.1.0.tm.html punkshell_module_punk::cesu {CESU compatibility ehcoding scheme for utf-16: 8-Bit (CESU-8) ??}} {doc/files/punk/_module_assertion-0.1.0.tm.html punkshell_module_punk::assertion {assertion alternative to control::assert}} {doc/files/project_intro.html punkshell__project_intro {Introduction to punkshell}} {doc/files/_module_modpod-0.1.2.tm.html modpod_module_modpod {Module API}} {doc/files/punk/_module_experiment-0.1.0.tm.html punkshell_module_punk::experiment {Module API}} {doc/files/_module_poshinfo-0.1.0.tm.html punkshell_module_poshinfo {poshinfo prompt theme tool}} {doc/files/_module_argparsingtest-0.1.0.tm.html punkshell_module_argparsingtest {Module API}} {doc/files/punk/_module_sshrun-0.1.0.tm.html punkshell_module_punk::sshrun {Tcl procedures to execute tcl scripts in remote hosts}} {doc/files/punk/_module_packagepreference-0.1.0.tm.html punkshell_module_punk::packagepreference {punkshell package/module loading}} {doc/files/punk/_module_island-0.1.0.tm.html punkshell_module_punk::island {filesystem islands for safe interps}} {doc/files/punk/_module_aliascore-0.1.0.tm.html punkshell_module_punk::aliascore {punkshell command aliases}} {doc/files/main.html punkshell {punkshell - Core}} {doc/files/punk/_module_console-0.1.1.tm.html punkshell_module_punk::console {punk console}} {doc/files/_module_textblock-0.1.1.tm.html punkshell_module_textblock {punk textblock functions}} {doc/files/_module_overtype-1.6.5.tm.html overtype_module_overtype {overtype text layout - ansi aware}} {doc/files/punk/_module_sixel-0.1.0.tm.html punkshell_module_punk::sixel {punk::sixel API}} {doc/files/punk/_module_flib-0.1.0.tm.html punkshell_module_punk::flib {flib experimental}} {doc/files/_module_tomlish-1.1.1.tm.html tomlish_module_tomlish {tomlish toml parser}} {doc/files/_module_textblock-0.1.2.tm.html punkshell_module_textblock {punk textblock functions}} {doc/files/punk/mix/commandset/_module_scriptwrap-0.1.0.tm.html punkshell_module_scriptwrap {scriptwrap polyglot tool}} {doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html punkshell_module_punk::mix::commandset::project {dec commandset - project}} {doc/files/punk/_module_rest-0.1.0.tm.html punkshell_module_punk::rest punk::rest} {doc/files/punk/_module_basictelnet-0.1.0.tm.html punkshell::basictelnet {basic telnet client - DKF/Wiki}} {doc/files/_module_fauxlink-0.1.1.tm.html fauxlink_module_fauxlink {faux link application shortcuts}} {doc/files/punk/_module_safe-0.1.0.tm.html punkshell_module_punk::safe {Module API}} {doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline {file line-handling utilities}} {doc/files/_module_termscheme-0.1.0.tm.html shellspy_module_termscheme {Module API}} {doc/files/punk/_module_zip-0.1.0.tm.html shellspy_module_punk::zip {Module API}} {doc/files/punk/_module_winlnk-0.1.0.tm.html punkshell_module_punk::winlnk {windows shortcut .lnk library}} {doc/files/punk/_module_blockletter-0.1.0.tm.html punkshell_module_punk::blockletter {punk::blockletter frame-based large lettering test/logo}}}}

2
src/embedded/www/.xrf

File diff suppressed because one or more lines are too long

192
src/embedded/www/doc/files/_module_termscheme-0.1.0.tm.html

@ -0,0 +1,192 @@
<!DOCTYPE html><html><head>
<title>shellspy_module_termscheme - -</title>
<style type="text/css"><!--
HTML {
background: #FFFFFF;
color: black;
}
BODY {
background: #FFFFFF;
color: black;
}
DIV.doctools {
margin-left: 10%;
margin-right: 10%;
}
DIV.doctools H1,DIV.doctools H2 {
margin-left: -5%;
}
H1, H2, H3, H4 {
margin-top: 1em;
font-family: sans-serif;
font-size: large;
color: #005A9C;
background: transparent;
text-align: left;
}
H1.doctools_title {
text-align: center;
}
UL,OL {
margin-right: 0em;
margin-top: 3pt;
margin-bottom: 3pt;
}
UL LI {
list-style: disc;
}
OL LI {
list-style: decimal;
}
DT {
padding-top: 1ex;
}
UL.doctools_toc,UL.doctools_toc UL, UL.doctools_toc UL UL {
font: normal 12pt/14pt sans-serif;
list-style: none;
}
LI.doctools_section, LI.doctools_subsection {
list-style: none;
margin-left: 0em;
text-indent: 0em;
padding: 0em;
}
PRE {
display: block;
font-family: monospace;
white-space: pre;
margin: 0%;
padding-top: 0.5ex;
padding-bottom: 0.5ex;
padding-left: 1ex;
padding-right: 1ex;
width: 100%;
}
PRE.doctools_example {
color: black;
background: #f5dcb3;
border: 1px solid black;
}
UL.doctools_requirements LI, UL.doctools_syntax LI {
list-style: none;
margin-left: 0em;
text-indent: 0em;
padding: 0em;
}
DIV.doctools_synopsis {
color: black;
background: #80ffff;
border: 1px solid black;
font-family: serif;
margin-top: 1em;
margin-bottom: 1em;
}
UL.doctools_syntax {
margin-top: 1em;
border-top: 1px solid black;
}
UL.doctools_requirements {
margin-bottom: 1em;
border-bottom: 1px solid black;
}
--></style>
</head>
<!-- Generated from file '_module_termscheme-0.1.0.tm.man' by tcllib/doctools with format 'html'
-->
<!-- Copyright &amp;copy; 2024
-->
<!-- shellspy_module_termscheme.0
-->
<body><hr> [
<a href="../../toc.html">Main Table Of Contents</a>
&#124; <a href="../toc.html">Table Of Contents</a>
&#124; <a href="../../index.html">Keyword Index</a>
] <hr>
<div class="doctools">
<h1 class="doctools_title">shellspy_module_termscheme(0) 0.1.0 doc &quot;-&quot;</h1>
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2>
<p>shellspy_module_termscheme - Module API</p>
</div>
<div id="toc" class="doctools_section"><h2><a name="toc">Table Of Contents</a></h2>
<ul class="doctools_toc">
<li class="doctools_section"><a href="#toc">Table Of Contents</a></li>
<li class="doctools_section"><a href="#synopsis">Synopsis</a></li>
<li class="doctools_section"><a href="#section1">Description</a></li>
<li class="doctools_section"><a href="#section2">Overview</a>
<ul>
<li class="doctools_subsection"><a href="#subsection1">Concepts</a></li>
<li class="doctools_subsection"><a href="#subsection2">dependencies</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section3">API</a>
<ul>
<li class="doctools_subsection"><a href="#subsection3">Namespace termscheme::class</a></li>
<li class="doctools_subsection"><a href="#subsection4">Namespace termscheme</a></li>
<li class="doctools_subsection"><a href="#subsection5">Namespace termscheme::lib</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section4">Internal</a>
<ul>
<li class="doctools_subsection"><a href="#subsection6">Namespace termscheme::system</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#keywords">Keywords</a></li>
<li class="doctools_section"><a href="#copyright">Copyright</a></li>
</ul>
</div>
<div id="synopsis" class="doctools_section"><h2><a name="synopsis">Synopsis</a></h2>
<div class="doctools_synopsis">
<ul class="doctools_requirements">
<li>package require <b class="pkgname">termscheme</b></li>
</ul>
</div>
</div>
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2>
<p>-</p>
</div>
<div id="section2" class="doctools_section"><h2><a name="section2">Overview</a></h2>
<p>overview of termscheme</p>
<div id="subsection1" class="doctools_subsection"><h3><a name="subsection1">Concepts</a></h3>
<p>-</p>
</div>
<div id="subsection2" class="doctools_subsection"><h3><a name="subsection2">dependencies</a></h3>
<p>packages used by termscheme</p>
<ul class="doctools_itemized">
<li><p><b class="package">Tcl 8.6</b></p></li>
</ul>
</div>
</div>
<div id="section3" class="doctools_section"><h2><a name="section3">API</a></h2>
<div id="subsection3" class="doctools_subsection"><h3><a name="subsection3">Namespace termscheme::class</a></h3>
<p>class definitions
if { eq &quot;&quot;} {</p>
<ol class="doctools_enumerated">
</ol>
<p>}
}
++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++</p>
</div>
<div id="subsection4" class="doctools_subsection"><h3><a name="subsection4">Namespace termscheme</a></h3>
<p>Core API functions for termscheme</p>
<dl class="doctools_definitions">
</dl>
</div>
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Namespace termscheme::lib</a></h3>
<p>Secondary functions that are part of the API</p>
<dl class="doctools_definitions">
</dl>
</div>
</div>
<div id="section4" class="doctools_section"><h2><a name="section4">Internal</a></h2>
<p>tcl::namespace::eval termscheme::system {</p>
<div id="subsection6" class="doctools_subsection"><h3><a name="subsection6">Namespace termscheme::system</a></h3>
<p>Internal functions that are not part of the API</p>
</div>
</div>
<div id="keywords" class="doctools_section"><h2><a name="keywords">Keywords</a></h2>
<p><a href="../../index.html#module">module</a></p>
</div>
<div id="copyright" class="doctools_section"><h2><a name="copyright">Copyright</a></h2>
<p>Copyright &copy; 2024</p>
</div>
</div></body></html>

4
src/embedded/www/doc/files/punk/_module_ansi-0.1.1.tm.html

@ -179,7 +179,7 @@
<li><a href="#41"><b class="function">request_tabstops</b></a></li>
<li><a href="#42"><b class="function">titleset</b> <i class="arg">windowtitles</i></a></li>
<li><a href="#43"><b class="function">ansistrip</b> <i class="arg">text</i></a></li>
<li><a href="#44"><b class="function">ansistrip</b> <i class="arg">text</i></a></li>
<li><a href="#44"><b class="function">ansistrip2</b> <i class="arg">text</i></a></li>
<li><a href="#45"><b class="function">ansistripraw</b> <i class="arg">text</i></a></li>
<li><a href="#46"><b class="function">is_sgr_reset</b> <i class="arg">code</i></a></li>
<li><a href="#47"><b class="function">has_sgr_leadingreset</b> <i class="arg">code</i></a></li>
@ -348,7 +348,7 @@ tput rmam</p></dd>
<dt><a name="43"><b class="function">ansistrip</b> <i class="arg">text</i></a></dt>
<dd><p>Return a string with ansi codes stripped out</p>
<p>Alternate graphics chars are replaced with modern unicode equivalents (e.g boxdrawing glyphs)</p></dd>
<dt><a name="44"><b class="function">ansistrip</b> <i class="arg">text</i></a></dt>
<dt><a name="44"><b class="function">ansistrip2</b> <i class="arg">text</i></a></dt>
<dd><p>Return a string with ansi codes stripped out</p>
<p>Alternate graphics chars are replaced with modern unicode equivalents (e.g boxdrawing glyphs)</p></dd>
<dt><a name="45"><b class="function">ansistripraw</b> <i class="arg">text</i></a></dt>

24
src/embedded/www/doc/files/punk/_module_args-0.1.0.tm.html

@ -121,7 +121,7 @@
</li>
<li class="doctools_section"><a href="#section3">API</a>
<ul>
<li class="doctools_subsection"><a href="#subsection4">Namespace punk::args::class</a></li>
<li class="doctools_subsection"><a href="#subsection4">Namespace punk::args</a></li>
<li class="doctools_subsection"><a href="#subsection5">Namespace punk::args</a></li>
<li class="doctools_subsection"><a href="#subsection6">Namespace punk::args::lib</a></li>
</ul>
@ -141,7 +141,7 @@
<li>package require <b class="pkgname">punk::args</b></li>
</ul>
<ul class="doctools_syntax">
<li><a href="#1"><b class="function">get_dict</b> <i class="arg">optionspecs</i> <i class="arg">rawargs</i> <span class="opt">?option value...?</span></a></li>
<li><a href="#1"><b class="function">get_dict</b> <i class="arg">optionspecs</i> <i class="arg">rawargs</i></a></li>
</ul>
</div>
</div>
@ -174,7 +174,7 @@
#setting -type none indicates a flag that doesn't take a value (solo flag)
-nocomplain -type none
*values -min 1 -max -1
} $args]] opts values
} $args]] leaders opts values
puts &quot;translation is [dict get $opts -translation]&quot;
foreach f [dict values $values] {
puts &quot;doing stuff with file: $f&quot;
@ -183,7 +183,7 @@
</pre>
<p>The lines beginning with * are optional in most cases and can be used to set defaults and some extra controls</p>
<p>- the above example would work just fine with only the -&lt;optionname&gt; lines, but would allow zero filenames to be supplied as no -min value is set for *values</p>
<p>valid * lines being with *proc *opts *values</p>
<p>valid * lines being with *proc *leaders *opts *values</p>
<p>lines beginning with a dash define options - a name can optionally be given to each trailing positional argument.</p>
<p>If no names are defined for positional arguments, they will end up in the values key of the dict with numerical keys starting at zero.</p>
<p>e.g the result from the punk::args call above may be something like:</p>
@ -199,7 +199,7 @@
*values -min 2 -max 2
fileA -type existingfile 1
fileB -type existingfile 1
} $args]] opts values
} $args]] leaders opts values
puts &quot;$category fileA: [dict get $values fileA]&quot;
puts &quot;$category fileB: [dict get $values fileB]&quot;
}
@ -291,15 +291,17 @@ For functions that are part of an API a package may be more suitable.</p>
</div>
</div>
<div id="section3" class="doctools_section"><h2><a name="section3">API</a></h2>
<div id="subsection4" class="doctools_subsection"><h3><a name="subsection4">Namespace punk::args::class</a></h3>
<p>class definitions</p>
<ol class="doctools_enumerated">
</ol>
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Namespace punk::args</a></h3>
<p>cooperative namespace punk::args::register</p>
<p>punk::args aware packages may add their own namespace to the public list variable NAMESPACES before or after punk::args is loaded</p>
<p>The punk::args package will then test for a public list variable &lt;namepace&gt;::PUNKARGS containing argument definitions when it needs to.</p>
<dl class="doctools_definitions">
</dl>
</div>
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Namespace punk::args</a></h3>
<p>Core API functions for punk::args</p>
<dl class="doctools_definitions">
<dt><a name="1"><b class="function">get_dict</b> <i class="arg">optionspecs</i> <i class="arg">rawargs</i> <span class="opt">?option value...?</span></a></dt>
<dt><a name="1"><b class="function">get_dict</b> <i class="arg">optionspecs</i> <i class="arg">rawargs</i></a></dt>
<dd><p>Parse rawargs as a sequence of zero or more option-value pairs followed by zero or more values</p>
<p>Returns a dict of the form: opts &lt;options_dict&gt; values &lt;values_dict&gt;</p>
<p>ARGUMENTS:</p>
@ -314,7 +316,7 @@ For functions that are part of an API a package may be more suitable.</p>
<p>argumentname -key val -ky2 val2...</p>
<p>where the valid keys for each option specification are: -default -type -range -choices</p>
<p>comment lines begining with # are ignored and can be placed anywhere except within a multiline value where it would become part of that value</p>
<p>lines beginning with *proc *opts or *values also take -key val pairs and can be used to set defaults and control settings.</p>
<p>lines beginning with *proc *leaders *opts or *values also take -key val pairs and can be used to set defaults and control settings.</p>
<p>*opts or *values lines can appear multiple times with defaults affecting flags/values that follow.</p></dd>
<dt>list <i class="arg">rawargs</i></dt>
<dd><p>This is a list of the arguments to parse. Usually it will be the $args value from the containing proc,

2
src/embedded/www/doc/files/punk/_module_console-0.1.1.tm.html

@ -150,7 +150,9 @@
<p>packages used by punk::console</p>
<ul class="doctools_itemized">
<li><p><b class="package">Tcl 8.6-</b></p></li>
<li><p><b class="package">Thread</b></p></li>
<li><p><b class="package">punk::ansi</b></p></li>
<li><p><b class="package">punk::args</b></p></li>
</ul>
</div>
</div>

1
src/embedded/www/doc/files/punk/_module_lib-0.1.1.tm.html

@ -186,6 +186,7 @@
<p>packages used by punk::lib</p>
<ul class="doctools_itemized">
<li><p><b class="package">Tcl 8.6-</b></p></li>
<li><p><b class="package">punk::args</b></p></li>
</ul>
</div>
</div>

197
src/embedded/www/doc/files/punk/_module_safe-0.1.0.tm.html

@ -0,0 +1,197 @@
<!DOCTYPE html><html><head>
<title>punkshell_module_punk::safe - punk::safe - safebase interpreters</title>
<style type="text/css"><!--
HTML {
background: #FFFFFF;
color: black;
}
BODY {
background: #FFFFFF;
color: black;
}
DIV.doctools {
margin-left: 10%;
margin-right: 10%;
}
DIV.doctools H1,DIV.doctools H2 {
margin-left: -5%;
}
H1, H2, H3, H4 {
margin-top: 1em;
font-family: sans-serif;
font-size: large;
color: #005A9C;
background: transparent;
text-align: left;
}
H1.doctools_title {
text-align: center;
}
UL,OL {
margin-right: 0em;
margin-top: 3pt;
margin-bottom: 3pt;
}
UL LI {
list-style: disc;
}
OL LI {
list-style: decimal;
}
DT {
padding-top: 1ex;
}
UL.doctools_toc,UL.doctools_toc UL, UL.doctools_toc UL UL {
font: normal 12pt/14pt sans-serif;
list-style: none;
}
LI.doctools_section, LI.doctools_subsection {
list-style: none;
margin-left: 0em;
text-indent: 0em;
padding: 0em;
}
PRE {
display: block;
font-family: monospace;
white-space: pre;
margin: 0%;
padding-top: 0.5ex;
padding-bottom: 0.5ex;
padding-left: 1ex;
padding-right: 1ex;
width: 100%;
}
PRE.doctools_example {
color: black;
background: #f5dcb3;
border: 1px solid black;
}
UL.doctools_requirements LI, UL.doctools_syntax LI {
list-style: none;
margin-left: 0em;
text-indent: 0em;
padding: 0em;
}
DIV.doctools_synopsis {
color: black;
background: #80ffff;
border: 1px solid black;
font-family: serif;
margin-top: 1em;
margin-bottom: 1em;
}
UL.doctools_syntax {
margin-top: 1em;
border-top: 1px solid black;
}
UL.doctools_requirements {
margin-bottom: 1em;
border-bottom: 1px solid black;
}
--></style>
</head>
<!-- Generated from file '_module_safe-0.1.0.tm.man' by tcllib/doctools with format 'html'
-->
<!-- Copyright &amp;copy; 2024
-->
<!-- punkshell_module_punk::safe.0
-->
<body><hr> [
<a href="../../../toc.html">Main Table Of Contents</a>
&#124; <a href="../../toc.html">Table Of Contents</a>
&#124; <a href="../../../index.html">Keyword Index</a>
] <hr>
<div class="doctools">
<h1 class="doctools_title">punkshell_module_punk::safe(0) 0.1.0 doc &quot;punk::safe - safebase interpreters&quot;</h1>
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2>
<p>punkshell_module_punk::safe - Module API</p>
</div>
<div id="toc" class="doctools_section"><h2><a name="toc">Table Of Contents</a></h2>
<ul class="doctools_toc">
<li class="doctools_section"><a href="#toc">Table Of Contents</a></li>
<li class="doctools_section"><a href="#synopsis">Synopsis</a></li>
<li class="doctools_section"><a href="#section1">Description</a></li>
<li class="doctools_section"><a href="#section2">Overview</a>
<ul>
<li class="doctools_subsection"><a href="#subsection1">Concepts</a></li>
<li class="doctools_subsection"><a href="#subsection2">dependencies</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section3">API</a>
<ul>
<li class="doctools_subsection"><a href="#subsection3">Namespace punk::safe::class</a></li>
<li class="doctools_subsection"><a href="#subsection4">Namespace punk::safe::lib</a></li>
<li class="doctools_subsection"><a href="#subsection5">Namespace punk::safe</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section4">Internal</a>
<ul>
<li class="doctools_subsection"><a href="#subsection6">Namespace punk::safe::system</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#keywords">Keywords</a></li>
<li class="doctools_section"><a href="#copyright">Copyright</a></li>
</ul>
</div>
<div id="synopsis" class="doctools_section"><h2><a name="synopsis">Synopsis</a></h2>
<div class="doctools_synopsis">
<ul class="doctools_requirements">
<li>package require <b class="pkgname">punk::safe</b></li>
</ul>
<ul class="doctools_syntax">
<li><a href="#1"><b class="function">setSyncMode</b> <i class="arg">args</i></a></li>
</ul>
</div>
</div>
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2>
<p>-</p>
</div>
<div id="section2" class="doctools_section"><h2><a name="section2">Overview</a></h2>
<p>overview of punk::safe</p>
<div id="subsection1" class="doctools_subsection"><h3><a name="subsection1">Concepts</a></h3>
<p>-</p>
</div>
<div id="subsection2" class="doctools_subsection"><h3><a name="subsection2">dependencies</a></h3>
<p>packages used by punk::safe</p>
<ul class="doctools_itemized">
<li><p><b class="package">Tcl 8.6</b></p></li>
<li><p><b class="package">punk::args</b></p></li>
</ul>
</div>
</div>
<div id="section3" class="doctools_section"><h2><a name="section3">API</a></h2>
<div id="subsection3" class="doctools_subsection"><h3><a name="subsection3">Namespace punk::safe::class</a></h3>
<p>class definitions
if { eq &quot;&quot;} {</p>
<ol class="doctools_enumerated">
</ol>
<p>}
}
++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++</p>
</div>
<div id="subsection4" class="doctools_subsection"><h3><a name="subsection4">Namespace punk::safe::lib</a></h3>
<p>Secondary functions that are part of the API</p>
<dl class="doctools_definitions">
</dl>
</div>
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Namespace punk::safe</a></h3>
<p>Core API functions for punk::safe</p>
<dl class="doctools_definitions">
<dt><a name="1"><b class="function">setSyncMode</b> <i class="arg">args</i></a></dt>
<dd></dd>
</dl>
</div>
</div>
<div id="section4" class="doctools_section"><h2><a name="section4">Internal</a></h2>
<div id="subsection6" class="doctools_subsection"><h3><a name="subsection6">Namespace punk::safe::system</a></h3>
<p>Internal functions that are not part of the API</p>
</div>
</div>
<div id="keywords" class="doctools_section"><h2><a name="keywords">Keywords</a></h2>
<p><a href="../../../index.html#module">module</a></p>
</div>
<div id="copyright" class="doctools_section"><h2><a name="copyright">Copyright</a></h2>
<p>Copyright &copy; 2024</p>
</div>
</div></body></html>

185
src/embedded/www/doc/files/punk/_module_sixel-0.1.0.tm.html

@ -0,0 +1,185 @@
<!DOCTYPE html><html><head>
<title>punkshell_module_punk::sixel - experimental sixel functions</title>
<style type="text/css"><!--
HTML {
background: #FFFFFF;
color: black;
}
BODY {
background: #FFFFFF;
color: black;
}
DIV.doctools {
margin-left: 10%;
margin-right: 10%;
}
DIV.doctools H1,DIV.doctools H2 {
margin-left: -5%;
}
H1, H2, H3, H4 {
margin-top: 1em;
font-family: sans-serif;
font-size: large;
color: #005A9C;
background: transparent;
text-align: left;
}
H1.doctools_title {
text-align: center;
}
UL,OL {
margin-right: 0em;
margin-top: 3pt;
margin-bottom: 3pt;
}
UL LI {
list-style: disc;
}
OL LI {
list-style: decimal;
}
DT {
padding-top: 1ex;
}
UL.doctools_toc,UL.doctools_toc UL, UL.doctools_toc UL UL {
font: normal 12pt/14pt sans-serif;
list-style: none;
}
LI.doctools_section, LI.doctools_subsection {
list-style: none;
margin-left: 0em;
text-indent: 0em;
padding: 0em;
}
PRE {
display: block;
font-family: monospace;
white-space: pre;
margin: 0%;
padding-top: 0.5ex;
padding-bottom: 0.5ex;
padding-left: 1ex;
padding-right: 1ex;
width: 100%;
}
PRE.doctools_example {
color: black;
background: #f5dcb3;
border: 1px solid black;
}
UL.doctools_requirements LI, UL.doctools_syntax LI {
list-style: none;
margin-left: 0em;
text-indent: 0em;
padding: 0em;
}
DIV.doctools_synopsis {
color: black;
background: #80ffff;
border: 1px solid black;
font-family: serif;
margin-top: 1em;
margin-bottom: 1em;
}
UL.doctools_syntax {
margin-top: 1em;
border-top: 1px solid black;
}
UL.doctools_requirements {
margin-bottom: 1em;
border-bottom: 1px solid black;
}
--></style>
</head>
<!-- Generated from file '_module_sixel-0.1.0.tm.man' by tcllib/doctools with format 'html'
-->
<!-- Copyright &amp;copy; 2024
-->
<!-- punkshell_module_punk::sixel.0
-->
<body><hr> [
<a href="../../../toc.html">Main Table Of Contents</a>
&#124; <a href="../../toc.html">Table Of Contents</a>
&#124; <a href="../../../index.html">Keyword Index</a>
] <hr>
<div class="doctools">
<h1 class="doctools_title">punkshell_module_punk::sixel(0) 0.1.0 doc &quot;experimental sixel functions&quot;</h1>
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2>
<p>punkshell_module_punk::sixel - punk::sixel API</p>
</div>
<div id="toc" class="doctools_section"><h2><a name="toc">Table Of Contents</a></h2>
<ul class="doctools_toc">
<li class="doctools_section"><a href="#toc">Table Of Contents</a></li>
<li class="doctools_section"><a href="#synopsis">Synopsis</a></li>
<li class="doctools_section"><a href="#section1">Description</a></li>
<li class="doctools_section"><a href="#section2">Overview</a>
<ul>
<li class="doctools_subsection"><a href="#subsection1">Concepts</a></li>
<li class="doctools_subsection"><a href="#subsection2">dependencies</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section3">API</a>
<ul>
<li class="doctools_subsection"><a href="#subsection3">Namespace punk::sixel::class</a></li>
<li class="doctools_subsection"><a href="#subsection4">Namespace punk::sixel</a></li>
<li class="doctools_subsection"><a href="#subsection5">Namespace punk::sixel::lib</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#keywords">Keywords</a></li>
<li class="doctools_section"><a href="#copyright">Copyright</a></li>
</ul>
</div>
<div id="synopsis" class="doctools_section"><h2><a name="synopsis">Synopsis</a></h2>
<div class="doctools_synopsis">
<ul class="doctools_requirements">
<li>package require <b class="pkgname">punk::sixel</b></li>
</ul>
</div>
</div>
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2>
<p>Experimental support functions for working with sixel data</p>
<p>For real sixel work a version written in a systems language such as c or zig may be required.</p>
</div>
<div id="section2" class="doctools_section"><h2><a name="section2">Overview</a></h2>
<p>overview of punk::sixel</p>
<div id="subsection1" class="doctools_subsection"><h3><a name="subsection1">Concepts</a></h3>
<p>-</p>
</div>
<div id="subsection2" class="doctools_subsection"><h3><a name="subsection2">dependencies</a></h3>
<p>packages used by punk::sixel</p>
<ul class="doctools_itemized">
<li><p><b class="package">Tcl 8.6</b></p></li>
<li><p><b class="package">punk::args</b></p></li>
<li><p><b class="package">punk::console</b></p></li>
<li><p><b class="package">punk::ansi</b></p></li>
</ul>
</div>
</div>
<div id="section3" class="doctools_section"><h2><a name="section3">API</a></h2>
<div id="subsection3" class="doctools_subsection"><h3><a name="subsection3">Namespace punk::sixel::class</a></h3>
<p>class definitions
if { eq &quot;&quot;} {</p>
<ol class="doctools_enumerated">
</ol>
<p>}
}
++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++</p>
</div>
<div id="subsection4" class="doctools_subsection"><h3><a name="subsection4">Namespace punk::sixel</a></h3>
<p>Core API functions for punk::sixel</p>
<dl class="doctools_definitions">
</dl>
</div>
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Namespace punk::sixel::lib</a></h3>
<p>Secondary functions that are part of the API</p>
<dl class="doctools_definitions">
</dl>
</div>
</div>
<div id="keywords" class="doctools_section"><h2><a name="keywords">Keywords</a></h2>
<p><a href="../../../index.html#experimental">experimental</a>, <a href="../../../index.html#module">module</a></p>
</div>
<div id="copyright" class="doctools_section"><h2><a name="copyright">Copyright</a></h2>
<p>Copyright &copy; 2024</p>
</div>
</div></body></html>

193
src/embedded/www/doc/files/punk/args/_module_tclcore-0.1.0.tm.html

@ -0,0 +1,193 @@
<!DOCTYPE html><html><head>
<title>punkshell_module_punk::args::tclcore - tcl core argument definitions</title>
<style type="text/css"><!--
HTML {
background: #FFFFFF;
color: black;
}
BODY {
background: #FFFFFF;
color: black;
}
DIV.doctools {
margin-left: 10%;
margin-right: 10%;
}
DIV.doctools H1,DIV.doctools H2 {
margin-left: -5%;
}
H1, H2, H3, H4 {
margin-top: 1em;
font-family: sans-serif;
font-size: large;
color: #005A9C;
background: transparent;
text-align: left;
}
H1.doctools_title {
text-align: center;
}
UL,OL {
margin-right: 0em;
margin-top: 3pt;
margin-bottom: 3pt;
}
UL LI {
list-style: disc;
}
OL LI {
list-style: decimal;
}
DT {
padding-top: 1ex;
}
UL.doctools_toc,UL.doctools_toc UL, UL.doctools_toc UL UL {
font: normal 12pt/14pt sans-serif;
list-style: none;
}
LI.doctools_section, LI.doctools_subsection {
list-style: none;
margin-left: 0em;
text-indent: 0em;
padding: 0em;
}
PRE {
display: block;
font-family: monospace;
white-space: pre;
margin: 0%;
padding-top: 0.5ex;
padding-bottom: 0.5ex;
padding-left: 1ex;
padding-right: 1ex;
width: 100%;
}
PRE.doctools_example {
color: black;
background: #f5dcb3;
border: 1px solid black;
}
UL.doctools_requirements LI, UL.doctools_syntax LI {
list-style: none;
margin-left: 0em;
text-indent: 0em;
padding: 0em;
}
DIV.doctools_synopsis {
color: black;
background: #80ffff;
border: 1px solid black;
font-family: serif;
margin-top: 1em;
margin-bottom: 1em;
}
UL.doctools_syntax {
margin-top: 1em;
border-top: 1px solid black;
}
UL.doctools_requirements {
margin-bottom: 1em;
border-bottom: 1px solid black;
}
--></style>
</head>
<!-- Generated from file '_module_tclcore-0.1.0.tm.man' by tcllib/doctools with format 'html'
-->
<!-- Copyright &amp;copy; 2025
-->
<!-- punkshell_module_punk::args::tclcore.0
-->
<body><hr> [
<a href="../../../../toc.html">Main Table Of Contents</a>
&#124; <a href="../../../toc.html">Table Of Contents</a>
&#124; <a href="../../../../index.html">Keyword Index</a>
] <hr>
<div class="doctools">
<h1 class="doctools_title">punkshell_module_punk::args::tclcore(0) 0.1.0 doc &quot;tcl core argument definitions&quot;</h1>
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2>
<p>punkshell_module_punk::args::tclcore - punk::args definitions for tcl core commands</p>
</div>
<div id="toc" class="doctools_section"><h2><a name="toc">Table Of Contents</a></h2>
<ul class="doctools_toc">
<li class="doctools_section"><a href="#toc">Table Of Contents</a></li>
<li class="doctools_section"><a href="#synopsis">Synopsis</a></li>
<li class="doctools_section"><a href="#section1">Description</a></li>
<li class="doctools_section"><a href="#section2">Overview</a>
<ul>
<li class="doctools_subsection"><a href="#subsection1">Concepts</a></li>
<li class="doctools_subsection"><a href="#subsection2">dependencies</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section3">API</a>
<ul>
<li class="doctools_subsection"><a href="#subsection3">Namespace punk::args::tclcore::class</a></li>
<li class="doctools_subsection"><a href="#subsection4">Namespace punk::args::tclcore</a></li>
<li class="doctools_subsection"><a href="#subsection5">Namespace punk::args::tclcore::lib</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section4">Internal</a>
<ul>
<li class="doctools_subsection"><a href="#subsection6">Namespace punk::args::tclcore::system</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#keywords">Keywords</a></li>
<li class="doctools_section"><a href="#copyright">Copyright</a></li>
</ul>
</div>
<div id="synopsis" class="doctools_section"><h2><a name="synopsis">Synopsis</a></h2>
<div class="doctools_synopsis">
<ul class="doctools_requirements">
<li>package require <b class="pkgname">punk::args::tclcore</b></li>
</ul>
</div>
</div>
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2>
<p>-</p>
</div>
<div id="section2" class="doctools_section"><h2><a name="section2">Overview</a></h2>
<p>overview of punk::args::tclcore</p>
<div id="subsection1" class="doctools_subsection"><h3><a name="subsection1">Concepts</a></h3>
<p>-</p>
</div>
<div id="subsection2" class="doctools_subsection"><h3><a name="subsection2">dependencies</a></h3>
<p>packages used by punk::args::tclcore</p>
<ul class="doctools_itemized">
<li><p><b class="package">Tcl 8.6</b></p></li>
<li><p><b class="package">punk::args</b></p></li>
</ul>
</div>
</div>
<div id="section3" class="doctools_section"><h2><a name="section3">API</a></h2>
<div id="subsection3" class="doctools_subsection"><h3><a name="subsection3">Namespace punk::args::tclcore::class</a></h3>
<p>class definitions
if { eq &quot;&quot;} {</p>
<ol class="doctools_enumerated">
</ol>
<p>}
}
++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++</p>
</div>
<div id="subsection4" class="doctools_subsection"><h3><a name="subsection4">Namespace punk::args::tclcore</a></h3>
<p>Core API functions for punk::args::tclcore</p>
<dl class="doctools_definitions">
</dl>
</div>
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Namespace punk::args::tclcore::lib</a></h3>
<p>Secondary functions that are part of the API</p>
<dl class="doctools_definitions">
</dl>
</div>
</div>
<div id="section4" class="doctools_section"><h2><a name="section4">Internal</a></h2>
<p>tcl::namespace::eval punk::args::tclcore::system {</p>
<div id="subsection6" class="doctools_subsection"><h3><a name="subsection6">Namespace punk::args::tclcore::system</a></h3>
<p>Internal functions that are not part of the API</p>
</div>
</div>
<div id="keywords" class="doctools_section"><h2><a name="keywords">Keywords</a></h2>
<p><a href="../../../../index.html#module">module</a></p>
</div>
<div id="copyright" class="doctools_section"><h2><a name="copyright">Copyright</a></h2>
<p>Copyright &copy; 2025</p>
</div>
</div></body></html>

8
src/embedded/www/doc/files/punk/nav/_module_fs-0.1.0.tm.html

@ -1,5 +1,5 @@
<!DOCTYPE html><html><head>
<title>shellspy_module_punk::nav::fs - fs nav</title>
<title>punkshell_module_punk::nav::fs - fs nav</title>
<style type="text/css"><!--
HTML {
background: #FFFFFF;
@ -95,7 +95,7 @@
-->
<!-- Copyright &amp;copy; 2024
-->
<!-- shellspy_module_punk::nav::fs.0
<!-- punkshell_module_punk::nav::fs.0
-->
<body><hr> [
<a href="../../../../toc.html">Main Table Of Contents</a>
@ -103,9 +103,9 @@
&#124; <a href="../../../../index.html">Keyword Index</a>
] <hr>
<div class="doctools">
<h1 class="doctools_title">shellspy_module_punk::nav::fs(0) 0.1.0 doc &quot;fs nav&quot;</h1>
<h1 class="doctools_title">punkshell_module_punk::nav::fs(0) 0.1.0 doc &quot;fs nav&quot;</h1>
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2>
<p>shellspy_module_punk::nav::fs - punk::nav::fs console filesystem navigation</p>
<p>punkshell_module_punk::nav::fs - punk::nav::fs console filesystem navigation</p>
</div>
<div id="toc" class="doctools_section"><h2><a name="toc">Table Of Contents</a></h2>
<ul class="doctools_toc">

14
src/embedded/www/doc/files/punk/repl/_module_codethread-0.1.0.tm.html

@ -1,5 +1,5 @@
<!DOCTYPE html><html><head>
<title>shellspy_module_punk::repl::codethread - codethread for repl - root interpreter</title>
<title>punkshell_module_punk::repl::codethread - codethread for repl - root interpreter</title>
<style type="text/css"><!--
HTML {
background: #FFFFFF;
@ -95,7 +95,7 @@
-->
<!-- Copyright &amp;copy; 2024
-->
<!-- shellspy_module_punk::repl::codethread.0
<!-- punkshell_module_punk::repl::codethread.0
-->
<body><hr> [
<a href="../../../../toc.html">Main Table Of Contents</a>
@ -103,9 +103,9 @@
&#124; <a href="../../../../index.html">Keyword Index</a>
] <hr>
<div class="doctools">
<h1 class="doctools_title">shellspy_module_punk::repl::codethread(0) 0.1.0 doc &quot;codethread for repl - root interpreter&quot;</h1>
<h1 class="doctools_title">punkshell_module_punk::repl::codethread(0) 0.1.0 doc &quot;codethread for repl - root interpreter&quot;</h1>
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2>
<p>shellspy_module_punk::repl::codethread - Module repl codethread</p>
<p>punkshell_module_punk::repl::codethread - Module repl codethread</p>
</div>
<div id="toc" class="doctools_section"><h2><a name="toc">Table Of Contents</a></h2>
<ul class="doctools_toc">
@ -158,13 +158,9 @@
</div>
<div id="section3" class="doctools_section"><h2><a name="section3">API</a></h2>
<div id="subsection3" class="doctools_subsection"><h3><a name="subsection3">Namespace punk::repl::codethread::class</a></h3>
<p>class definitions
if { eq &quot;&quot;} {</p>
<p>class definitions</p>
<ol class="doctools_enumerated">
</ol>
<p>}
}
++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++</p>
</div>
<div id="subsection4" class="doctools_subsection"><h3><a name="subsection4">Namespace punk::repl::codethread</a></h3>
<p>Core API functions for punk::repl::codethread</p>

187
src/embedded/www/doc/files/punk/repl/_module_codethread-0.1.1.tm.html

@ -0,0 +1,187 @@
<!DOCTYPE html><html><head>
<title>punkshell_module_punk::repl::codethread - codethread for repl - root interpreter</title>
<style type="text/css"><!--
HTML {
background: #FFFFFF;
color: black;
}
BODY {
background: #FFFFFF;
color: black;
}
DIV.doctools {
margin-left: 10%;
margin-right: 10%;
}
DIV.doctools H1,DIV.doctools H2 {
margin-left: -5%;
}
H1, H2, H3, H4 {
margin-top: 1em;
font-family: sans-serif;
font-size: large;
color: #005A9C;
background: transparent;
text-align: left;
}
H1.doctools_title {
text-align: center;
}
UL,OL {
margin-right: 0em;
margin-top: 3pt;
margin-bottom: 3pt;
}
UL LI {
list-style: disc;
}
OL LI {
list-style: decimal;
}
DT {
padding-top: 1ex;
}
UL.doctools_toc,UL.doctools_toc UL, UL.doctools_toc UL UL {
font: normal 12pt/14pt sans-serif;
list-style: none;
}
LI.doctools_section, LI.doctools_subsection {
list-style: none;
margin-left: 0em;
text-indent: 0em;
padding: 0em;
}
PRE {
display: block;
font-family: monospace;
white-space: pre;
margin: 0%;
padding-top: 0.5ex;
padding-bottom: 0.5ex;
padding-left: 1ex;
padding-right: 1ex;
width: 100%;
}
PRE.doctools_example {
color: black;
background: #f5dcb3;
border: 1px solid black;
}
UL.doctools_requirements LI, UL.doctools_syntax LI {
list-style: none;
margin-left: 0em;
text-indent: 0em;
padding: 0em;
}
DIV.doctools_synopsis {
color: black;
background: #80ffff;
border: 1px solid black;
font-family: serif;
margin-top: 1em;
margin-bottom: 1em;
}
UL.doctools_syntax {
margin-top: 1em;
border-top: 1px solid black;
}
UL.doctools_requirements {
margin-bottom: 1em;
border-bottom: 1px solid black;
}
--></style>
</head>
<!-- Generated from file '_module_codethread-0.1.1.tm.man' by tcllib/doctools with format 'html'
-->
<!-- Copyright &amp;copy; 2024
-->
<!-- punkshell_module_punk::repl::codethread.0
-->
<body><hr> [
<a href="../../../../toc.html">Main Table Of Contents</a>
&#124; <a href="../../../toc.html">Table Of Contents</a>
&#124; <a href="../../../../index.html">Keyword Index</a>
] <hr>
<div class="doctools">
<h1 class="doctools_title">punkshell_module_punk::repl::codethread(0) 0.1.1 doc &quot;codethread for repl - root interpreter&quot;</h1>
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2>
<p>punkshell_module_punk::repl::codethread - Module repl codethread</p>
</div>
<div id="toc" class="doctools_section"><h2><a name="toc">Table Of Contents</a></h2>
<ul class="doctools_toc">
<li class="doctools_section"><a href="#toc">Table Of Contents</a></li>
<li class="doctools_section"><a href="#synopsis">Synopsis</a></li>
<li class="doctools_section"><a href="#section1">Description</a></li>
<li class="doctools_section"><a href="#section2">Overview</a>
<ul>
<li class="doctools_subsection"><a href="#subsection1">Concepts</a></li>
<li class="doctools_subsection"><a href="#subsection2">dependencies</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section3">API</a>
<ul>
<li class="doctools_subsection"><a href="#subsection3">Namespace punk::repl::codethread::class</a></li>
<li class="doctools_subsection"><a href="#subsection4">Namespace punk::repl::codethread</a></li>
<li class="doctools_subsection"><a href="#subsection5">Namespace punk::repl::codethread::lib</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section4">Internal</a>
<ul>
<li class="doctools_subsection"><a href="#subsection6">Namespace punk::repl::codethread::system</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#keywords">Keywords</a></li>
<li class="doctools_section"><a href="#copyright">Copyright</a></li>
</ul>
</div>
<div id="synopsis" class="doctools_section"><h2><a name="synopsis">Synopsis</a></h2>
<div class="doctools_synopsis">
<ul class="doctools_requirements">
<li>package require <b class="pkgname">punk::repl::codethread</b></li>
</ul>
</div>
</div>
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2>
<p>This is part of the infrastructure required for the punk::repl to operate</p>
</div>
<div id="section2" class="doctools_section"><h2><a name="section2">Overview</a></h2>
<p>overview of punk::repl::codethread</p>
<div id="subsection1" class="doctools_subsection"><h3><a name="subsection1">Concepts</a></h3>
<p>-</p>
</div>
<div id="subsection2" class="doctools_subsection"><h3><a name="subsection2">dependencies</a></h3>
<p>packages used by punk::repl::codethread</p>
<ul class="doctools_itemized">
<li><p><b class="package">Tcl 8.6</b></p></li>
</ul>
</div>
</div>
<div id="section3" class="doctools_section"><h2><a name="section3">API</a></h2>
<div id="subsection3" class="doctools_subsection"><h3><a name="subsection3">Namespace punk::repl::codethread::class</a></h3>
<p>class definitions</p>
<ol class="doctools_enumerated">
</ol>
</div>
<div id="subsection4" class="doctools_subsection"><h3><a name="subsection4">Namespace punk::repl::codethread</a></h3>
<p>Core API functions for punk::repl::codethread</p>
<dl class="doctools_definitions">
</dl>
</div>
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Namespace punk::repl::codethread::lib</a></h3>
<p>Secondary functions that are part of the API</p>
<dl class="doctools_definitions">
</dl>
</div>
</div>
<div id="section4" class="doctools_section"><h2><a name="section4">Internal</a></h2>
<div id="subsection6" class="doctools_subsection"><h3><a name="subsection6">Namespace punk::repl::codethread::system</a></h3>
<p>Internal functions that are not part of the API</p>
</div>
</div>
<div id="keywords" class="doctools_section"><h2><a name="keywords">Keywords</a></h2>
<p><a href="../../../../index.html#module">module</a>, <a href="../../../../index.html#repl">repl</a></p>
</div>
<div id="copyright" class="doctools_section"><h2><a name="copyright">Copyright</a></h2>
<p>Copyright &copy; 2024</p>
</div>
</div></body></html>

60
src/embedded/www/doc/toc.html

@ -61,57 +61,65 @@
<td class="#doctools_tocright">args parsing</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_args_tclcore'><a href="files/punk/args/_module_tclcore-0.1.0.tm.html">punkshell_module_punk::args::tclcore</a></td>
<td class="#doctools_tocright">punk::args definitions for tcl core commands</td>
</tr>
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_assertion'><a href="files/punk/_module_assertion-0.1.0.tm.html">punkshell_module_punk::assertion</a></td>
<td class="#doctools_tocright">assertion alternative to control::assert</td>
</tr>
<tr class="#doctools_tocodd" >
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_blockletter'><a href="files/punk/_module_blockletter-0.1.0.tm.html">punkshell_module_punk::blockletter</a></td>
<td class="#doctools_tocright">punk::blockletter frame-based large lettering test/logo</td>
</tr>
<tr class="#doctools_toceven" >
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_cap'><a href="files/punk/_module_cap-0.1.0.tm.html">punkshell_module_punk::cap</a></td>
<td class="#doctools_tocright">capability provider and handler plugin system</td>
</tr>
<tr class="#doctools_tocodd" >
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_cesu'><a href="files/punk/_module_cesu-0.1.0.tm.html">punkshell_module_punk::cesu</a></td>
<td class="#doctools_tocright">CESU compatibility ehcoding scheme for utf-16: 8-Bit (CESU-8) ??</td>
</tr>
<tr class="#doctools_toceven" >
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_char'><a href="files/punk/_module_char-0.1.0.tm.html">punkshell_module_punk::char</a></td>
<td class="#doctools_tocright">character-set and unicode utilities</td>
</tr>
<tr class="#doctools_tocodd" >
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_console'><a href="files/punk/_module_console-0.1.1.tm.html">punkshell_module_punk::console</a></td>
<td class="#doctools_tocright">punk console</td>
</tr>
<tr class="#doctools_toceven" >
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_encmime'><a href="files/punk/_module_encmime-0.1.0.tm.html">punkshell_module_punk::encmime</a></td>
<td class="#doctools_tocright">mime encodings related subset of tcllib mime</td>
</tr>
<tr class="#doctools_tocodd" >
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_experiment'><a href="files/punk/_module_experiment-0.1.0.tm.html">punkshell_module_punk::experiment</a></td>
<td class="#doctools_tocright">Module API</td>
</tr>
<tr class="#doctools_toceven" >
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_fileline'><a href="files/punk/_module_fileline-0.1.0.tm.html">punkshell_module_punk::fileline</a></td>
<td class="#doctools_tocright">file line-handling utilities</td>
</tr>
<tr class="#doctools_tocodd" >
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_flib'><a href="files/punk/_module_flib-0.1.0.tm.html">punkshell_module_punk::flib</a></td>
<td class="#doctools_tocright">flib experimental</td>
</tr>
<tr class="#doctools_toceven" >
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_island'><a href="files/punk/_module_island-0.1.0.tm.html">punkshell_module_punk::island</a></td>
<td class="#doctools_tocright">filesystem islands for safe interps</td>
</tr>
<tr class="#doctools_tocodd" >
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_lib'><a href="files/punk/_module_lib-0.1.1.tm.html">punkshell_module_punk::lib</a></td>
<td class="#doctools_tocright">punk general utility functions</td>
</tr>
<tr class="#doctools_toceven" >
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_mix_commandset_project'><a href="files/punk/mix/commandset/_module_project-0.1.0.tm.html">punkshell_module_punk::mix::commandset::project</a></td>
<td class="#doctools_tocright">dec commandset - project</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_nav_fs'><a href="files/punk/nav/_module_fs-0.1.0.tm.html">punkshell_module_punk::nav::fs</a></td>
<td class="#doctools_tocright">punk::nav::fs console filesystem navigation</td>
</tr>
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_packagepreference'><a href="files/punk/_module_packagepreference-0.1.0.tm.html">punkshell_module_punk::packagepreference</a></td>
<td class="#doctools_tocright">punkshell package/module loading</td>
@ -121,10 +129,26 @@
<td class="#doctools_tocright">Filesystem path utilities</td>
</tr>
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_repl_codethread'><a href="files/punk/repl/_module_codethread-0.1.0.tm.html">punkshell_module_punk::repl::codethread</a></td>
<td class="#doctools_tocright">Module repl codethread</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_repl_codethread'><a href="files/punk/repl/_module_codethread-0.1.1.tm.html">punkshell_module_punk::repl::codethread</a></td>
<td class="#doctools_tocright">Module repl codethread</td>
</tr>
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_rest'><a href="files/punk/_module_rest-0.1.0.tm.html">punkshell_module_punk::rest</a></td>
<td class="#doctools_tocright">punk::rest</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_safe'><a href="files/punk/_module_safe-0.1.0.tm.html">punkshell_module_punk::safe</a></td>
<td class="#doctools_tocright">Module API</td>
</tr>
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_sixel'><a href="files/punk/_module_sixel-0.1.0.tm.html">punkshell_module_punk::sixel</a></td>
<td class="#doctools_tocright">punk::sixel API</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_sshrun'><a href="files/punk/_module_sshrun-0.1.0.tm.html">punkshell_module_punk::sshrun</a></td>
<td class="#doctools_tocright">Tcl procedures to execute tcl scripts in remote hosts</td>
</tr>
@ -157,18 +181,14 @@
<td class="#doctools_tocright">punk textblock functions</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='shellspy_module_punk_nav_fs'><a href="files/punk/nav/_module_fs-0.1.0.tm.html">shellspy_module_punk::nav::fs</a></td>
<td class="#doctools_tocright">punk::nav::fs console filesystem navigation</td>
</tr>
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='shellspy_module_punk_repl_codethread'><a href="files/punk/repl/_module_codethread-0.1.0.tm.html">shellspy_module_punk::repl::codethread</a></td>
<td class="#doctools_tocright">Module repl codethread</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='shellspy_module_punk_zip'><a href="files/punk/_module_zip-0.1.0.tm.html">shellspy_module_punk::zip</a></td>
<td class="#doctools_tocright">Module API</td>
</tr>
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='shellspy_module_termscheme'><a href="files/_module_termscheme-0.1.0.tm.html">shellspy_module_termscheme</a></td>
<td class="#doctools_tocright">Module API</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='tomlish_module_tomlish'><a href="files/_module_tomlish-1.1.1.tm.html">tomlish_module_tomlish</a></td>
<td class="#doctools_tocright">tomlish toml parser</td>
</tr>

10
src/embedded/www/index.html

@ -134,7 +134,7 @@
<tr class="#doctools_idxeven" valign=top>
<td class="#doctools_idxleft" width="35%"><a name="experimental"> experimental </a></td>
<td class="#doctools_idxright" width="65%">
<a href="doc/files/punk/_module_cesu-0.1.0.tm.html"> punkshell_module_punk::cesu </a> &#183; <a href="doc/files/punk/_module_flib-0.1.0.tm.html"> punkshell_module_punk::flib </a>
<a href="doc/files/punk/_module_cesu-0.1.0.tm.html"> punkshell_module_punk::cesu </a> &#183; <a href="doc/files/punk/_module_flib-0.1.0.tm.html"> punkshell_module_punk::flib </a> &#183; <a href="doc/files/punk/_module_sixel-0.1.0.tm.html"> punkshell_module_punk::sixel </a>
</td></tr>
<tr class="#doctools_idxheader"><th colspan="2">
<a name="cF">Keywords: F</a>
@ -162,7 +162,7 @@
<tr class="#doctools_idxodd" valign=top>
<td class="#doctools_idxleft" width="35%"><a name="filesystem"> filesystem </a></td>
<td class="#doctools_idxright" width="65%">
<a href="doc/files/punk/_module_island-0.1.0.tm.html"> punkshell_module_punk::island </a> &#183; <a href="doc/files/punk/_module_path-0.1.0.tm.html"> punkshell_module_punk::path </a> &#183; <a href="doc/files/punk/nav/_module_fs-0.1.0.tm.html"> shellspy_module_punk::nav::fs </a>
<a href="doc/files/punk/_module_island-0.1.0.tm.html"> punkshell_module_punk::island </a> &#183; <a href="doc/files/punk/nav/_module_fs-0.1.0.tm.html"> punkshell_module_punk::nav::fs </a> &#183; <a href="doc/files/punk/_module_path-0.1.0.tm.html"> punkshell_module_punk::path </a>
</td></tr>
<tr class="#doctools_idxeven" valign=top>
<td class="#doctools_idxleft" width="35%"><a name="frame"> frame </a></td>
@ -214,7 +214,7 @@
<tr class="#doctools_idxodd" valign=top>
<td class="#doctools_idxleft" width="35%"><a name="module"> module </a></td>
<td class="#doctools_idxright" width="65%">
<a href="doc/files/_module_modpod-0.1.2.tm.html"> modpod_module_modpod </a> &#183; <a href="doc/files/_module_overtype-1.6.5.tm.html"> overtype_module_overtype </a> &#183; <a href="doc/files/punk/_module_basictelnet-0.1.0.tm.html"> punkshell::basictelnet </a> &#183; <a href="doc/files/_module_argparsingtest-0.1.0.tm.html"> punkshell_module_argparsingtest </a> &#183; <a href="doc/files/_module_poshinfo-0.1.0.tm.html"> punkshell_module_poshinfo </a> &#183; <a href="doc/files/punk/_module_aliascore-0.1.0.tm.html"> punkshell_module_punk::aliascore </a> &#183; <a href="doc/files/punk/_module_ansi-0.1.1.tm.html"> punkshell_module_punk::ansi </a> &#183; <a href="doc/files/punk/_module_args-0.1.0.tm.html"> punkshell_module_punk::args </a> &#183; <a href="doc/files/punk/_module_assertion-0.1.0.tm.html"> punkshell_module_punk::assertion </a> &#183; <a href="doc/files/punk/_module_blockletter-0.1.0.tm.html"> punkshell_module_punk::blockletter </a> &#183; <a href="doc/files/punk/_module_cap-0.1.0.tm.html"> punkshell_module_punk::cap </a> &#183; <a href="doc/files/punk/_module_cesu-0.1.0.tm.html"> punkshell_module_punk::cesu </a> &#183; <a href="doc/files/punk/_module_char-0.1.0.tm.html"> punkshell_module_punk::char </a> &#183; <a href="doc/files/punk/_module_console-0.1.1.tm.html"> punkshell_module_punk::console </a> &#183; <a href="doc/files/punk/_module_encmime-0.1.0.tm.html"> punkshell_module_punk::encmime </a> &#183; <a href="doc/files/punk/_module_experiment-0.1.0.tm.html"> punkshell_module_punk::experiment </a> &#183; <a href="doc/files/punk/_module_fileline-0.1.0.tm.html"> punkshell_module_punk::fileline </a> &#183; <a href="doc/files/punk/_module_flib-0.1.0.tm.html"> punkshell_module_punk::flib </a> &#183; <a href="doc/files/punk/_module_island-0.1.0.tm.html"> punkshell_module_punk::island </a> &#183; <a href="doc/files/punk/_module_lib-0.1.1.tm.html"> punkshell_module_punk::lib </a> &#183; <a href="doc/files/punk/_module_packagepreference-0.1.0.tm.html"> punkshell_module_punk::packagepreference </a> &#183; <a href="doc/files/punk/_module_path-0.1.0.tm.html"> punkshell_module_punk::path </a> &#183; <a href="doc/files/punk/_module_rest-0.1.0.tm.html"> punkshell_module_punk::rest </a> &#183; <a href="doc/files/punk/_module_sshrun-0.1.0.tm.html"> punkshell_module_punk::sshrun </a> &#183; <a href="doc/files/punk/_module_trie-0.1.0.tm.html"> punkshell_module_punk::trie </a> &#183; <a href="doc/files/punk/_module_uc-0.1.0.tm.html"> punkshell_module_punk::uc </a> &#183; <a href="doc/files/punk/_module_winlnk-0.1.0.tm.html"> punkshell_module_punk::winlnk </a> &#183; <a href="doc/files/punk/_module_zip-0.1.1.tm.html"> punkshell_module_punk::zip </a> &#183; <a href="doc/files/punk/mix/commandset/_module_scriptwrap-0.1.0.tm.html"> punkshell_module_scriptwrap </a> &#183; <a href="doc/files/_module_textblock-0.1.1.tm.html"> punkshell_module_textblock </a> &#183; <a href="doc/files/_module_textblock-0.1.2.tm.html"> punkshell_module_textblock </a> &#183; <a href="doc/files/punk/nav/_module_fs-0.1.0.tm.html"> shellspy_module_punk::nav::fs </a> &#183; <a href="doc/files/punk/repl/_module_codethread-0.1.0.tm.html"> shellspy_module_punk::repl::codethread </a> &#183; <a href="doc/files/punk/_module_zip-0.1.0.tm.html"> shellspy_module_punk::zip </a> &#183; <a href="doc/files/_module_tomlish-1.1.1.tm.html"> tomlish_module_tomlish </a>
<a href="doc/files/_module_modpod-0.1.2.tm.html"> modpod_module_modpod </a> &#183; <a href="doc/files/_module_overtype-1.6.5.tm.html"> overtype_module_overtype </a> &#183; <a href="doc/files/punk/_module_basictelnet-0.1.0.tm.html"> punkshell::basictelnet </a> &#183; <a href="doc/files/_module_argparsingtest-0.1.0.tm.html"> punkshell_module_argparsingtest </a> &#183; <a href="doc/files/_module_poshinfo-0.1.0.tm.html"> punkshell_module_poshinfo </a> &#183; <a href="doc/files/punk/_module_aliascore-0.1.0.tm.html"> punkshell_module_punk::aliascore </a> &#183; <a href="doc/files/punk/_module_ansi-0.1.1.tm.html"> punkshell_module_punk::ansi </a> &#183; <a href="doc/files/punk/_module_args-0.1.0.tm.html"> punkshell_module_punk::args </a> &#183; <a href="doc/files/punk/args/_module_tclcore-0.1.0.tm.html"> punkshell_module_punk::args::tclcore </a> &#183; <a href="doc/files/punk/_module_assertion-0.1.0.tm.html"> punkshell_module_punk::assertion </a> &#183; <a href="doc/files/punk/_module_blockletter-0.1.0.tm.html"> punkshell_module_punk::blockletter </a> &#183; <a href="doc/files/punk/_module_cap-0.1.0.tm.html"> punkshell_module_punk::cap </a> &#183; <a href="doc/files/punk/_module_cesu-0.1.0.tm.html"> punkshell_module_punk::cesu </a> &#183; <a href="doc/files/punk/_module_char-0.1.0.tm.html"> punkshell_module_punk::char </a> &#183; <a href="doc/files/punk/_module_console-0.1.1.tm.html"> punkshell_module_punk::console </a> &#183; <a href="doc/files/punk/_module_encmime-0.1.0.tm.html"> punkshell_module_punk::encmime </a> &#183; <a href="doc/files/punk/_module_experiment-0.1.0.tm.html"> punkshell_module_punk::experiment </a> &#183; <a href="doc/files/punk/_module_fileline-0.1.0.tm.html"> punkshell_module_punk::fileline </a> &#183; <a href="doc/files/punk/_module_flib-0.1.0.tm.html"> punkshell_module_punk::flib </a> &#183; <a href="doc/files/punk/_module_island-0.1.0.tm.html"> punkshell_module_punk::island </a> &#183; <a href="doc/files/punk/_module_lib-0.1.1.tm.html"> punkshell_module_punk::lib </a> &#183; <a href="doc/files/punk/nav/_module_fs-0.1.0.tm.html"> punkshell_module_punk::nav::fs </a> &#183; <a href="doc/files/punk/_module_packagepreference-0.1.0.tm.html"> punkshell_module_punk::packagepreference </a> &#183; <a href="doc/files/punk/_module_path-0.1.0.tm.html"> punkshell_module_punk::path </a> &#183; <a href="doc/files/punk/repl/_module_codethread-0.1.0.tm.html"> punkshell_module_punk::repl::codethread </a> &#183; <a href="doc/files/punk/repl/_module_codethread-0.1.1.tm.html"> punkshell_module_punk::repl::codethread </a> &#183; <a href="doc/files/punk/_module_rest-0.1.0.tm.html"> punkshell_module_punk::rest </a> &#183; <a href="doc/files/punk/_module_safe-0.1.0.tm.html"> punkshell_module_punk::safe </a> &#183; <a href="doc/files/punk/_module_sixel-0.1.0.tm.html"> punkshell_module_punk::sixel </a> &#183; <a href="doc/files/punk/_module_sshrun-0.1.0.tm.html"> punkshell_module_punk::sshrun </a> &#183; <a href="doc/files/punk/_module_trie-0.1.0.tm.html"> punkshell_module_punk::trie </a> &#183; <a href="doc/files/punk/_module_uc-0.1.0.tm.html"> punkshell_module_punk::uc </a> &#183; <a href="doc/files/punk/_module_winlnk-0.1.0.tm.html"> punkshell_module_punk::winlnk </a> &#183; <a href="doc/files/punk/_module_zip-0.1.1.tm.html"> punkshell_module_punk::zip </a> &#183; <a href="doc/files/punk/mix/commandset/_module_scriptwrap-0.1.0.tm.html"> punkshell_module_scriptwrap </a> &#183; <a href="doc/files/_module_textblock-0.1.1.tm.html"> punkshell_module_textblock </a> &#183; <a href="doc/files/_module_textblock-0.1.2.tm.html"> punkshell_module_textblock </a> &#183; <a href="doc/files/punk/_module_zip-0.1.0.tm.html"> shellspy_module_punk::zip </a> &#183; <a href="doc/files/_module_termscheme-0.1.0.tm.html"> shellspy_module_termscheme </a> &#183; <a href="doc/files/_module_tomlish-1.1.1.tm.html"> tomlish_module_tomlish </a>
</td></tr>
<tr class="#doctools_idxheader"><th colspan="2">
<a name="cP">Keywords: P</a>
@ -280,7 +280,7 @@
<tr class="#doctools_idxodd" valign=top>
<td class="#doctools_idxleft" width="35%"><a name="repl"> repl </a></td>
<td class="#doctools_idxright" width="65%">
<a href="doc/files/main.html"> punkshell </a> &#183; <a href="doc/files/project_changes.html"> punkshell__project_changes </a> &#183; <a href="doc/files/project_intro.html"> punkshell__project_intro </a> &#183; <a href="doc/files/punk/repl/_module_codethread-0.1.0.tm.html"> shellspy_module_punk::repl::codethread </a>
<a href="doc/files/main.html"> punkshell </a> &#183; <a href="doc/files/project_changes.html"> punkshell__project_changes </a> &#183; <a href="doc/files/project_intro.html"> punkshell__project_intro </a> &#183; <a href="doc/files/punk/repl/_module_codethread-0.1.0.tm.html"> punkshell_module_punk::repl::codethread </a> &#183; <a href="doc/files/punk/repl/_module_codethread-0.1.1.tm.html"> punkshell_module_punk::repl::codethread </a>
</td></tr>
<tr class="#doctools_idxeven" valign=top>
<td class="#doctools_idxleft" width="35%"><a name="rest"> rest </a></td>
@ -336,7 +336,7 @@
<tr class="#doctools_idxodd" valign=top>
<td class="#doctools_idxleft" width="35%"><a name="terminal"> terminal </a></td>
<td class="#doctools_idxright" width="65%">
<a href="doc/files/punk/_module_basictelnet-0.1.0.tm.html"> punkshell::basictelnet </a> &#183; <a href="doc/files/_module_poshinfo-0.1.0.tm.html"> punkshell_module_poshinfo </a> &#183; <a href="doc/files/punk/_module_ansi-0.1.1.tm.html"> punkshell_module_punk::ansi </a> &#183; <a href="doc/files/punk/_module_console-0.1.1.tm.html"> punkshell_module_punk::console </a> &#183; <a href="doc/files/_module_textblock-0.1.2.tm.html"> punkshell_module_textblock </a> &#183; <a href="doc/files/punk/nav/_module_fs-0.1.0.tm.html"> shellspy_module_punk::nav::fs </a>
<a href="doc/files/punk/_module_basictelnet-0.1.0.tm.html"> punkshell::basictelnet </a> &#183; <a href="doc/files/_module_poshinfo-0.1.0.tm.html"> punkshell_module_poshinfo </a> &#183; <a href="doc/files/punk/_module_ansi-0.1.1.tm.html"> punkshell_module_punk::ansi </a> &#183; <a href="doc/files/punk/_module_console-0.1.1.tm.html"> punkshell_module_punk::console </a> &#183; <a href="doc/files/punk/nav/_module_fs-0.1.0.tm.html"> punkshell_module_punk::nav::fs </a> &#183; <a href="doc/files/_module_textblock-0.1.2.tm.html"> punkshell_module_textblock </a>
</td></tr>
<tr class="#doctools_idxeven" valign=top>
<td class="#doctools_idxleft" width="35%"><a name="text"> text </a></td>

60
src/embedded/www/toc.html

@ -61,57 +61,65 @@
<td class="#doctools_tocright">args parsing</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_args_tclcore'><a href="doc/files/punk/args/_module_tclcore-0.1.0.tm.html">punkshell_module_punk::args::tclcore</a></td>
<td class="#doctools_tocright">punk::args definitions for tcl core commands</td>
</tr>
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_assertion'><a href="doc/files/punk/_module_assertion-0.1.0.tm.html">punkshell_module_punk::assertion</a></td>
<td class="#doctools_tocright">assertion alternative to control::assert</td>
</tr>
<tr class="#doctools_tocodd" >
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_blockletter'><a href="doc/files/punk/_module_blockletter-0.1.0.tm.html">punkshell_module_punk::blockletter</a></td>
<td class="#doctools_tocright">punk::blockletter frame-based large lettering test/logo</td>
</tr>
<tr class="#doctools_toceven" >
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_cap'><a href="doc/files/punk/_module_cap-0.1.0.tm.html">punkshell_module_punk::cap</a></td>
<td class="#doctools_tocright">capability provider and handler plugin system</td>
</tr>
<tr class="#doctools_tocodd" >
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_cesu'><a href="doc/files/punk/_module_cesu-0.1.0.tm.html">punkshell_module_punk::cesu</a></td>
<td class="#doctools_tocright">CESU compatibility ehcoding scheme for utf-16: 8-Bit (CESU-8) ??</td>
</tr>
<tr class="#doctools_toceven" >
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_char'><a href="doc/files/punk/_module_char-0.1.0.tm.html">punkshell_module_punk::char</a></td>
<td class="#doctools_tocright">character-set and unicode utilities</td>
</tr>
<tr class="#doctools_tocodd" >
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_console'><a href="doc/files/punk/_module_console-0.1.1.tm.html">punkshell_module_punk::console</a></td>
<td class="#doctools_tocright">punk console</td>
</tr>
<tr class="#doctools_toceven" >
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_encmime'><a href="doc/files/punk/_module_encmime-0.1.0.tm.html">punkshell_module_punk::encmime</a></td>
<td class="#doctools_tocright">mime encodings related subset of tcllib mime</td>
</tr>
<tr class="#doctools_tocodd" >
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_experiment'><a href="doc/files/punk/_module_experiment-0.1.0.tm.html">punkshell_module_punk::experiment</a></td>
<td class="#doctools_tocright">Module API</td>
</tr>
<tr class="#doctools_toceven" >
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_fileline'><a href="doc/files/punk/_module_fileline-0.1.0.tm.html">punkshell_module_punk::fileline</a></td>
<td class="#doctools_tocright">file line-handling utilities</td>
</tr>
<tr class="#doctools_tocodd" >
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_flib'><a href="doc/files/punk/_module_flib-0.1.0.tm.html">punkshell_module_punk::flib</a></td>
<td class="#doctools_tocright">flib experimental</td>
</tr>
<tr class="#doctools_toceven" >
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_island'><a href="doc/files/punk/_module_island-0.1.0.tm.html">punkshell_module_punk::island</a></td>
<td class="#doctools_tocright">filesystem islands for safe interps</td>
</tr>
<tr class="#doctools_tocodd" >
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_lib'><a href="doc/files/punk/_module_lib-0.1.1.tm.html">punkshell_module_punk::lib</a></td>
<td class="#doctools_tocright">punk general utility functions</td>
</tr>
<tr class="#doctools_toceven" >
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_mix_commandset_project'><a href="doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html">punkshell_module_punk::mix::commandset::project</a></td>
<td class="#doctools_tocright">dec commandset - project</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_nav_fs'><a href="doc/files/punk/nav/_module_fs-0.1.0.tm.html">punkshell_module_punk::nav::fs</a></td>
<td class="#doctools_tocright">punk::nav::fs console filesystem navigation</td>
</tr>
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_packagepreference'><a href="doc/files/punk/_module_packagepreference-0.1.0.tm.html">punkshell_module_punk::packagepreference</a></td>
<td class="#doctools_tocright">punkshell package/module loading</td>
@ -121,10 +129,26 @@
<td class="#doctools_tocright">Filesystem path utilities</td>
</tr>
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_repl_codethread'><a href="doc/files/punk/repl/_module_codethread-0.1.0.tm.html">punkshell_module_punk::repl::codethread</a></td>
<td class="#doctools_tocright">Module repl codethread</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_repl_codethread'><a href="doc/files/punk/repl/_module_codethread-0.1.1.tm.html">punkshell_module_punk::repl::codethread</a></td>
<td class="#doctools_tocright">Module repl codethread</td>
</tr>
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_rest'><a href="doc/files/punk/_module_rest-0.1.0.tm.html">punkshell_module_punk::rest</a></td>
<td class="#doctools_tocright">punk::rest</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_safe'><a href="doc/files/punk/_module_safe-0.1.0.tm.html">punkshell_module_punk::safe</a></td>
<td class="#doctools_tocright">Module API</td>
</tr>
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_sixel'><a href="doc/files/punk/_module_sixel-0.1.0.tm.html">punkshell_module_punk::sixel</a></td>
<td class="#doctools_tocright">punk::sixel API</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='punkshell_module_punk_sshrun'><a href="doc/files/punk/_module_sshrun-0.1.0.tm.html">punkshell_module_punk::sshrun</a></td>
<td class="#doctools_tocright">Tcl procedures to execute tcl scripts in remote hosts</td>
</tr>
@ -157,18 +181,14 @@
<td class="#doctools_tocright">punk textblock functions</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='shellspy_module_punk_nav_fs'><a href="doc/files/punk/nav/_module_fs-0.1.0.tm.html">shellspy_module_punk::nav::fs</a></td>
<td class="#doctools_tocright">punk::nav::fs console filesystem navigation</td>
</tr>
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='shellspy_module_punk_repl_codethread'><a href="doc/files/punk/repl/_module_codethread-0.1.0.tm.html">shellspy_module_punk::repl::codethread</a></td>
<td class="#doctools_tocright">Module repl codethread</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='shellspy_module_punk_zip'><a href="doc/files/punk/_module_zip-0.1.0.tm.html">shellspy_module_punk::zip</a></td>
<td class="#doctools_tocright">Module API</td>
</tr>
<tr class="#doctools_tocodd" >
<td class="#doctools_tocleft" ><a name='shellspy_module_termscheme'><a href="doc/files/_module_termscheme-0.1.0.tm.html">shellspy_module_termscheme</a></td>
<td class="#doctools_tocright">Module API</td>
</tr>
<tr class="#doctools_toceven" >
<td class="#doctools_tocleft" ><a name='tomlish_module_tomlish'><a href="doc/files/_module_tomlish-1.1.1.tm.html">tomlish_module_tomlish</a></td>
<td class="#doctools_tocright">tomlish toml parser</td>
</tr>

32
src/modules/argparsingtest-999999.0a1.0.tm

@ -294,7 +294,31 @@ namespace eval argparsingtest {
} $args]
return [tcl::dict::get $argd opts]
}
proc test1_punkargs_validate_without_ansi {args} {
punk::args::definition {
*id argparsingtest::test1_punkargs2
*proc -name argtest4 -help "test of punk::args::get_dict comparative performance"
*opts -anyopts 0
-return -default string -type string
-frametype -default \uFFEF -type string
-show_edge -default \uFFEF -type string
-show_seps -default \uFFEF -type string
-join -type none -multiple 1
-x -default "" -type string
-y -default b -type string
-z -default c -type string
-1 -default 1 -type boolean
-2 -default 2 -type integer
-3 -default 3 -type integer
*values
}
proc test1_punkargs2 {args} {
set argd [punk::args::get_by_id argparsingtest::test1_punkargs2 $args]
return [tcl::dict::get $argd opts]
}
proc test1_punkargs_validate_ansistripped {args} {
set argd [punk::args::get_dict {
*proc -name argtest4 -help "test of punk::args::get_dict comparative performance"
*opts -anyopts 0
@ -306,9 +330,9 @@ namespace eval argparsingtest {
-x -default "" -type string
-y -default b -type string
-z -default c -type string
-1 -default 1 -type boolean -validate_without_ansi true
-2 -default 2 -type integer -validate_without_ansi true
-3 -default 3 -type integer -validate_without_ansi true
-1 -default 1 -type boolean -validate_ansistripped true
-2 -default 2 -type integer -validate_ansistripped true
-3 -default 3 -type integer -validate_ansistripped true
*values
} $args]
return [tcl::dict::get $argd opts]

4
src/modules/patternpunk-1.1.tm

@ -78,7 +78,7 @@ set ::punk::bannerTemplate [string trim {
} else {
lassign $cborder_ctext cborder ctext
}
return [ textblock::frame -type arc -ansiborder [a+ Web-black $cborder] [a+ Web-black $ctext][$this . logo2]]
return [ textblock::frame -checkargs 0 -type arc -ansiborder [a+ Web-black $cborder] [a+ Web-black $ctext][$this . logo2]]
}
>punk .. Property logotk "\[TCL\\\n TK \]"
proc TCL {args} {
@ -349,7 +349,7 @@ v_ /|\/ /
-boxmap -default {} -type dict
-boxlimits -default {hl vl tlc blc trc brc} -help "Limit the border box to listed elements."
-border_colour -default ${$border_colour} -type ansistring -regexprepass {^$} -validationtransform {
-function stripansi -maxlen 0
-function stripansi -maxsize 0
}
-title -default "PATTERN" -type string
-subtitle -default "PUNK" -type string

26
src/modules/poshinfo-999999.0a1.0.tm

@ -197,19 +197,21 @@ tcl::namespace::eval poshinfo {
proc set_active_theme_by_path {path} {
error "unimplemented"
}
punk::args::definition {
*id poshinfo::themes
*proc -name poshinfo::themes
-format -default all -multiple 1 -choices {all yaml json}\
-help "File format of posh theme - based on file extension"
-type -default all -multiple 1\
-help "e.g omp"
-as -default "table" -choices {list showlist dict showdict table tableobject plaintext}\
-help "return type of result"
*values -min 0
globs -multiple 1 -default * -help ""
}
proc themes {args} {
set argd [punk::args::get_dict {
*id poshinfo::themes
*proc -name poshinfo::themes
-format -default all -multiple 1 -choices {all yaml json}\
-help "File format of posh theme - based on file extension"
-type -default all -multiple 1\
-help "e.g omp"
-as -default "table" -choices {list showlist dict showdict table tableobject plaintext}\
-help "return type of result"
*values -min 0
globs -multiple 1 -default * -help ""
} $args]
set argd [punk::args::get_by_id poshinfo::themes $args]
set return_as [dict get $argd opts -as]
set formats [dict get $argd opts -format] ;#multiple
if {"yaml" in $formats} {

76
src/modules/punk-0.1.tm

@ -9,7 +9,7 @@ namespace eval punk {
zzzload::pkg_require $pkg
}
}
#lazyload twapi
#lazyload twapi ?
catch {package require vfs} ;#attempt load now so we can use faster 'package provide' to test existence later
}
@ -3670,7 +3670,7 @@ namespace eval punk {
incr i
}
#JMN2
#JMN2 - review
#set returnval [lindex $assigned_values 0]
if {[llength $assigned_values] == 1} {
set returnval [join $assigned_values]
@ -7271,55 +7271,59 @@ namespace eval punk {
catch {
package require patternpunk
#lappend chunks [list stderr [>punk . rhs]]
append mascotblock [textblock::frame [>punk . banner -title "Punk Shell" -left Tcl -right [package provide Tcl]]]
append mascotblock [textblock::frame -checkargs 0 [>punk . banner -title "Punk Shell" -left Tcl -right [package provide Tcl]]]
}
set topic [lindex $args end]
set argopts [lrange $args 0 end-1]
set text ""
append text "Punk core navigation commands:\n"
set title "[a+ brightgreen] Punk core navigation commands: "
#todo - load from source code annotation?
set cmdinfo [list]
lappend cmdinfo [list help "This help. To see available subitems type: help topics"]
lappend cmdinfo [list dev "(ensemble command to make new projects/modules and to generate docs)"]
lappend cmdinfo [list a? "view ANSI colours\n e.g a? web"]
lappend cmdinfo [list ./ "view/change directory"]
lappend cmdinfo [list ../ "go up one directory"]
lappend cmdinfo [list ./new "make new directory and switch to it"]
lappend cmdinfo [list n/ "view/change namespace (accepts ns path globs e.g **::*get* to match comands at any level )"]
lappend cmdinfo [list n// "view/change namespace (with command listing)"]
lappend cmdinfo [list nn/ "go up one namespace"]
lappend cmdinfo [list n/new "make child namespace and switch to it"]
set cmds [lsearch -all -inline -index 0 -subindices $cmdinfo *]
set descr [lsearch -all -inline -index 1 -subindices $cmdinfo *]
set widest1 [tcl::mathfunc::max {*}[lmap v $cmds {string length $v}]]
set widest2 [tcl::mathfunc::max {*}[lmap v $descr {string length $v}]]
lappend cmdinfo [list help "?topics?" "This help. To see available subitems type: help topics"]
lappend cmdinfo [list i "cmd ?subcommand...?" "Show usage for a command or ensemble subcommand"]
lappend cmdinfo [list ./ "?subdir?" "view/change directory"]
lappend cmdinfo [list ../ "" "go up one directory"]
lappend cmdinfo [list ./new "subdir" "make new directory and switch to it"]
lappend cmdinfo [list n/ "?glob...?" "view/change namespace\n (accepts ns path globs e.g **::*get* to match comands at any level )"]
lappend cmdinfo [list n// "" "view/change namespace (with command listing)"]
lappend cmdinfo [list "nn/" "" "go up one namespace"]
lappend cmdinfo [list "n/new" "<ns>" "make child namespace and switch to it"]
lappend cmdinfo [list dev "?subcommand?" "(ensemble command to make new projects/modules and to generate docs)"]
lappend cmdinfo [list a? "?subcommand...?" "view ANSI colours\n e.g a? web"]
#set cmds [lsearch -all -inline -index 0 -subindices $cmdinfo *]
#set descr [lsearch -all -inline -index 1 -subindices $cmdinfo *]
#set widest1 [tcl::mathfunc::max {*}[lmap v $cmds {string length $v}]]
#set widest2 [tcl::mathfunc::max {*}[lmap v $descr {string length $v}]]
set t [textblock::class::table new -show_seps 0]
foreach c $cmds d $descr {
#append text " [overtype::left $col1 $c][overtype::left $col2 $d]" \n
$t add_row [list $c $d]
}
set widest1 [$t column_datawidth 0]
$t configure_column 0 -minwidth [expr {$widest1 + 2}]
set widest2 [$t column_datawidth 1]
$t configure_column 1 -minwidth [expr {$widest2 + 1}]
#foreach c $cmds d $descr {
# $t add_row [list $c $d]
#}
foreach row $cmdinfo {
$t add_row $row
}
set width_0 [$t column_datawidth 0]
$t configure_column 0 -minwidth [expr {$width_0 + 2}]
set width_1 [$t column_datawidth 1]
$t configure_column 1 -minwidth [expr {$width_1 + 1}]
$t configure -title $title
set text ""
append text [$t print]
set warningblock ""
set introblock $mascotblock
append introblock \n $text
if {[catch {package require textblock} errM]} {
set introblock $mascotblock
append introblock \n $text
append warningblock \n "WARNING: textblock package couldn't be loaded. Side-by-side display not available"
} else {
set introblock [textblock::join -- " " \n$mascotblock " " $text]
}
#if {[catch {package require textblock} errM]} {
# append warningblock \n "WARNING: textblock package couldn't be loaded. Side-by-side display not available"
#} else {
# set introblock [textblock::join -- " " \n$mascotblock " " $text]
#}
lappend chunks [list stdout $introblock]

140
src/modules/punk/ansi-999999.0a1.0.tm

@ -132,14 +132,29 @@ tcl::namespace::eval punk::ansi::class {
set rendered [overtype::renderspace -cp437 1 -expand_right 0 -wrap 1 -width $w -height $h -appendlines 1 "" [$o_ansistringobj get]]
return $rendered
}
lappend ::punk::ansi::class::PUNKARGS [list {
*id "punk::ansi::class::class_ansi render_to_input_line"
*proc -name "punk::ansi::class::class_ansi render_to_input_line" -help\
"render string from line 0 to line
(experimental/debug)"
-dimensions -type string -help\
"WxH where W is integer width >= 1 and H is integer heigth >= 1"
-minus -type integer -help\
"number of chars to exclude from end"
*values -min 1 -max 1
line -type indexexpression
}]
method render_to_input_line {args} {
if {[llength $args] < 1} {
puts stderr "render_to_input_line usage: ?-dimensions WxH? ?-minus charcount? x"
punk::args::get_by_id "punk::ansi::class::class_ansi render_to_input_line" $args
}
set x [lindex $args end]
set arglist [lrange $args 0 end-1]
if {[llength $arglist] %2 != 0} {
puts stderr "render_to_input_line usage: ?-dimensions WxH? ?-minus charcount? x"
punk::args::get_by_id "punk::ansi::class::class_ansi render_to_input_line" $args
}
set opts [tcl::dict::create\
-dimensions 80x24\
@ -322,6 +337,7 @@ tcl::namespace::eval punk::ansi::class {
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
tcl::namespace::eval punk::ansi {
variable PUNKARGS
#*** !doctools
#[subsection {Namespace punk::ansi}]
#[para] Core API functions for punk::ansi
@ -422,6 +438,8 @@ tcl::namespace::eval punk::ansi {
erase*\
get_*\
hyperlink\
hyperlink_open\
hyperlink_close\
move*\
reset*\
ansistrip*\
@ -554,21 +572,35 @@ tcl::namespace::eval punk::ansi {
$obj destroy
return $result
}
proc example {args} {
set base [punk::repo::find_project]
set default_ansifolder [file join $base src/testansi]
set argd [punk::args::get_dict [tstr -return string {
proc Get_ansifolder {} {
if {[catch {punk::repo::find_project} base]} {
set base ""
}
if {$base eq ""} {
#pwd not avail in safe interp
if {![catch {pwd} CWD]} {
set base $CWD
}
}
return [file join $base src/testansi]
}
lappend PUNKARGS [list -dynamic 1 {
*id punk::ansi::example
*proc -name punk::ansi::example -help "Display .ans image files in a grid that will fit in console
"
-colwidth -default 82 -help "Width of each column - default of 82 will fit a standard 80wide ansi image (when framed)
You can specify a narrower width to truncate images on the right side"
-folder -default "${$default_ansifolder}" -help "Base folder for files if relative paths are used.
-folder -default "${[punk::ansi::Get_ansifolder]}" -help "Base folder for files if relative paths are used.
Defaults to <projectbase>/src/testansi - where projectbase is determined from current directory.
"
*values -min 0 -max -1
files -default {belinda.ans bot.ans flower.ans fish.ans} -multiple true -help "List of filenames - leave empty to display 4 defaults"
}] $args]
} ""]
proc example {args} {
set argd [punk::args::get_by_id punk::ansi::example $args]
set colwidth [dict get $argd opts -colwidth]
set ansifolder [file normalize [dict get $argd opts -folder]]
set fnames [dict get $argd values files]
@ -621,7 +653,7 @@ tcl::namespace::eval punk::ansi {
set subtitle [tcl::dict::get $picinfo status]
}
set title [tcl::dict::get $picinfo filename]
set fr [textblock::frame -width $colwidth -subtitle $subtitle -title $title [tcl::dict::get $picinfo pic]]
set fr [textblock::frame -checkargs 0 -width $colwidth -subtitle $subtitle -title $title [tcl::dict::get $picinfo pic]]
# -- --- --- ---
#we need the max height of a row element to use join_basic instead of join below
# -- --- --- ---
@ -2320,16 +2352,23 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
set sgr_cache [tcl::dict::create]
#sgr_cache clear called by punk::console::ansi when set to off
proc sgr_cache {args} {
set argd [punk::args::get_dict {
*proc -name punk::ansi::sgr_cache -help "Convenience function to view and optionally clear the ansi character attribute cache (ansi SGR codes)
"
-action -default "" -choices "clear" -help "-action clear will unset the keys in the punk::ansi::sgr_cache dict
This is called automatically when setting 'colour false' in the console"
-pretty -default 1 -type boolean -help "use 'pdict punk::ansi::sgr_cache */%str,%ansiview' output"
#punk::args depends on punk::ansi - REVIEW
proc sgr_cache {args} {
set argdef {
*id punk::ansi::sgr_cache
*proc -name punk::ansi::sgr_cache -help\
"Convenience function to view and optionally clear the ansi character attribute cache (ansi SGR codes)
"
-action -default "" -choices "clear" -help\
"-action clear will unset the keys in the punk::ansi::sgr_cache dict
This is called automatically when setting 'colour false' in the console"
-pretty -default 1 -type boolean -help\
"use 'pdict punk::ansi::sgr_cache */%str,%ansiview' output"
*values -min 0 -max 0
} $args]
}
set argd [punk::args::get_dict $argdef $args]
set action [dict get $argd opts -action]
set pretty [dict get $argd opts -pretty]
@ -2372,6 +2411,31 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
return [join $lines \n]
}
lappend PUNKARGS [list {
*id punk::ansi::a+
*proc -name "punk::ansi::a+" -help\
"Returns an ANSI sgr escape sequence based on the list of supplied codes.
"
*values -min 0 -max -1
} [string map [list <choices> [dict keys $SGR_map]] {
code -type string -optional 1 -multiple 1 -choices {<choices>} -choiceprefix 0 -choicerestricted 0 -help\
"SGR code from the list below, or an integer corresponding to the code e.g 31 = red.
A leading capital letter indicates a codename applies to the background colour.
Other accepted codes are:
term-<int> Term-<int> foreground/background where int is 0-255 terminal color
term-<termcolour> Term-<termcolour> foreground/background
rgb-<r>-<g>-<b> Rgb-<r>-<g>-<b> foreground/background where <r> <g> <b> are the
0-255 int values for red, green and blue.
rgb#<hexcode> Rgb#<hexcode> where <hexcode> is a 6 char hex colour e.g rgb#C71585
web-<webcolour> Web-<webcolour>
The acceptable values for <termcolour> and <webcolour> can be queried using
punk::ansi::a? term
and
punk::ansi::a? web"
}]]
proc a+ {args} {
#*** !doctools
#[call [fun a+] [opt {ansicode...}]]
@ -3267,17 +3331,49 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
}
# REVIEW - osc8 replays etc for split lines? - textblock
#Hyperlinks (a.k.a. HTML-like anchors) in terminal emulators https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
#the 'id' parameter logically connects split hyperlinks
#per interp. Rather than try to avoid collisions using something like 'info cmdcount' we will use a simple counter.
#To stop multiple hyperlinks from having ids inadvertently collide - we should do some id mangling/prefixing based on the terminal/window etc
#It is better to use a simple counter with high likelihood of collision so we are more likely to detect problems with ids than to make it more intermittent by using ids that collide only 'rarely'
variable hyperlinkcounter
set hyperlinkcounter 0
proc hyperlink {uri {display ""}} {
variable hyperlinkcounter
if {$display eq ""} {
set display $uri
}
set params "" ;#todo e.g id=xyz123:foo=bar:baz=quux
set uri [punk::ansi::ansistripraw $uri]
#limit uri length we emit based on common limits in other terminals
if {[string length $uri] > 2083} {
error "punk::ansi::hyperlink uri too long: limit 2083"
}
set params "id=punkansi-[incr hyperlinkcounter]" ;#todo e.g id=xyz123:foo=bar:baz=quux
set open "\x1b\]8\;$params\;$uri\x1b\\"
set close "\x1b\]8\;\;\x1b\\"
return ${open}${display}${close}
}
#on windows terminal at least, both uri and id of 2 separated hyperlinks need to match for the hover highlighting to act as a unit.
proc hyperlink_open {uri {id ""}} {
if {$id eq ""} {
set id punkansi-[incr hyperlinkcounter]
}
set uri [punk::ansi::ansistripraw $uri]
if {[string length $uri] > 2083} {
error "punk::ansi::hyperlink uri too long: limit 2083"
}
set id [string map {: . {;} ,} $id] ;#avoid some likely problematic ids. TODO - review, restrict further.
set params "id=$id"
return "\x1b\]8\;$params\;$uri\x1b\\"
}
#It should be ok to close even if no currently active hyperlink (e.g can be used to cleanup if something awry)
proc hyperlink_close {} {
return "\x1b\]8\;\;\x1b\\"
}
# -- --- --- --- ---
proc move {row col} {
#*** !doctools
@ -3837,11 +3933,13 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
#[call [fun ansistrip] [arg text] ]
#[para]Return a string with ansi codes stripped out
#[para]Alternate graphics chars are replaced with modern unicode equivalents (e.g boxdrawing glyphs)
if {[string length $text] < 2} {return $text}
if {[punk::ansi::ta::detect_g0 $text]} {
set text [convert_g0 $text];#Convert ansi borders to unicode line drawing instead of ascii letters
}
if {[string length $text] < 2} {return $text}
set parts [punk::ansi::ta::split_codes $text]
if {[llength $parts] == 1} {return [lindex $parts 0]}
set out ""
#todo - try: join [lsearch -stride 2 -index 0 -subindices -all -inline $parts *] ""
# - (if/when lsearch -stride bug fixed)
@ -3871,6 +3969,7 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
#[para]Return a string with ansi codes stripped out
#[para]Alternate graphics modes will be stripped rather than converted to unicode - exposing the raw ascii characters as they appear without graphics mode.
#[para]ie instead of a horizontal line you may see: qqqqqq
if {[string length $text] < 2} {return $text}
set parts [punk::ansi::ta::split_codes $text]
set out ""
@ -7294,6 +7393,13 @@ tcl::namespace::eval punk::ansi::internal {
}
}
if {![info exists ::punk::args::register::NAMESPACES]} {
namespace eval ::punk::args::register {
set NAMESPACES [list]
}
}
lappend ::punk::args::register::NAMESPACES ::punk::ansi ::punk::ansi::class
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
## Ready
package provide punk::ansi [tcl::namespace::eval punk::ansi {

1680
src/modules/punk/args-999999.0a1.0.tm

File diff suppressed because it is too large Load Diff

700
src/modules/punk/args/tclcore-999999.0a1.0.tm

@ -0,0 +1,700 @@
# -*- tcl -*-
# Maintenance Instruction: leave the 999999.xxx.x as is and use punkshell 'dev make' or bin/punkmake to update from <pkg>-buildversion.txt
# module template: punkshell/src/decktemplates/vendor/punk/modules/template_module-0.0.3.tm
#
# Please consider using a BSD or MIT style license for greatest compatibility with the Tcl ecosystem.
# Code using preferred Tcl licenses can be eligible for inclusion in Tcllib, Tklib and the punk package repository.
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
# (C) 2025
#
# @@ Meta Begin
# Application punk::args::tclcore 999999.0a1.0
# Meta platform tcl
# Meta license MIT
# @@ Meta End
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
# doctools header
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#*** !doctools
#[manpage_begin punkshell_module_punk::args::tclcore 0 999999.0a1.0]
#[copyright "2025"]
#[titledesc {punk::args definitions for tcl core commands}] [comment {-- Name section and table of contents description --}]
#[moddesc {tcl core argument definitions}] [comment {-- Description at end of page heading --}]
#[require punk::args::tclcore]
#[keywords module]
#[description]
#[para] -
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#*** !doctools
#[section Overview]
#[para] overview of punk::args::tclcore
#[subsection Concepts]
#[para] -
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
## Requirements
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#*** !doctools
#[subsection dependencies]
#[para] packages used by punk::args::tclcore
#[list_begin itemized]
package require Tcl 8.6-
package require punk::args
#*** !doctools
#[item] [package {Tcl 8.6}]
#[item] [package {punk::args}]
#*** !doctools
#[list_end]
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#*** !doctools
#[section API]
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
# oo::class namespace
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#tcl::namespace::eval punk::args::tclcore::class {
#*** !doctools
#[subsection {Namespace punk::args::tclcore::class}]
#[para] class definitions
#if {[tcl::info::commands [tcl::namespace::current]::interface_sample1] eq ""} {
#*** !doctools
#[list_begin enumerated]
# oo::class create interface_sample1 {
# #*** !doctools
# #[enum] CLASS [class interface_sample1]
# #[list_begin definitions]
# method test {arg1} {
# #*** !doctools
# #[call class::interface_sample1 [method test] [arg arg1]]
# #[para] test method
# puts "test: $arg1"
# }
# #*** !doctools
# #[list_end] [comment {-- end definitions interface_sample1}]
# }
#*** !doctools
#[list_end] [comment {--- end class enumeration ---}]
#}
#}
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
# Base namespace
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
tcl::namespace::eval punk::args::tclcore {
tcl::namespace::export {[a-z]*} ;# Convention: export all lowercase
#variable xyz
#for tcllib - we can potentially parse the doctools to get this info.
#for tcl core commands - the data is stored in man pages - which are not so easy to parse.
#todo - link to man pages
#TODO -
#if we want colour in arg definitions -we need to respect nocolor or change colour to off/ on
#If color included in a definition - it will need to be reloaded when colour toggled(?)
#if {[catch {package require punk::ansi}]} {
# set has_punkansi 0
# set A_WARN ""
# set A_RST ""
#} else {
# set has_punkansi 1
# set A_WARN [a+ red]
# set A_RST "\x1b\[0m"
#}
#we can't just strip ansi as there are non colour codes such as hyperlink that should be maintained whether color is on or off.
#for now we can use reverse - (like underline, is a non-colour attribute that remains effective when color off in punk::ansi)
set A_WARN \x1b\[7m
set A_RST \x1b\[0m
variable manbase_tcl
variable manbase_ext
set patch [info patchlevel]
lassign [split $patch .] major
if {$major < 9} {
set manbase_tcl "https://tcl.tk/man/tcl/TclCmd"
set manbase_ext .htm
} else {
set manbase_tcl "https://tcl.tk/man/tcl9.0/TclCmd"
set manbase_ext .html
}
proc manpage_tcl {cmd} {
variable manbase_tcl
variable manbase_ext
return ${manbase_tcl}/${cmd}${manbase_ext}
}
variable PUNKARGS
# -- --- --- --- --- --- --- --- --- --- --- --- --- ---
# library commands loaded via auto_index
# -- --- --- --- --- --- --- --- --- --- --- --- --- ---
lappend PUNKARGS [list {
*id parray
*proc -name "Builtin: parray" -help\
"Prints on standard output the names and values of all the elements in the
array arrayName, or just the names that match pattern (using the matching
rules of string_match) and their values if pattern is given.
ArrayName must be an array accessible to the caller of parray. It may either
be local or global. The result of this command is the empty string.
(loaded via auto_index)"
*values -min 1 -max 2
arrayName -type string -help\
"variable name of an array"
pattern -type string -optional 1 -help\
"Match pattern possibly containing glob characters"
} "*doc -name Manpage: -url [manpage_tcl library]" ]
# -- --- --- --- --- --- --- --- --- --- --- --- --- ---
lappend PUNKARGS [list {
*id time
*proc -name "Builtin: time" -help\
"Calls the Tcl interpreter count times to evaluate script
(or once if count is not specified). It will then return
a string of the form
503.2 microseconds per iteration
which indicates the average amount of time required per
iteration, in microseconds. Time is measured in elapsed
time, not CPU time.
(see also: timerate)"
*values -min 1 -max 2
script -type script
count -type integer -default 1 -optional 1
} "*doc -name Manpage: -url [manpage_tcl time]" ]
lappend PUNKARGS [list {
*id tcl::namespace::path
*proc -name "Builtin: tcl::namespace::path" -help\
"Returns the command resolution path of the current namespace.
If namespaceList is specified as a list of named namespaces, the current
namespace's command resolution path is set to those namespaces and returns
the empty list. The default command resolution path is always empty.
See the section NAME_RESOLUTION in the manpage for an explanation of the
rules regarding name resolution."
*values -min 0 -max 1
namespaceList -type list -optional 1 -help\
"List of existing namespaces"
} "*doc -name Manpage: -url [manpage_tcl namespace]" ]
lappend PUNKARGS [list {
*id tcl::namespace::unknown
*proc -name "Builtin: tcl::namespace::unknown" -help\
"Sets or returns the unknown command handler for the current namespace.
The handler is invoked when a command called from within the namespace cannot
be found in the current namespace, the namespace's path nor in the global
namespace.
"
*values -min 0 -max 1
script -type script -optional 1 -help\
"A well formed list representing a command name and "
} "*doc -name Manpage: -url [manpage_tcl namespace]" ]
lappend PUNKARGS [list {
*id lappend
*proc -name "builtin: lappend" -help\
"Append list elements onto a variable.
"
*values -min 1 -max -1
varName -type string -help\
"variable name"
value -type any -optional 1 -multiple 1
} "*doc -name Manpage: -url [manpage_tcl lappend]"]
punk::args::definition {
*id ledit
*proc -name "builtin: ledit" -help\
"Replace elements of a list stored in variable
"
*values -min 3 -max -1
listVar -type string -help\
"Existing list variable name"
first -type indexexpression
last -type indexexpression
value -type any -optional 1 -multiple 1
} "*doc -name Manpage: -url [manpage_tcl ledit]"
punk::args::definition {
*id lpop
*proc -name "builtin: lpop" -help\
"Get and remove an element in a list
"
*values -min 1 -max -1
varName -type string -help\
"Existing list variable name"
index -type indexexpression -default end -optional 1 -multiple 1 -help\
"When presented with a single index, the lpop command addresses
the index'th element in it, removes it from the list and returns
the element.
If index is negative or greater or equal than the number of
elements in the list in the variable called varName, an error occurs.
If addition index arguments are supplied, then each argument is used
in turn to address an element within a sublist designated by the
previous indexing operation, allowing the script to remove elements
in sublists, similar to lindex and lset."
} "*doc -name Manpage: -url [manpage_tcl lpop]"
punk::args::definition {
*id lrange
*proc -name "builtin: lrange" -help\
"return one or more adjacent elements from a list.
The new list returned consists of elements first through last, inclusive.
The index values first and last are interpreted the same as index values
for the command 'string index', supporting simple index arithmetic and
indices relative to the end of the list.
e.g lrange {a b c} 0 end-1
"
*values -min 3 -max 3
list -type list -help\
"tcl list as a value"
first -help\
"index expression for first element"
last -help\
"index expression for last element"
} "*doc -name Manpage: -url [manpage_tcl lrange]"
punk::args::definition {
*id tcl::string::cat
*proc -name "builtin: tcl::string::cat" -help\
"Concatente the given strings just like placing them directly next to each other and
return the resulting compound string. If no strings are present, the result is an
empty string.
This primitive is occasionally handier than juxtaposition of strings when mixed quoting
is wanted, or when the aim is to return the result of a concatentation without resorting
to return -level 0, and is more efficient than building a list of arguments and using
join with an empty join string."
*values -min 0 -max -1
string -type string -optional 1 -multiple 1
} "*doc -name Manpage: -url [manpage_tcl string]"
punk::args::definition {
*id tcl::string::compare
*proc -name "builtin: tcl::string::compare" -help\
"Perform a character-by-character comparison of strings string1 and string2.
Returns -1, 0, or 1, dpending on whether string1 is lexicographically
lessthan, equal to, or greater than string2"
-nocase -type none -help\
"If -nocase is specified, then the strings are compared in a case insensitive manner."
-length -type integer -help\
"If -length is specified, then only the first length characters are used in the comparison.
If -length is negative, it is ignored."
*values -min 2 -max 2
string1 -type string
string2 -type string
} "*doc -name Manpage: -url [manpage_tcl string]"
punk::args::definition {
*id tcl::string::equal
*proc -name "builtin: tcl::string::equal" -help\
"Perform a character-by-character comparison of strings string1 and string2.
Returns 1 if string1 and string2 are identical, or 0 when not."
-nocase -type none -help\
"If -nocase is specified, then the strings are compared in a case insensitive manner."
-length -type integer -help\
"If -length is specified, then only the first length characters are used in the comparison.
If -length is negative, it is ignored."
*values -min 2 -max 2
string1 -type string
string2 -type string
} "*doc -name Manpage: -url [manpage_tcl string]"
punk::args::definition {
*id tcl::string::first
*proc -name "builtin: tcl::string::first" -help\
"Search haystackString for a sequence of characters that exactly match the characters
in needleString. If found, return the index of the first character in the first such
match within haystackString. If there is no match, then return -1. If startIndex is
specified (in any of the forms described in STRING_INDICES), then the search is
constrained to start with the character in haystackString specified by the index.
"
*values -min 2 -max 3
needleString -type string
haystackString -type string
startIndex -type indexexpression -optional 1 -help\
"integer or simple expression."
} "*doc -name Manpage: -url [manpage_tcl string]"
punk::args::definition {
*id tcl::string::insert
*proc -name "builtin: tcl::string::insert" -help\
"Returns a copy of string with insertString inserted at the index'th character.
If index is start-relative, the first character inserted in the returned string will be
at the specified index.
If index is end-relative, the last character inserted in the returned string will be
at the specified index.
if index is at or before the start of string (e.g., index is 0), insertString is
prepended to the string.
If index is at or after the end of the string (e.g., index is end), insertString is
appended to string."
*values -min 3 -max 3
string -type string
index -type indexexpression -help\
"The index may be specified as described in the STRING_INDICES section"
insertString -type string
} "*doc -name Manpage: -url [manpage_tcl string]"
punk::args::definition {
*id tcl::string::last
*proc -name "builtin: tcl::string::last" -help\
"Search haystackString for a sequence of characters that exactly match the characters
in needleString. If found, return the index of the first character in the last such
match within haystackString. If there is no match, then return -1. If lastIndex is
specified (in any of the forms described in STRING_INDICES), then only the characters
in haystackString at or before the specified lastIndex will be considered by the search
"
*values -min 2 -max 3
needleString -type string
haystackString -type string
lastIndex -type indexexpression -optional 1 -help\
"integer or simple expression."
} "*doc -name Manpage: -url [manpage_tcl string]"
punk::args::definition {
*id tcl::string::repeat
*proc -name "builtin: tcl::string::repeat" -help\
"Returns a string consisting of string concatenated with itself count times."
*values -min 2 -max 2
string -type string
count -type int -help\
"If count is 0, the empty string will be returned."
} "*doc -name Manpage: -url [manpage_tcl string]"
punk::args::definition {
*id tcl::string::replace
*proc -name "builtin: tcl::string::replace" -help\
"Removes a range of consecutive characters from string, starting with the character whose
index is first and ending with the character whose index is last
(Using the forms described in STRING_INDICES). An index of 0 refers to the first
character of the string. First and last may be specified as for the index method.
If first is less than zero then it is treated as if it were zero, and if last is
greater than or equal to the length of the string then it is treated as if it were
end. The initial string is returned untouched, if first is greater than last, or if
first is equal to or greater than the length of the inital string, or last is less
than 0."
*values -min 3 -max 3
string -type string
first -type indexexpression
last -type indexexpression
newstring -type string -optional 1 -help\
"If newstring is specified, then it is placed in the removed character range."
} "*doc -name Manpage: -url [manpage_tcl string]"
punk::args::definition {
*id tcl::string::totitle
*proc -name "builtin: tcl::string::totitle" -help\
"Returns a value equal to string except that the first character in string is converted to
it's Unicode title case variant (or upper case if there is no title case variant) and the
rest of the string is converted to lower case."
*values -min 1 -max 1
string -type string
first -type indexexpression -optional 1 -help\
"If first is specified, it refers to the first char index in the string to start modifying."
last -type indexexpression -optional 1 -help\
"If last is specified, it refers to the char index in the string to stop at (inclusive)."
} "*doc -name Manpage: -url [manpage_tcl string]"
punk::args::definition {
*id tcl::string::wordend
*proc -name "builtin: tcl::string::wordend" -help\
"Returns the index of the character just after the last one in the word containing
character charIndex of string.
A word is considered to be any contiguous range of alphanumeric (Unicode letters or decimal digits)
or underscore (Unicode connector punctuation) characters, or any single character other than these."
*values -min 2 -max 2
string -type string
charIndex -type indexexpression -help\
"integer or simple expresssion.
e.g end
e.g end-1
e.g M+N"
} "*doc -name Manpage: -url [manpage_tcl string]"
punk::args::definition {
*id tcl::string::wordstart
*proc -name "builtin: tcl::string::wordstart" -help\
"Returns the index of the first character in the word containing
character charIndex of string.
A word is considered to be any contiguous range of alphanumeric (Unicode letters or decimal digits)
or underscore (Unicode connector punctuation) characters, or any single character other than these.
"
*values -min 2 -max 2
string -type string
charIndex -type indexexpression -help\
"integer or simple expresssion.
e.g end
e.g end-1
e.g M+N"
} "*doc -name Manpage: -url [manpage_tcl string]"
punk::args::definition [punk::lib::tstr -return string {
*id tcl::string::is
*proc -name "builtin: tcl::string::is" -help\
"Returns 1 if string is a valid member of the specified character class, otherwise returns 0.
"
*leaders -min 1 -max 1
class -type string\
-choices {
alnum
alpha
ascii
boolean
control
dict
digit
double
entier
false
graph
integer
list
lower
print
punct
space
true
upper
wideinteger
wordchar
xdigit
}\
-choicelabels {
alnum\
" Any Unicode alphabet
or digit character"
alpha\
" Any Unicode alphabet
character"
ascii\
" Any character with
a value less than \\u0080
(those that are in the
7-bit ascii range)"
boolean\
" Any of the forms allowed
to Tcl_GetBoolean"
control\
" Any Unicode control char"
dict\
" Any proper dict structure,
with optional surrounding
whitespace. In case of
improper dict structure, 0
is returned and the varname
will contain the index of
the \"element\" where the
dict parsing fails or -1 if
this cannot be determined."
digit\
" Any Unicode digit char.
Note that this includes
chars outside of the \[0-9\]
range."
double\
" Any of the forms allowed
to Tcl_GetDoubleFromObj.
${$A_WARN}With optional surrounding${$A_RST}
${$A_WARN}whitespace.${$A_RST}"
entier\
" Synonym for integer"
false\
" Any of the forms allowed
to Tcl_GetBoolean where the
value is false"
graph\
" Any Unicode printing char
except space."
integer\
" Any of the valid string
formats for an integer value
of arbitrary size in Tcl,
${$A_WARN}with optional surrounding${$A_RST}
${$A_WARN}whitespace${$A_RST}. The formats
accepted are exactly those
accepted by the C routine
Tcl_GetBignumFromObj."
list\
" Any proper list structure,
with optional surrounding
whitespace. In case of
improper list structure, 0
is returned and the varname
will contain the index of
the \"element\" where list
parsing fails, or -1 if
this cannot be determined"
lower\
" Any Unicode lower case
alphabet character"
print\
" Any Unicode printing
character, including space"
punct\
" Any Unicode punctuation
character."
space\
" Any Unicode whitespace
character, mongolian vowel
separator (U+180e),
zero width space (U+200b),
word joiner (U+2060) or
zero width no-break space
(U+feff) (=BOM)"
true\
" Any of the forms allowed
to Tcl_GetBoolean where the
value is true"
upper\
" Any upper case alphabet
character in the Unicode
character set"
wideinteger\
" Any of the valid forms
for a wide integer in Tcl,
${$A_WARN}with optional surrounding${$A_RST}
${$A_WARN}whitespace${$A_RST}. In case of
overflow in the value, 0 is
returned and the varname
will contain -1."
wordchar\
" Any Unicode word char.
That is any alphanumeric
character, and any
Unicode connector
punctuation characters
(e.g. underscore)"
xdigit\
" Any hexadecimal digit
character, and any Unicode
connector punctuation
characters (e.g. underscore)"
}\
-help\
"character class
In the case of boolean, true and false, if the function will return 0, then the
varname will always be set to 0, due to the varied nature of a valid boolean value"
-strict -type none -help\
"If -strictis specified, then an empty string returns 0,
otherwise an empty string will return 1 on any class"
-failindex -type variablename -help\
"If -failindex is specified, then if the function returns 0,
the index in the string where the class was no longer valid will be stored
in the variable named."
*values -min 1 -max 1
string -type string -optional 0
}] "*doc -name Manpage: -url [manpage_tcl string]"
if {![info exists ::punk::args::register::NAMESPACES]} {
namespace eval ::punk::args::register {
set ::punk::args::register::NAMESPACES [list] ;#use fully qualified so 8.6 doesn't find existing var in global namespace
}
}
lappend ::punk::args::register::NAMESPACES ::punk::args::tclcore
#*** !doctools
#[subsection {Namespace punk::args::tclcore}]
#[para] Core API functions for punk::args::tclcore
#[list_begin definitions]
#proc sample1 {p1 n args} {
# #*** !doctools
# #[call [fun sample1] [arg p1] [arg n] [opt {option value...}]]
# #[para]Description of sample1
# #[para] Arguments:
# # [list_begin arguments]
# # [arg_def tring p1] A description of string argument p1.
# # [arg_def integer n] A description of integer argument n.
# # [list_end]
# return "ok"
#}
#*** !doctools
#[list_end] [comment {--- end definitions namespace punk::args::tclcore ---}]
}
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
# Secondary API namespace
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
tcl::namespace::eval punk::args::tclcore::lib {
tcl::namespace::export {[a-z]*} ;# Convention: export all lowercase
tcl::namespace::path [tcl::namespace::parent]
#*** !doctools
#[subsection {Namespace punk::args::tclcore::lib}]
#[para] Secondary functions that are part of the API
#[list_begin definitions]
#proc utility1 {p1 args} {
# #*** !doctools
# #[call lib::[fun utility1] [arg p1] [opt {?option value...?}]]
# #[para]Description of utility1
# return 1
#}
#*** !doctools
#[list_end] [comment {--- end definitions namespace punk::args::tclcore::lib ---}]
}
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#*** !doctools
#[section Internal]
#tcl::namespace::eval punk::args::tclcore::system {
#*** !doctools
#[subsection {Namespace punk::args::tclcore::system}]
#[para] Internal functions that are not part of the API
#}
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
## Ready
package provide punk::args::tclcore [tcl::namespace::eval punk::args::tclcore {
variable pkg punk::args::tclcore
variable version
set version 999999.0a1.0
}]
return
#*** !doctools
#[manpage_end]

3
src/modules/punk/args/tclcore-buildversion.txt

@ -0,0 +1,3 @@
0.1.0
#First line must be a semantic version number
#all other lines are ignored.

57
src/modules/punk/blockletter-999999.0a1.0.tm

@ -119,17 +119,18 @@ tcl::namespace::eval punk::blockletter {
set logo_letter_colours [list Web-red Web-green Web-royalblue Web-purple Web-orange]
set logo_letter_colours [list Red Green Blue Purple Yellow]
punk::args::definition [tstr -return string {
*id punk::blockletter::logo
-frametype -default {${$default_frametype}}
-outlinecolour -default "web-white"
-backgroundcolour -default {} -help "e.g Web-white
This argument is the name as accepted by punk::ansi::a+"
*values -min 0 -max 0
}]
proc logo {args} {
variable logo_letter_colours
variable default_frametype
set argd [punk::args::get_dict [tstr -return string {
-frametype -default {${$default_frametype}}
-outlinecolour -default "web-white"
-backgroundcolour -default {} -help "e.g Web-white
This argument is the name as accepted by punk::ansi::a+"
*values -min 0 -max 0
}] $args]
set argd [punk::args::get_by_id punk::blockletter::logo $args]
set f [dict get $argd opts -frametype]
set bd [dict get $argd opts -outlinecolour]
set bgansi [dict get $argd opts -backgroundcolour] ;#we use ta::detect to see if already ansi and apply as necessary
@ -217,17 +218,18 @@ tcl::namespace::eval punk::blockletter {
append out [textblock::join_basic -- $left $centre $right]
}
punk::args::definition [tstr -return string {
*id punk::blockletter::text
-bgcolour -default "Web-red"
-bordercolour -default "web-white"
-frametype -default {${$default_frametype}}
*values -min 1 -max 1
str -help "Text to convert to blockletters
Requires terminal font to support relevant block characters"
"
}]
proc text {args} {
variable default_frametype
set argd [punk::args::get_dict [tstr -return string {
-bgcolour -default "Web-red"
-bordercolour -default "web-white"
-frametype -default {${$default_frametype}}
*values -min 1 -max 1
str -help "Text to convert to blockletters
Requires terminal font to support relevant block characters"
"
}] $args]
set argd [punk::args::get_by_id punk::blockletter::text $args]
set opts [dict get $argd opts]
set str [dict get $argd values str]
set str [string map {\r\n \n} $str]
@ -277,16 +279,19 @@ tcl::namespace::eval punk::blockletter::lib {
# return 1
#}
punk::args::definition [tstr -return string {
*id punk::blockletter::block
-height -default 2
-width -default 4
-frametype -default {${$::punk::blockletter::default_frametype}}
-bgcolour -default "Web-red"
-bordercolour -default "web-white"
*values -min 0 -max 0
}]
proc block {args} {
upvar ::punk::blockletter::default_frametype ft
set argd [punk::args::get_dict [tstr -return string {
-height -default 2
-width -default 4
-frametype -default {${$ft}}
-bgcolour -default "Web-red"
-bordercolour -default "web-white"
*values -min 0 -max 0
}] $args]
set argd [punk::args::get_by_id punk::blockletter::block $args]
set bg [dict get $argd opts -bgcolour]
set bd [dict get $argd opts -bordercolour]
set h [dict get $argd opts -height]

35
src/modules/punk/config-0.1.tm

@ -361,11 +361,14 @@ tcl::namespace::eval punk::config {
}
proc configure {args} {
set argd [punk::args::get_dict {
set argdef {
*id punk::config::configure
*proc -name punk::config::configure -help\
"UNIMPLEMENTED"
*values -min 1 -max 1
whichconfig -type string -choices {startup running stop}
} $args]
}
set argd [punk::args::get_dict $argdef $args]
return "unimplemented - $argd"
}
@ -375,6 +378,8 @@ tcl::namespace::eval punk::config {
return [punk::lib::showdict $configdata]
}
#e.g
# copy running-config startup-config
# copy startup-config test-config.cfg
@ -382,16 +387,22 @@ tcl::namespace::eval punk::config {
#review - consider the merge vs overwrite feature of some routers.. where copy to running-config does a merge rather than an overwrite
#This is to allow partial configs to be loaded to running, whereas a save of running to any target is always a complete configuration
proc copy {args} {
set argd [punk::args::get_dict {
*proc -name punk::config::copy -help "Copy a partial or full configuration from one config to another
If a target config has additional settings, then the source config can be considered to be partial with regards to the target.
"
-type -default "" -choices {replace merge} -help "Defaults to merge when target is running-config
Defaults to replace when source is running-config"
set argdef {
*id punk::config::copy
*proc -name punk::config::copy -help\
"Copy a partial or full configuration from one config to another
If a target config has additional settings, then the source config can be considered to be partial with regards to the target.
"
-type -default "" -choices {replace merge} -help\
"Defaults to merge when target is running-config
Defaults to replace when source is running-config"
*values -min 2 -max 2
fromconfig -help "running or startup or file name (not fully implemented)"
toconfig -help "running or startup or file name (not fully implemented)"
} $args]
fromconfig -help\
"running or startup or file name (not fully implemented)"
toconfig -help\
"running or startup or file name (not fully implemented)"
}
set argd [punk::args::get_dict $argdef $args]
set fromconfig [dict get $argd values fromconfig]
set toconfig [dict get $argd values toconfig]
set fromconfig [string map {-config ""} $fromconfig]

5
src/modules/punk/console-999999.0a1.0.tm

@ -81,6 +81,8 @@ namespace eval punk::console {
#*** !doctools
#[list_begin definitions]
variable PUNKARGS
variable tabwidth 8 ;#default only - will attempt to detect and set to that configured in terminal
#Note that windows terminal cooked mode seems to use 8 for interactive use even if set differently
#e.g typing tab characters may still be echoed 8-spaced while writing to stdout my obey the terminal's tab stops.
@ -1187,7 +1189,8 @@ namespace eval punk::console {
*id punk::console::cell_size
-inoutchannels -default {stdin stdout} -type list
*values -min 0 -max 1
newsize -default ""
newsize -default "" -help\
"character cell pixel dimensions WxH"
}
proc cell_size {args} {
set argd [punk::args::get_by_id punk::console::cell_size $args]

19
src/modules/punk/fileline-999999.0a1.0.tm

@ -1251,6 +1251,16 @@ namespace eval punk::fileline {
#[para] Core API functions for punk::fileline
#[list_begin definitions]
punk::args::definition {
*id punk::fileline::get_textinfo
*proc -name punk::fileline::get_textinfo -help\
"return: textinfo object instance"
-file -default {} -type existingfile
-translation -default iso8859-1
-encoding -default "\uFFFF"
-includebom -default 0
*values -min 0 -max 1
}
proc get_textinfo {args} {
#*** !doctools
#[call get_textinfo [opt {option value...}] [opt datachunk]]
@ -1266,14 +1276,7 @@ namespace eval punk::fileline {
#[para]Currently only utf-8, utf-16* and utf-32* are properly supported even though the other BOMs are detected, reported via get_bomid, and stripped from the data.
#[para]GB18030 falls back to cp936/gbk (unless a gb18030 encoding has been installed). Use -encoding iso8859-1 if this isn't suitable and you need to do your own processing of the bytes.
set argument_specification {
-file -default {} -type existingfile
-translation -default iso8859-1
-encoding -default "\uFFFF"
-includebom -default 0
*values -min 0 -max 1
}
lassign [dict values [punk::args::get_dict $argument_specification $args]] opts values
lassign [dict values [punk::args::get_by_id punk::fileline::get_textinfo $args]] opts values
# -- --- --- ---
set opt_file [dict get $opts -file]
set opt_translation [dict get $opts -translation]

190
src/modules/punk/lib-999999.0a1.0.tm

@ -48,8 +48,10 @@
#[list_begin itemized]
package require Tcl 8.6-
package require punk::args
#*** !doctools
#[item] [package {Tcl 8.6-}]
#[item] [package {punk::args}]
# #package require frobz
# #*** !doctools
@ -140,7 +142,7 @@ tcl::namespace::eval punk::lib::check {
proc has_tclbug_lsearch_strideallinline {} {
#bug only occurs with single -index value combined with -stride -all -inline -subindices
#https://core.tcl-lang.org/tcl/tktview/5a1aaa201d
if {[catch {[lsearch -stride 3 -all -inline -index 1 -subindices {a1 a2 a3} *]} result]} {
if {[catch {lsearch -stride 3 -all -inline -index 1 -subindices {a1 a2 a3} *} result]} {
#we aren't looking for an error result - error most likely indicates tcl too old to support -stride
return 0
}
@ -320,7 +322,7 @@ tcl::namespace::eval punk::lib::compat {
if {"::lmap" ne [info commands ::lmap]} {
#puts stderr "Warning - no built-in lpop"
interp alias {} lpop {} ::punk::lib::compat::lmaptcl
interp alias {} lmap {} ::punk::lib::compat::lmaptcl
}
#lmap came in Tcl 8.6 - so probably not much need for a tcl forward compatibility version - but here it is anyway
proc lmaptcl {varnames list script} {
@ -384,6 +386,7 @@ tcl::namespace::eval punk::lib::compat {
# Base namespace
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
namespace eval punk::lib {
variable PUNKARGS
tcl::namespace::export *
variable has_struct_list
set has_struct_list [expr {![catch {package require struct::list}]}]
@ -956,171 +959,8 @@ namespace eval punk::lib {
proc lzipn {args} [info body ::punk::lib::lzipn_tcl9a]
}
#experiment with equiv of js template literals with ${expression} in templates
#e.g tstr {This is the value of x in calling scope ${$x} !}
#e.g tstr -allowcommands {This is the value of x in calling scope ${[set x]} !}
#e.g tstr -allowcommands {This is the value of [lindex $x 0] in calling scope ${[lindex [set x] 0]} !}
proc tstr {args} {
set argd [punk::args::get_dict {
*proc -name punk::lib::tstr -help "A rough equivalent of js template literals"
-allowcommands -default 0 -type none -help "if -allowcommands is true placeholder can contain commands e.g {${plaintext1 [lindex $var 0] plaintext2}}"
-return -default list -choices {dict list string}
*values -min 1 -max 1
templatestring -help "This argument should be a braced string containing placeholders such as ${$var} e.g {The value is ${$var}}
where $var will be substituted from the calling context
The placeholder itself can contain plaintext portions as well as variables.
It can contain commands in square brackets if -allowcommands is true"
} $args]
set templatestring [dict get $argd values templatestring]
set opt_allowcommands [dict get $argd opts -allowcommands]
set opt_return [dict get $argd opts -return]
set nocommands "-nocommands"
if {$opt_allowcommands == 1} {
set nocommands ""
}
#set parts [_tstr_split $templatestring]
set parts [_parse_tstr_parts $templatestring]
set textchunks [list]
#set expressions [list]
set params [list]
set idx 0
foreach {pt expression} $parts {
lappend textchunks $pt
incr idx ;#pt incr
#ignore last expression
if {$idx == [llength $parts]} {
break
}
#lappend expressions $expression
lappend params [uplevel 1 [list subst {*}$nocommands $expression]]
incr idx ;#expression incr
}
switch -- $opt_return {
dict {
return [dict create template $textchunks params $params]
}
list {
return [list $textchunks {*}$params]
}
string {
set out ""
foreach pt $textchunks param $params {
append out $pt $param
}
return $out
}
default {
}
}
}
#test single placeholder tstr args where single placeholder must be an int
proc tstr_test_one {args} {
set argd [punk::args::get_dict {
*proc -name tstr_test_one -help {An example/test of a function designed to be called with a js-style curly-braced Tstr.
example:
set id 2
tstr_test_one {*}[Tstr {Select * from table where id = ${$id} and etc... ;}]
}
*values -min 2 -max 2
template -type list -minlen 2 -maxlen 2 -help "This could be supplied directly as a 2 element list of each half of the sql statement -
but the Tstr method above does this for you, and also passes in the id automatically"
where -type int -help {Integer param for where clause. Tstr mechanism above will pass the id as the second parameter}
} $args]
set template [dict get $argd values template]
set where [dict get $argd values where]
set result [join [list [lindex $template 0] $where [lindex $template 1]] ""]
return $result
}
proc _parse_tstr_parts {templatestring} {
if {$templatestring eq ""} {
return [list]
}
set chars [split $templatestring ""]
set in_placeholder 0
set tchars ""
set echars ""
set parts [list]
set i 0
foreach ch $chars {
if {!$in_placeholder} {
set nextch [lindex $chars [expr {$i+1}]]
if {"$ch$nextch" eq "\$\{"} {
set in_placeholder 2 ;#2 to signify we just entered placeholder
lappend parts $tchars
set tchars ""
} else {
append tchars $ch
}
} else {
if {$ch eq "\}"} {
if {[tcl::info::complete $echars]} {
set in_placeholder 0
lappend parts $echars
set echars ""
} else {
append echars $ch
}
} else {
if {$in_placeholder == 2} {
#skip opening bracket
set in_placeholder 1
} else {
append echars $ch
}
}
}
incr i
}
if {$tchars ne ""} {
lappend parts $tchars
}
if {[llength $parts] % 2 == 0} {
#always trail with pt for consistency with _perlish_split method so we can test other mechanisms with odd-length pt/code../pt style list
lappend parts ""
}
return $parts
}
#based on punk::ansi::ta::_perlish_split
proc _tstr_split {text} {
if {$text eq ""} {
return {}
}
set list [list]
set start 0
#ideally re should allow curlies within but we will probably need a custom parser to do it
#(js allows nested string interpolation)
#set re {\$\{[^\}]*\}}
set re {\$\{(?:(?!\$\{).)*\}}
#eg regexp {\x1b(?:\(0(?:(?:(?!\x1b\(B).)*\x1b\(B)|\)0(?:(?:(?!\x1b\)B).)*\x1b\)B))} $code
#We can get $matchEnd < $matchStart; we need to ensure there is an exit condition for non-greedy empty results REVIEW
while {[regexp -start $start -indices -- $re $text match]} {
lassign $match matchStart matchEnd
#puts "->start $start ->match $matchStart $matchEnd"
if {$matchEnd < $matchStart} {
puts "e:$matchEnd < s:$matchStart"
lappend list [tcl::string::range $text $start $matchStart-1] [tcl::string::index $text $matchStart]
incr start
if {$start >= [tcl::string::length $text]} {
break
}
continue
}
lappend list [tcl::string::range $text $start $matchStart-1] [tcl::string::range $text $matchStart+2 $matchEnd-1]
set start [expr {$matchEnd+1}]
#?
if {$start >= [tcl::string::length $text]} {
break
}
}
return [lappend list [tcl::string::range $text $start end]]
}
namespace import ::punk::args::lib::tstr
#get info about punk nestindex key ie type: list,dict,undetermined
proc nestindex_info {args} {
@ -1184,8 +1024,11 @@ namespace eval punk::lib {
set sep " [punk::ansi::a+ Green]=[punk::ansi::a] "
}
set argspec [string map [list %sep% $sep] {
*proc -name pdict -help {Print dict keys,values to channel
(see also showdict)}
*id punk::lib::pdict
*proc -name pdict -help\
"Print dict keys,values to channel
The pdict function operates on variable names - passing the value to the showdict function which operates on values
(see also showdict)"
*opts -any 1
@ -1222,7 +1065,6 @@ namespace eval punk::lib {
The second level segement in each pattern switches to a dict operation to retrieve the value by key.
When a list operation such as @* is used - integer list indexes are displayed on the left side of the = for that hierarchy level.
The pdict function operates on variable names - passing the value to the showdict function which operates on values
}
}]
#puts stderr "$argspec"
@ -1282,7 +1124,7 @@ namespace eval punk::lib {
-ansibase_keys -default "" -help "ansi list for each level in -substructure. e.g \[list \[a+ red\] \[a+ web-green\]\]"
-substructure -default {}
-ansibase_values -default ""
-keytemplates -default {${$key}} -type list -help "list of templates for keys at each level"
-keytemplates -default {\$\{$key\}} -type list -help "list of templates for keys at each level"
-keysorttype -default "none" -choices {none dictionary ascii integer real}
-keysortdirection -default increasing -choices {increasing decreasing}
*values -min 1 -max -1
@ -1295,6 +1137,7 @@ namespace eval punk::lib {
set opt_keysortdirection [dict get $argd opts -keysortdirection]
set opt_trimright [dict get $argd opts -trimright]
set opt_keytemplates [dict get $argd opts -keytemplates]
puts stderr "---> $opt_keytemplates <---"
set opt_ansibase_keys [dict get $argd opts -ansibase_keys]
set opt_ansibase_values [dict get $argd opts -ansibase_values]
set opt_return [dict get $argd opts -return]
@ -4272,6 +4115,13 @@ tcl::namespace::eval punk::lib::system {
#*** !doctools
#[list_end] [comment {--- end definitions namespace punk::lib::system ---}]
}
if {![info exists ::punk::args::register::NAMESPACES]} {
namespace eval ::punk::args::register {
set ::punk::args::register::NAMESPACES [list] ;#use fully qualified so 8.6 doesn't find existing var in global namespace
}
}
lappend ::punk::args::register::NAMESPACES ::punk::lib
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
## Ready
package provide punk::lib [tcl::namespace::eval punk::lib {

2
src/modules/punk/mix/commandset/layout-999999.0a1.0.tm

@ -35,7 +35,7 @@ namespace eval punk::mix::commandset::layout {
proc files {{layout ""}} {
set argd [punk::args::get_dict {
*values -min 1 -max 1
layout -type string -minlen 1
layout -type string -minsize 1
} [list $layout]]
set allfiles [lib::layout_all_files $layout]

26
src/modules/punk/mix/commandset/loadedlib-999999.0a1.0.tm

@ -26,19 +26,21 @@ package require punk::lib
namespace eval punk::mix::commandset::loadedlib {
namespace export *
#search automatically wrapped in * * - can contain inner * ? globs
proc search {args} {
set argspecs {
*proc -name "punk::mix::commandset::loadedlib search" -help "search all Tcl libraries available to your local interpreter"
-return -type string -default table -choices {table tableobject list lines}
-present -type integer -default 2 -choices {0 1 2} -choicelabels {absent present both} -help "(unimplemented) Display only those that are 0:absent 1:present 2:both"
-highlight -type boolean -default 1 -help "Highlight which version is present with ansi underline and colour"
-refresh -default 0 -type boolean -help "Re-scan the tm and library folders"
searchstrings -default * -multiple 1 -help "Names to search for, may contain glob chars (* ?) e.g *lib*
punk::args::definition {
*id punk::mix::commandset::loadedlib::search
*proc -name "punk::mix::commandset::loadedlib search" -help "search all Tcl libraries available to your local interpreter"
-return -type string -default table -choices {table tableobject list lines}
-present -type integer -default 2 -choices {0 1 2} -choicelabels {absent present both} -help\
"(unimplemented) Display only those that are 0:absent 1:present 2:both"
-highlight -type boolean -default 1 -help "Highlight which version is present with ansi underline and colour"
-refresh -default 0 -type boolean -help "Re-scan the tm and library folders"
searchstrings -default * -multiple 1 -help\
"Names to search for, may contain glob chars (* ?) e.g *lib*
If no glob chars are explicitly specified, the searchstring will be wrapped with star globs.
eg name -> *name*
"
}
set argd [punk::args::get_dict $argspecs $args]
eg name -> *name*"
}
proc search {args} {
set argd [punk::args::get_by_id punk::mix::commandset::loadedlib::search $args]
set searchstrings [dict get $argd values searchstrings]
set opts [dict get $argd opts]
set opt_return [dict get $opts -return]

70
src/modules/punk/mix/commandset/module-999999.0a1.0.tm

@ -137,23 +137,39 @@ namespace eval punk::mix::commandset::module {
put stderr "get_template_basefolders WARNING - no handler available for the 'punk.templates' capability - template providers will be unable to provide template locations"
}
}
set moduletypes [punk::mix::cli::lib::module_types]
punk::args::definition [subst {
*id punk::mix::commandset::module::new
*proc -name "punk::mix::commandset::module::new" -help\
"Create a new module file in the appropriate folder within src/modules.
If the name given in the module argument is namespaced,
the necessary subfolder(s) will be used or created."
-project -optional 1
-version -default "0.1.0" -help\
"version to use if not specified as part of the module argument.
If a version is specified in the module argument as well as in -version
the higher version number will be used.
"
-license -default <unspecified>
-template -default punk.module
-type -default "[lindex $moduletypes 0]" -choices {$moduletypes}
-force -default 0 -type boolean -help\
"If set true, will overwrite an existing .tm file if there is one.
If false (default) an error will be raised if there is a conflict."
-quiet -default 0 -type boolean -help\
"Suppress information messages on stdout"
*values -min 1 -max 1
module -type string -help\
"Name of module, possibly including a namespace and/or version number
e.g mynamespace::mymodule-1.0"
}]
proc new {args} {
set year [clock format [clock seconds] -format %Y]
set moduletypes [punk::mix::cli::lib::module_types]
# use \uFFFD because unicode replacement char should consistently render as 1 wide
set argspecs [subst {
-project -default \uFFFD
-version -default \uFFFD
-license -default <unspecified>
-template -default punk.module
-type -default \uFFFD -choices {$moduletypes}
-force -default 0 -type boolean
-quiet -default 0 -type boolean
*values -min 1 -max 1
module -type string
}]
set argd [punk::args::get_dict $argspecs $args]
lassign [dict values $argd] leaders opts values
set argd [punk::args::get_by_id punk::mix::commandset::module::new $args]
lassign [dict values $argd] leaders opts values received
set module [dict get $values module]
#set opts [dict merge $defaults $args]
@ -168,13 +184,9 @@ namespace eval punk::mix::commandset::module {
# we need this value before looking at the named argument
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set opt_version_supplied [dict get $opts -version]
if {$opt_version_supplied eq "\uFFFD"} {
set opt_version "0.1.0"
} else {
set opt_version $opt_version_supplied
if {![util::is_valid_tm_version $opt_version]} {
error "deck module.new error - supplied -version $opt_version doesn't appear to be a valid Tcl module version"
}
set opt_version $opt_version_supplied
if {![util::is_valid_tm_version $opt_version]} {
error "deck module.new error - supplied -version $opt_version doesn't appear to be a valid Tcl module version"
}
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
#named argument
@ -194,7 +206,7 @@ namespace eval punk::mix::commandset::module {
} else {
set vmsg "from -version option: $opt_version_supplied"
}
if {$opt_version_supplied ne "\uFFFD"} {
if {"-version" in $received} {
if {$vcompare_is_mversion_bigger != 0} {
#is bigger or smaller
puts stderr "module.new WARNING: version supplied in module argument as well as -version option. Using the higher version number $vmsg"
@ -231,7 +243,6 @@ namespace eval punk::mix::commandset::module {
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
#options
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set opt_project [dict get $opts -project]
set testdir [pwd]
if {![string length [set projectdir [punk::repo::find_project $testdir]]]} {
if {![string length [set projectdir [punk::repo::find_candidate $testdir]]]} {
@ -239,9 +250,10 @@ namespace eval punk::mix::commandset::module {
error "module.new unable to create module in projectdir:$projectdir - directory doesn't appear to meet basic standards $msg"
}
}
if {$opt_project == "\uFFFF"} {
if {![dict exists $received -project]} {
set projectname [file tail $projectdir]
} else {
set opt_project [dict get $opts -project]
set projectname $opt_project
if {$projectname ne [file tail $projectdir]} {
error "module.new -project '$opt_project' doesn't match detected projectname '$projectname' at path: $projectdir"
@ -309,12 +321,6 @@ namespace eval punk::mix::commandset::module {
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set opt_type [dict get $opts -type]
if {$opt_type eq "\uFFFD"} {
set opt_type [lindex [punk::mix::cli::lib::module_types] 0] ;#default to plain
}
if {$opt_type ni [punk::mix::cli::lib::module_types]} {
error "module.new - error - unknown -type '$opt_type' known-types: [punk::mix::cli::lib::module_types]"
}
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set opt_quiet [dict get $opts -quiet]
set opt_force [dict get $opts -force]
@ -407,7 +413,7 @@ namespace eval punk::mix::commandset::module {
set podfile $modulefolder/#modpod-$moduletail-$infile_version/$moduletail-$infile_version.tm
set has_tm [file exists $tmfile]
set has_pod [file exists $podfile]
if {$has_tm && $has_pos} {
if {$has_tm && $has_pod} {
#invalid configuration - bomb out
error "module.new error: Invalid target configuration found. module folder has both a .tm file $tmfile and a modpod file $podfile. Please delete one of them before trying again."
}
@ -448,7 +454,7 @@ namespace eval punk::mix::commandset::module {
}
set buildversionfile [file join $modulefolder ${moduletail}-buildversion.txt]
set existing_build_version ""
if {[file exists $buildversionfile]} {
if {!$opt_force && [file exists $buildversionfile]} {
set buildversiondata [punk::mix::util::fcat $buildversionfile]
set lines [split $buildversiondata \n]
set existing_build_version [string trim [lindex $lines 0]]

1016
src/modules/punk/ns-999999.0a1.0.tm

File diff suppressed because it is too large Load Diff

31
src/modules/punk/path-999999.0a1.0.tm

@ -45,8 +45,10 @@
#[list_begin itemized]
package require Tcl 8.6-
package require punk::args
#*** !doctools
#[item] [package {Tcl 8.6-}]
#[item] [package {punk::args}]
# #package require frobz
# #*** !doctools
@ -642,6 +644,20 @@ namespace eval punk::path {
return $ismatch
}
punk::args::definition {
*id punk::path::treefilenames
-directory -type directory -help\
"folder in which to begin recursive scan for files."
-call-depth-internal -default 0 -type integer
-antiglob_paths -default {} -help\
"list of path patterns to exclude
may include * and ** path segments e.g /usr/**"
*values -min 0 -max -1 -optional 1 -type string
tailglobs -multiple 1 -help\
"Patterns to match against filename portion (last segment) of each file path
within the directory tree being searched."
}
#todo - implement treefiles which acts like dirfiles but allows path globbing in the same way as punk::ns::ns/
#then review if treefiles can replace dirfiles or if both should exist (dirfiles can have literal glob chars in path segments - but that is a rare usecase)
proc treefilenames {args} {
@ -655,22 +671,17 @@ namespace eval punk::path {
#[para] list of path patterns to exclude - may include * and ** path segments e.g /usr/**
#[para]no natsorting - so order is dependent on filesystem
set argd [punk::args::get_dict {
-directory -default "\uFFFF"
-call-depth-internal -default 0 -type integer
-antiglob_paths -default {}
*values -min 0 -max -1 -optional 1 -type string
tailglobs -multiple 1
} $args]
lassign [dict values $argd] leaders opts values
set argd [punk::args::get_by_id punk::path::treefilenames $args]
lassign [dict values $argd] leaders opts values received
set tailglobs [dict values $values]
# -- --- --- --- --- --- ---
set opt_antiglob_paths [dict get $opts -antiglob_paths]
set CALLDEPTH [dict get $opts -call-depth-internal]
# -- --- --- --- --- --- ---
set opt_dir [dict get $opts -directory]
if {$opt_dir eq "\uFFFF"} {
if {![dict exists $received -directory]} {
set opt_dir [pwd]
} else {
set opt_dir [dict get $opts -directory]
}
# -- --- --- --- --- --- ---

422
src/modules/punk/repl-0.1.tm

@ -30,6 +30,7 @@ package require shellfilter
#package require shellrun
#package require punk
package require punk::lib
package require punk::args
package require punk::aliascore
if {[catch {punk::aliascore::init} errM]} {
puts stderr "punk::aliascore::init error: $errM"
@ -2773,7 +2774,7 @@ namespace eval repl {
proc punk {} {
interp eval code {
package require punk::repl
repl::init
repl::init -safe punk
repl::start stdin
}
}
@ -2781,14 +2782,21 @@ namespace eval repl {
interp eval code {
package require punk::repl
}
interp eval code [list repl::init -safe 1 {*}$args]
interp eval code [list repl::init -safe safe {*}$args]
interp eval code [list repl::start stdin]
}
proc safebase {args} {
interp eval code {
package require punk::repl
}
interp eval code [list repl::init -safe 2 {*}$args]
interp eval code [list repl::init -safe safebase {*}$args]
interp eval code [list repl::start stdin]
}
proc punksafe {args} {
interp eval code {
package require punk::repl
}
interp eval code [list repl::init -safe punksafe {*}$args]
interp eval code [list repl::start stdin]
}
}
@ -2805,189 +2813,265 @@ namespace eval repl {
set paths [dict get $args -paths]
}
if {$safe == 1} {
interp create -safe -- code
if {[llength $paths]} {
package require punk::island
foreach p $paths {
punk::island::add code $p
switch -- $safe {
safe {
interp create -safe -- code
if {[llength $paths]} {
package require punk::island
foreach p $paths {
punk::island::add code $p
}
}
}
#review argv0,argv,argc
interp eval code {
namespace eval ::codeinterp {
variable errstack {}
variable outstack {}
#review argv0,argv,argc
interp eval code {
namespace eval ::codeinterp {
variable errstack {}
variable outstack {}
}
set ::argv0 %argv0%
set ::auto_path %autopath%
#puts stdout "safe interp"
#flush stdout
}
set ::argv0 %argv0%
set ::auto_path %autopath%
#puts stdout "safe interp"
#flush stdout
}
interp eval code [list set ::tcl_platform(os) $::tcl_platform(os)]
interp eval code [list set ::tcl_platform(osVersion) $::tcl_platform(osVersion)]
interp eval code [list set ::tcl_platform(machine) $::tcl_platform(machine)]
if {"stdout" in [chan names]} {
interp share {} stdout code
} else {
interp share {} [shellfilter::stack::item_tophandle stdout] code
}
if {"stderr" in [chan names]} {
interp share {} stderr code
} else {
interp share {} [shellfilter::stack::item_tophandle stderr] code
}
code alias ::md5::md5 ::repl::interphelpers::md5
code alias exit ::repl::interphelpers::quit
} elseif {$safe == 2} {
#safebase
safe::interpCreate code -nested 1
#safe::setLogCmd ::repl::interpextras::safe_msg ;#using setLogcmd early will show the auto_path notice - which is *verbose*
#while it may conceivably be useful in debugging safe itself - auto_path and tcl::tm::list can be inspected to show these values in the safe interp itself anyway - so early logging is of limited utility here.
if {[llength $paths]} {
package require punk::island
foreach p $paths {
punk::island::add code $p
interp eval code [list set ::tcl_platform(os) $::tcl_platform(os)]
interp eval code [list set ::tcl_platform(osVersion) $::tcl_platform(osVersion)]
interp eval code [list set ::tcl_platform(machine) $::tcl_platform(machine)]
if {"stdout" in [chan names]} {
interp share {} stdout code
} else {
interp share {} [shellfilter::stack::item_tophandle stdout] code
}
}
interp eval code {
set ::argv0 %argv0%
set ::argc 0
set ::argv {}
set ::auto_path %autopath%
#puts stdout "safebase interp"
#flush stdout
namespace eval ::codeinterp {
variable errstack {}
variable outstack {}
if {"stderr" in [chan names]} {
interp share {} stderr code
} else {
interp share {} [shellfilter::stack::item_tophandle stderr] code
}
}
interp eval code [list set ::tcl_platform(os) $::tcl_platform(os)]
interp eval code [list set ::tcl_platform(osVersion) $::tcl_platform(osVersion)]
interp eval code [list set ::tcl_platform(machine) $::tcl_platform(machine)]
#code invokehidden package require punk::lib
if {"stdout" in [chan names]} {
interp share {} stdout code
} else {
interp share {} [shellfilter::stack::item_tophandle stdout] code
}
if {"stderr" in [chan names]} {
interp share {} stderr code
} else {
interp share {} [shellfilter::stack::item_tophandle stderr] code
}
interp eval code {
package require punk::lib
package require textblock ;#may fail to load term::ansi::code::macros - (only required for altg)
}
code alias ::md5::md5 ::repl::interphelpers::md5
code alias exit ::repl::interphelpers::quit
}
safebase {
#safebase
safe::interpCreate code -nested 1 -autopath %autopath%
#safe::setLogCmd ::repl::interpextras::safe_msg ;#using setLogcmd early will show the auto_path notice - which is *verbose*
#while it may conceivably be useful in debugging safe itself - auto_path and tcl::tm::list can be inspected to show these values in the safe interp itself anyway - so early logging is of limited utility here.
if {[llength $paths]} {
package require punk::island
foreach p $paths {
punk::island::add code $p
}
}
interp eval code {
set ::argv0 %argv0%
set ::argc 0
set ::argv {}
#puts stdout "safebase interp"
#flush stdout
namespace eval ::codeinterp {
variable errstack {}
variable outstack {}
}
}
interp eval code [list set ::tcl_platform(os) $::tcl_platform(os)]
interp eval code [list set ::tcl_platform(osVersion) $::tcl_platform(osVersion)]
interp eval code [list set ::tcl_platform(machine) $::tcl_platform(machine)]
#JMN
interp eval code {
package require shellfilter
}
#code invokehidden package require punk::lib
if {"stdout" in [chan names]} {
interp share {} stdout code
} else {
interp share {} [shellfilter::stack::item_tophandle stdout] code
}
if {"stderr" in [chan names]} {
interp share {} stderr code
} else {
interp share {} [shellfilter::stack::item_tophandle stderr] code
}
interp eval code {
package require punk::lib
package require textblock ;#may fail to load term::ansi::code::macros - (only required for altg)
}
#JMN
interp eval code {
package require shellfilter
}
#work around bug in safe base which won't load Tcl libs that have deeper nesting
#(also affects tcllib page/plugins folder)
set termversions [package versions term]
set termv [lindex $termversions end]
if {$termv ne ""} {
set path [lindex [package ifneeded term $termv] end] ;#assuming path at end of something like "source .../term.tcl"
set termbase [file dirname $path]
safe::interpAddToAccessPath code [file join $termbase ansi]
safe::interpAddToAccessPath code [file join $termbase ansi code]
}
#safe::interpAddToAccessPath code NUL
if {$safelog ne ""} {
#setting setLogCmd here gives some feedback for potentially interesting feedback regarding behaviour of things such as glob
safe::setLogCmd $safelog
#work around bug in safe base which won't load Tcl libs that have deeper nesting
#(also affects tcllib page/plugins folder)
set termversions [package versions term]
set termv [lindex $termversions end]
if {$termv ne ""} {
set path [lindex [package ifneeded term $termv] end] ;#assuming path at end of something like "source .../term.tcl"
set termbase [file dirname $path]
safe::interpAddToAccessPath code [file join $termbase ansi]
safe::interpAddToAccessPath code [file join $termbase ansi code]
}
#safe::interpAddToAccessPath code NUL
if {$safelog ne ""} {
#setting setLogCmd here gives potentially interesting feedback regarding behaviour of things such as glob
safe::setLogCmd $safelog
}
#code invokehidden source c:/repo/jn/shellspy/modules/punk/lib-0.1.1.tm
code alias detok ::safe::DetokPath code ;#temp - this violates the point of the {$p(:X:)} paths
#review - exit should do something slightly different
# see ::safe::interpDelete
code alias exit ::repl::interphelpers::quit
code alias ::md5::md5 ::repl::interphelpers::md5
code alias ::fconfigure ::fconfigure ;#needed for shellfilter
code alias ::file ::file
interp eval code [list package provide md5 $md5version]
}
#code invokehidden source c:/repo/jn/shellspy/modules/punk/lib-0.1.1.tm
punk - 0 {
interp create code
interp eval code {
#safe !=1 and safe !=2, tmlist: %tmlist%
set ::argv0 %argv0%
set ::argv %argv%
set ::argc %argc%
set ::auto_path %autopath%
tcl::tm::remove {*}[tcl::tm::list]
tcl::tm::add {*}[lreverse %tmlist%]
#puts "code interp chan names-->[chan names]"
namespace eval ::codeinterp {
variable errstack {}
variable outstack {}
variable run_command_cache
}
code alias detok ::safe::DetokPath code ;#temp - this violates the point of the {$p(:X:)} paths
# -- ---
#review
#we have to blow some time on a rescan to provide more deterministic ordering (match behaviour of initial thread regarding pkg precedence)
#review - can we speed that scan up?
##catch {package require flobrudder-nonexistant}
# -- ---
#review - exit should do something slightly different
# see ::safe::interpDelete
code alias exit ::repl::interphelpers::quit
if {[catch {
package require vfs
package require vfs::zip
} errM]} {
puts stderr "repl code interp can't load vfs,vfs::zip"
}
code alias ::md5::md5 ::repl::interphelpers::md5
code alias ::fconfigure ::fconfigure ;#needed for shellfilter
code alias ::file ::file
interp eval code [list package provide md5 $md5version]
} else {
interp create code
interp eval code {
#safe !=1 and safe !=2, tmlist: %tmlist%
set ::argv0 %argv0%
set ::argv %argv%
set ::argc %argc%
set ::auto_path %autopath%
tcl::tm::remove {*}[tcl::tm::list]
tcl::tm::add {*}[lreverse %tmlist%]
#puts "code interp chan names-->[chan names]"
namespace eval ::codeinterp {
variable errstack {}
variable outstack {}
variable run_command_cache
#puts stderr -----
#puts stderr [join $::auto_path \n]
#puts stderr -----
if {[catch {
package require punk::config
package require punk::ns
#puts stderr "loading natsort"
#natsort has 'application mode' which can exit.
#Requiring it shouldn't trigger application - but zipfs/vfs interactions confused it in some early versions
package require natsort
#catch {package require packageTrace}
package require punk
package require punk::args
package require punk::args::tclcore
package require shellrun
package require shellfilter
#set running_config $::punk::config::running
apply {running_config {
if {[string length [dict get $running_config color_stderr]] && [punk::console::colour]} {
lappend ::codeinterp::errstack [shellfilter::stack::add stderr ansiwrap -settings [list -colour [dict get $running_config color_stderr]]]
}
if {[string length [dict get $running_config color_stdout]] && [punk::console::colour]} {
lappend ::codeinterp::outstack [shellfilter::stack::add stdout ansiwrap -settings [list -colour [dict get $running_config color_stdout]]]
}
}} $::punk::config::running
package require textblock
} errM]} {
puts stderr "========================"
puts stderr "code interp error:"
puts stderr $errM
puts stderr $::errorInfo
puts stderr "========================"
error "$errM"
}
}
}
punksafe {
package require punk::safe
punk::safe::interpCreate code -autoPath %auto_path%
interp eval code {
set ::argv0 %argv0%
set ::argc 0
set ::argv {}
tcl::tm::remove {*}[tcl::tm::list]
tcl::tm::add {*}[lreverse %tmlist%]
namespace eval ::codeinterp {
variable errstack {}
variable outstack {}
variable run_command_cache
}
}
if {"stdout" in [chan names]} {
interp share {} stdout code
} else {
interp share {} [shellfilter::stack::item_tophandle stdout] code
}
if {"stderr" in [chan names]} {
interp share {} stderr code
} else {
interp share {} [shellfilter::stack::item_tophandle stderr] code
}
# -- ---
#review
#we have to blow some time on a rescan to provide more deterministic ordering (match behaviour of initial thread regarding pkg precedence)
#review - can we speed that scan up?
##catch {package require flobrudder-nonexistant}
# -- ---
if {[catch {
package require vfs
package require vfs::zip
} errM]} {
puts stderr "repl code interp can't load vfs,vfs::zip"
interp eval code {
package require punk::lib
package require textblock ;#may fail to load term::ansi::code::macros - (only required for altg)
}
#puts stderr -----
#puts stderr [join $::auto_path \n]
#puts stderr -----
if {[catch {
package require punk::config
package require punk::ns
#puts stderr "loading natsort"
#natsort has 'application mode' which can exit.
#Requiring it shouldn't trigger application - but zipfs/vfs interactions confused it in some early versions
package require natsort
#catch {package require packageTrace}
package require punk
package require shellrun
package require shellfilter
#set running_config $::punk::config::running
#if {[string length [dict get $running_config color_stderr]] && [punk::console::colour]} {
# lappend ::codeinterp::errstack [shellfilter::stack::add stderr ansiwrap -settings [list -colour [dict get $running_config color_stderr]]]
#}
#if {[string length [dict get $running_config color_stdout]] && [punk::console::colour]} {
# lappend ::codeinterp::outstack [shellfilter::stack::add stdout ansiwrap -settings [list -colour [dict get $running_config color_stdout]]]
#}
apply {running_config {
if {[string length [dict get $running_config color_stderr]] && [punk::console::colour]} {
lappend ::codeinterp::errstack [shellfilter::stack::add stderr ansiwrap -settings [list -colour [dict get $running_config color_stderr]]]
}
if {[string length [dict get $running_config color_stdout]] && [punk::console::colour]} {
lappend ::codeinterp::outstack [shellfilter::stack::add stdout ansiwrap -settings [list -colour [dict get $running_config color_stdout]]]
interp eval code {
if {[catch {
catch {
package require packagetrace
packagetrace::init
}
package require punk::config
package require punk::ns
#puts stderr "loading natsort"
#natsort has 'application mode' which can exit.
#Requiring it shouldn't trigger application - but zipfs/vfs interactions confused it in some early versions
package require natsort
package require punk
package require punk::args
package require punk::args::tclcore
package require shellrun
package require shellfilter
#set running_config $::punk::config::running
apply {running_config {
if {[string length [dict get $running_config color_stderr]] && [punk::console::colour]} {
lappend ::codeinterp::errstack [shellfilter::stack::add stderr ansiwrap -settings [list -colour [dict get $running_config color_stderr]]]
}
if {[string length [dict get $running_config color_stdout]] && [punk::console::colour]} {
lappend ::codeinterp::outstack [shellfilter::stack::add stdout ansiwrap -settings [list -colour [dict get $running_config color_stdout]]]
}
}} $::punk::config::running
package require textblock
} errM]} {
puts stderr "========================"
puts stderr "code interp error:"
puts stderr $errM
puts stderr $::errorInfo
puts stderr "========================"
error "$errM"
}
}} $::punk::config::running
package require textblock
} errM]} {
puts stderr "========================"
puts stderr "code interp error:"
puts stderr $errM
puts stderr $::errorInfo
puts stderr "========================"
error "$errM"
}
}
default {
}
}
code alias repl ::repl::interphelpers::repl_ensemble
@ -3006,6 +3090,10 @@ namespace eval repl {
#temporary debug aliases - deliberate violation of safety provided by safe interp
code alias escapeeval ::repl::interphelpers::escapeeval
#experiment
#code alias ::shellfilter::stack ::shellfilter::stack
#puts stderr "returning threadid"
#puts stderr [thread::id]

23
src/modules/punk/repl/codethread-999999.0a1.0.tm

@ -166,15 +166,15 @@ tcl::namespace::eval punk::repl::codethread {
set errstack [list]
upvar ::punk::config::running running_config
if {[string length [dict get $running_config color_stdout_repl]] && [interp eval code punk::console::colour]} {
lappend outstack [interp eval code [list shellfilter::stack::add stdout ansiwrap -settings [list -colour [dict get $running_config color_stdout_repl]]]]
lappend outstack [interp eval code [list ::shellfilter::stack add stdout ansiwrap -settings [list -colour [dict get $running_config color_stdout_repl]]]]
}
lappend outstack [interp eval code [list shellfilter::stack::add stdout tee_to_var -settings {-varname ::punk::repl::codethread::output_stdout}]]
lappend outstack [interp eval code [list ::shellfilter::stack add stdout tee_to_var -settings {-varname ::punk::repl::codethread::output_stdout}]]
if {[string length [dict get $running_config color_stderr_repl]] && [interp eval code punk::console::colour]} {
lappend errstack [interp eval code [list shellfilter::stack::add stderr ansiwrap -settings [list -colour [dict get $running_config color_stderr_repl]]]]
lappend errstack [interp eval code [list ::shellfilter::stack add stderr ansiwrap -settings [list -colour [dict get $running_config color_stderr_repl]]]]
# #lappend errstack [shellfilter::stack::add stderr ansiwrap -settings [list -colour cyan]]
}
lappend errstack [interp eval code [list shellfilter::stack::add stderr tee_to_var -settings {-varname ::punk::repl::codethread::output_stderr}]]
lappend errstack [interp eval code [list ::shellfilter::stack add stderr tee_to_var -settings {-varname ::punk::repl::codethread::output_stderr}]]
#an experiment
#set errhandle [shellfilter::stack::item_tophandle stderr]
@ -190,7 +190,16 @@ tcl::namespace::eval punk::repl::codethread {
if {[llength $::codeinterp::run_command_cache] > 2000} {
set ::codeinterp::run_command_cache [lrange $::codeinterp::run_command_cache 1750 end][unset ::codeinterp::run_command_cache]
}
tcl::namespace::inscope $::punk::ns::ns_current $::codeinterp::clonescript
if {[string first ":::" $::punk::ns::ns_current]} {
#support for browsing 'odd' (inadvisable) namespaces
#don't use 'namespace exists' - will conflate ::test::x with ::test:::x
#if {$::punk::ns::ns_current in [namespace children [punk::ns::nsprefix $::punk::ns::ns_current]} {
#}
package require punk::ns
punk::ns::nseval_ifexists $::punk::ns::ns_current $::codeinterp::clonescript
} else {
tcl::namespace::inscope $::punk::ns::ns_current $::codeinterp::clonescript
}
}
} result]
@ -221,10 +230,10 @@ tcl::namespace::eval punk::repl::codethread {
#only remove from shellfilter::stack the items we added to stack in this function
foreach s [lreverse $outstack] {
interp eval code [list shellfilter::stack::remove stdout $s]
interp eval code [list ::shellfilter::stack remove stdout $s]
}
foreach s [lreverse $errstack] {
interp eval code [list shellfilter::stack::remove stderr $s]
interp eval code [list ::shellfilter::stack remove stderr $s]
}
thread::cond notify $replthread_cond
}

116
src/modules/punk/safe-999999.0a1.0.tm

@ -396,7 +396,7 @@ tcl::namespace::eval punk::safe {
punk::safe::lib::RejectExcessColons $child
set withAutoPath [dict exists $argd received -autoPath]
do_interpInit $child\
punk::safe::system::do_interpInit $child\
[dict get $argd opts -accessPath]\
[InterpStatics $argd]\
[InterpNested $argd]\
@ -436,6 +436,7 @@ tcl::namespace::eval punk::safe {
# the current configuration. We still call OptKeyParse though
# we know that "child" is our given argument because it also
# checks for the "-help" option.
#TODO!
set argd [punk::args::get_by_id punk::safe::interpIC $args]
set child [dict get $argd leaders child]
@ -499,7 +500,8 @@ tcl::namespace::eval punk::safe {
use -nested instead"
}
default {
return -code error "unknown flag $name. Known options: $opt_names"
#return -code error "unknown flag $name. Known options: $opt_names"
punk::args::get_by_id punk::safe::interpIC [list $child $arg]
}
}
}
@ -585,6 +587,109 @@ tcl::namespace::eval punk::safe {
}
}
#
#
# interpFindInAccessPath:
# Search for a real directory and returns its virtual Id (including the
# "$")
#
# When debugging, use TranslatePath for the inverse operation.
proc interpFindInAccessPath {child path} {
CheckInterp $child
namespace upvar ::punk::safe::system [VarName $child] state
if {![dict exists $state(access_path,remap) $path]} {
return -code error "$path not found in access path"
}
return [dict get $state(access_path,remap) $path]
}
#
# addToAccessPath:
# add (if needed) a real directory to access path and return its
# virtual token (including the "$").
proc interpAddToAccessPath {child path} {
# first check if the directory is already in there
# (inlined interpFindInAccessPath).
CheckInterp $child
namespace upvar ::punk::safe::system [VarName $child] state
if {[dict exists $state(access_path,remap) $path]} {
return [dict get $state(access_path,remap) $path]
}
# new one, add it:
set token [PathToken [llength $state(access_path)]]
lappend state(access_path) $path
lappend state(access_path,child) $token
lappend state(access_path,map) $token $path
lappend state(access_path,remap) $path $token
lappend state(access_path,norm) [file normalize $path]
SyncAccessPath $child
return $token
}
# This procedure deletes a safe interpreter managed by Safe Tcl and cleans up
# associated state.
# - The command will also delete non-Safe-Base interpreters.
# - This is regrettable, but to avoid breaking existing code this should be
# amended at the next major revision by uncommenting "CheckInterp".
proc interpDelete {child} {
Log $child "About to delete" NOTICE
# CheckInterp $child
namespace upvar ::punk::safe::system [VarName $child] state
# When an interpreter is deleted with [interp delete], any sub-interpreters
# are deleted automatically, but this leaves behind their data in the Safe
# Base. To clean up properly, we call safe::interpDelete recursively on each
# Safe Base sub-interpreter, so each one is deleted cleanly and not by
# the automatic mechanism built into [interp delete].
foreach sub [interp children $child] {
if {[info exists ::punk::safe::system::[VarName [list $child $sub]]]} {
::punk::safe::interpDelete [list $child $sub]
}
}
# If the child has a cleanup hook registered, call it. Check the
# existence because we might be called to delete an interp which has
# not been registered with us at all
if {[info exists state(cleanupHook)]} {
set hook $state(cleanupHook)
if {[llength $hook]} {
# remove the hook now, otherwise if the hook calls us somehow,
# we'll loop
unset state(cleanupHook)
try {
{*}$hook $child
} on error err {
Log $child "Delete hook error ($err)"
}
}
}
# Discard the global array of state associated with the child, and
# delete the interpreter.
if {[info exists state]} {
unset state
}
# if we have been called twice, the interp might have been deleted
# already
if {[::interp exists $child]} {
::interp delete $child
Log $child "Deleted" NOTICE
}
return
}
#*** !doctools
#[list_end] [comment {--- end definitions namespace punk::safe ---}]
}
@ -661,8 +766,11 @@ tcl::namespace::eval punk::safe::system {
set INTERPCREATE {
*id punk::safe::interpCreate
*proc -name punk::safe::interpCreate -help\
"Create a safe interpreter with punk::safe specific aliases
Returns the interpreter name"
*leaders
child -type string -default "" -optional 1 -help\
child -type string -default "" -regexprefail "^-" -regexprefailmsg "" -optional 1 -help\
"name of the child (optional)"
}
append INTERPCREATE \n $optlines
@ -673,7 +781,7 @@ tcl::namespace::eval punk::safe::system {
set INTERPIC {
*id punk::safe::interpIC
*leaders
child -type string -optional 0 -help\
child -type string -optional 0 -regexprefail "^-" -regexprefailmsg "" -help\
"name of the child"
}
append INTERPIC \n $optlines

2
src/modules/punk/sixel-999999.0a1.0.tm

@ -143,6 +143,8 @@ tcl::namespace::eval punk::sixel {
#TODO - sixel row/col info is dependent on terminal - pass in -terminalobject or -inoutchannels (for use with punk::console::cell_size)
punk::args::definition {
*id punk::sixel::get_info
*proc -name punk::sixel::get_info -help\
"return a dict of information about the supplied sixelstring"
-cache -default 1 -type boolean -help\
"Cached result based on sha1 hash."
-cell_size -default "" -help\

4
src/modules/shellfilter-0.1.9.tm

@ -1086,7 +1086,9 @@ namespace eval shellfilter::chan {
## note - whether stack is for input or output we maintain it in the same direction - which is in sync with the tcl chan pop chan push concept.
##
namespace eval shellfilter::stack {
#todo - implement as oo
namespace export {[a-z]*}
namespace ensemble create
#todo - implement as oo ?
variable pipelines [list]
proc items {} {

507
src/modules/textblock-999999.0a1.0.tm

@ -92,29 +92,51 @@ tcl::namespace::eval textblock {
#NOTE sha1, although computationally more intensive, tends to be faster than md5 on modern cpus
#(more likely to be optimised for modern cpu features?)
variable use_md5 ;#framecache
set use_md5 1
if {[catch {package require md5}]} {
set use_md5 0
}
#todo - change use_md5 to more generic use_checksum_algorithm function.
# e.g allow md5, sha1, none, etc.
# - perhaps autodetect 32bit vs 64bit (or processortype?) to select a default (also depending on packages available and accelerator presence)
proc use_md5 {{yes_no ""}} {
variable use_md5
if {$yes_no eq ""} {
return $use_md5
}
if {![string is boolean -strict $yes_no]} {
error "textblock::use_md5 requires a boolean (or empty string to query)"
}
if {$yes_no} {
package require md5
set use_md5 1
#(This speed improvement may not apply for short strings)
variable use_hash ;#framecache
set use_hash none ;#slightly faster but uglier layout for viewing frame_cache display
#if {![catch {package require sha1}]} {
# set use_hash sha1
#} elseif {![catch {package require md5}]} {
# set use_hash md5
#} else {
# set use_hash none
#}
proc use_hash {args} {
set choices [list none]
set unavailable [list]
set pkgs [package names]
if {"md5" in $pkgs} {
lappend choices md5
} else {
set use_md5 0
lappend unavailable md5
}
return $use_md5
if {"sha1" in $pkgs} {
lappend choices sha1
} else {
lappend unavailable sha1
}
set choicemsg ""
if {[llength $unavailable]} {
set choicemsg " (unavailable packages: $unavailable)"
}
set argd [punk::args::get_dict [tstr -return string {
*id textblock::use_hash
*proc -name "textblock::use_hash" -help\
"Hashing algorithm to use for framecache lookup.
'none' may be slightly faster but less compact
when viewing textblock::framecache"
*values -min 0 -max 1
hash_algorithm -choices {${$choices}} -optional 1 -help\
"algorithm choice ${$choicemsg}"
}] $args]
variable use_hash
if {![dict exists $argd received hash_algorithm]} {
return $use_hash
}
set use_hash [dict get $argd values hash_algorithm]
}
tcl::namespace::eval class {
variable opts_table_defaults
@ -3997,12 +4019,8 @@ tcl::namespace::eval textblock {
return $t
}
proc periodic {args} {
#For an impressive interactive terminal app (javascript)
# see: https://github.com/spirometaxas/periodic-table-cli
set opts [dict get [punk::args::get_dict {
punk::args::definition {
*id textblock::periodic
*proc -name textblock::periodic -help "A rudimentary periodic table
This is primarily a test of textblock::class::table"
@ -4016,8 +4034,12 @@ tcl::namespace::eval textblock {
-show_edge -default "" -type boolean
-forcecolour -default 0 -type boolean -help "If punk::colour is off - this enables the produced table to still be ansi coloured"
*values -min 0 -max 0
} $args] opts]
}
proc periodic {args} {
#For an impressive interactive terminal app (javascript)
# see: https://github.com/spirometaxas/periodic-table-cli
set opts [dict get [punk::args::get_by_id textblock::periodic $args] opts]
set opt_return [tcl::dict::get $opts -return]
if {[tcl::dict::get $opts -forcecolour]} {
set fc forcecolour
@ -4156,15 +4178,16 @@ tcl::namespace::eval textblock {
dict set conf $k [dict get $opts $k]
}
}
$t configure {*}[dict get $conf]
$t configure \
-frametype_header light\
-ansiborder_header [a+ {*}$fc brightwhite]\
-ansibase_header [a+ {*}$fc Black]\
-ansibase_body [a+ {*}$fc Black]\
-ansiborder_body [a+ {*}$fc black]\
-frametype block
set moreopts [dict create\
-frametype_header light\
-ansiborder_header [a+ {*}$fc brightwhite]\
-ansibase_header [a+ {*}$fc Black]\
-ansibase_body [a+ {*}$fc Black]\
-ansiborder_body [a+ {*}$fc black]\
-frametype block
]
$t configure {*}[dict merge $conf $moreopts]
#-ansiborder_header [a+ {*}$fc web-white]\
@ -4204,9 +4227,9 @@ tcl::namespace::eval textblock {
-header -default "" -type list -multiple 1\
-help "Each supplied -header argument is a header row.
The number of values for each must be <= number of columns"
-show_header -default ""\
-show_header -type boolean\
-help "Whether to show a header row.
Leave as empty string for unspecified/automatic,
Omit for unspecified/automatic,
in which case it will display only if -headers list was supplied."
-action -default "append" -choices {append replace}\
-help "row insertion method if existing -table is supplied
@ -4294,13 +4317,13 @@ tcl::namespace::eval textblock {
if {[llength $colheaders] > 0} {
if {[tcl::dict::get $opts -show_header] eq ""} {
if {![tcl::dict::exists $opts received -show_header]} {
set show_header 1
} else {
set show_header [tcl::dict::get $opts -show_header]
}
} else {
if {[tcl::dict::get $opts -show_header] eq ""} {
if {![tcl::dict::exists $opts received -show_header]} {
set show_header 0
} else {
set show_header [tcl::dict::get $opts -show_header]
@ -4529,7 +4552,7 @@ tcl::namespace::eval textblock {
}
set textblock [textutil::tabify::untabify2 $textblock $tw]
}
if {[punk::ansi::ta::detect $textblock]} {
if {[string length $textblock] > 1 && [punk::ansi::ta::detect $textblock]} {
#ansistripraw slightly faster than ansistrip - and won't affect width (avoid detect_g0/conversions)
set textblock [punk::ansi::ansistripraw $textblock]
}
@ -4553,7 +4576,7 @@ tcl::namespace::eval textblock {
}
set textblock [textutil::tabify::untabify2 $textblock $tw]
}
if {[punk::ansi::ta::detect $textblock]} {
if {[string length $textblock] > 1 && [punk::ansi::ta::detect $textblock]} {
#ansistripraw slightly faster than ansistrip - and won't affect width (avoid detect_g0/conversions)
set textblock [punk::ansi::ansistripraw $textblock]
}
@ -4614,7 +4637,7 @@ tcl::namespace::eval textblock {
set textblock [textutil::tabify::untabify2 $textblock $tw]
}
#ansistripraw on entire block in one go rather than line by line - result should be the same - review - make tests
if {[punk::ansi::ta::detect $textblock]} {
if {[string length $textblock] > 1 && [punk::ansi::ta::detect $textblock]} {
set textblock [punk::ansi::ansistripraw $textblock]
}
if {[tcl::string::last \n $textblock] >= 0} {
@ -7226,12 +7249,19 @@ tcl::namespace::eval textblock {
variable frame_cache
set frame_cache [tcl::dict::create]
punk::args::definition {
*id textblock::frame_cache
*proc -name textblock::frame_cache -help\
"Display or clear the frame cache."
-action -default {} -choices {clear} -help\
"Clear the textblock::frame_cache dictionary"
-pretty -default 1 -help\
"Use 'pdict textblock::frame_cache */*' for prettier output"
*values -min 0 -max 0
}
proc frame_cache {args} {
set argd [punk::args::get_dict {
-action -default {} -choices {clear} -help "Clear the textblock::frame_cache dictionary"
-pretty -default 1 -help "Use 'pdict textblock::frame_cache */*' for prettier output"
*values -min 0 -max 0
} $args]
set argd [punk::args::get_by_id textblock::frame_cache $args]
set action [dict get $argd opts -action]
if {$action ni [list clear ""]} {
@ -7273,6 +7303,71 @@ tcl::namespace::eval textblock {
}
set FRAMETYPES [textblock::frametypes]
set EG [a+ brightblack]
set RST [a]
#todo punk::args alias for centre center etc?
punk::args::definition [punk::lib::tstr -return string {
*id textblock::frame
*proc -name "textblock::frame"\
-help "Frame a block of text with a border."
-checkargs -default 1 -type boolean\
-help "If true do extra argument checks and
provide more comprehensive error info.
Set false for slight performance improvement."
-etabs -default 0\
-help "expanding tabs - experimental/unimplemented."
-type -default light -choices {${$FRAMETYPES}} -choicerestricted 0 -type dict\
-help "Type of border for frame."
-boxlimits -default {hl vl tlc blc trc brc} -type list -help "Limit the border box to listed elements.
passing an empty string will result in no box, but title/subtitle will still appear if supplied.
${$EG}e.g: -frame -boxlimits {} -title things [a+ red White]my\\ncontent${$RST}"
-boxmap -default {} -type dict
-joins -default {} -type list
-title -default "" -type string -regexprefail {\n}\
-help "Frame title placed on topbar - no newlines.
May contain ANSI - no trailing reset required.
${$EG}e.g 1: frame -title My[a+ green]Green[a]Thing
e.g 2: frame -title [a+ red underline]MyThing${$RST}"
-subtitle -default "" -type string -regexprefail {\n}\
-help "Frame subtitle placed on bottombar - no newlines
May contain Ansi - no trailing reset required."
-width -default "" -type int\
-help "Width of resulting frame including borders.
If omitted or empty-string, the width will be determined automatically based on content."
-height -default "" -type int\
-help "Height of resulting frame including borders."
-ansiborder -default "" -type ansistring\
-help "Ansi escape sequence to set border attributes.
${$EG}e.g 1: frame -ansiborder [a+ web-red] contents
e.g 2: frame -ansiborder \"\\x1b\\\[31m\" contents${$RST}"
-ansibase -default "" -type ansistring\
-help "Default ANSI attributes within frame."
-blockalign -default centre -choices {left right centre}\
-help "Alignment of the content block within the frame."
-pad -default 1 -type boolean -help "Whether to pad within the ANSI so content background
extends within the content block inside the frame.
Has no effect if no ANSI in content."
-textalign -default left -choices {left right centre}\
-help "Alignment of text within the content block. (centre unimplemented)"
-ellipsis -default 1 -type boolean\
-help "Whether to show elipsis for truncated content and title/subtitle."
-usecache -default 1 -type boolean
-buildcache -default 1 -type boolean
-crm_mode -default 0 -type boolean\
-help "Show ANSI control characters within frame contents.
(Control Representation Mode)
Frame width doesn't adapt and content may be truncated
so -width may need to be manually set to display more."
*values -min 0 -max 1
contents -default "" -type string\
-help "Frame contents - may be a block of text containing newlines and ANSI.
Text may be 'ragged' - ie unequal line-lengths.
No trailing ANSI reset required.
${$EG}e.g: frame \"[a+ blue White] \\nMy blue foreground text on\\nwhite background\\n\"${$RST}"
}]
#options before content argument - which is allowed to be absent
#frame performance (noticeable with complex tables even of modest size) is improved somewhat by frame_cache - but is still (2024) a fairly expensive operation.
#
@ -7283,7 +7378,7 @@ tcl::namespace::eval textblock {
# - but we would need to maintain support for the rendered-string based operations too.
proc frame {args} {
variable frametypes
variable use_md5
variable use_hash
#counterintuitively - in-proc dict create each time is generally slightly faster than linked namespace var
set opts [tcl::dict::create\
@ -7311,20 +7406,19 @@ tcl::namespace::eval textblock {
# for ansi art - -pad 0 is likely to be preferable
set has_contents 0
set arglist $args
set optlist $args ;#initial only - content will be removed
#no solo opts for frame
if {[llength $args] %2 == 0} {
if {[lindex $args end-1] eq "--"} {
set contents [lpop arglist end]
set contents [lpop optlist end]
set has_contents 1
lpop arglist end ;#drop the end-of-opts flag
lpop optlist end ;#drop the end-of-opts flag
} else {
set arglist $args
set optlist $args
set contents ""
}
} else {
#set arglist [lrange $args 0 end-1]
#set contents [lindex $args end]
set contents [lpop arglist end]
set contents [lpop optlist end]
set has_contents 1
}
@ -7333,7 +7427,7 @@ tcl::namespace::eval textblock {
#use -buildcache 1 with -usecache 0 for debugging cache issues so we can inspect using textblock::frame_cache
set optnames [tcl::dict::keys $opts]
set opts_ok 1 ;#default assumption
foreach {k v} $arglist {
foreach {k v} $optlist {
set k2 [tcl::prefix::match -error "" $optnames $k]
switch -- $k2 {
-etabs - -type - -boxlimits - -boxmap - -joins
@ -7355,70 +7449,9 @@ tcl::namespace::eval textblock {
set check_args [dict get $opts -checkargs]
#only use punk::args if check_args is true or our basic checks failed
if {!$opts_ok || $check_args} {
#error "Usage frame ?-type unicode|altg|ascii|<dict hl (c) vl (c) tlc (c) trc (c) blc (c) brc (c)>? ?-title <ansitext>? ?-subtitle <ansitext>? ?-width <columns>? ?-ansiborder <ansi_sgr>? ?-boxlimits hl|hlt|hlb|vl|vll|vlr|tlc|blc|brc? ?-joins left|right|up|down? <contents>"
set FRAMETYPES [textblock::frametypes]
set EG [a+ brightblack]
set RST [a]
set argd [punk::args::get_dict [punk::lib::tstr -return string {
*proc -name "textblock::frame"\
-help "Frame a block of text with a border."
-checkargs -default 1 -type boolean\
-help "If true do extra argument checks and
provide more comprehensive error info.
Set false for slight performance improvement."
-etabs -default 0\
-help "expanding tabs - experimental/unimplemented."
-type -default light -choices {${$FRAMETYPES}} -choicerestricted 0 -type dict\
-help "Type of border for frame."
-boxlimits -default {hl vl tlc blc trc brc} -type list -help "Limit the border box to listed elements.
passing an empty string will result in no box, but title/subtitle will still appear if supplied.
${$EG}e.g: -frame -boxlimits {} -title things [a+ red White]my\\ncontent${$RST}"
-boxmap -default {} -type dict
-joins -default {} -type list
-title -default "" -type string -regexprefail {\n}\
-help "Frame title placed on topbar - no newlines.
May contain ANSI - no trailing reset required.
${$EG}e.g 1: frame -title My[a+ green]Green[a]Thing
e.g 2: frame -title [a+ red underline]MyThing${$RST}"
-subtitle -default "" -type string -regexprefail {\n}\
-help "Frame subtitle placed on bottombar - no newlines
May contain Ansi - no trailing reset required."
-width -default "" -type int\
-help "Width of resulting frame including borders.
If omitted or empty-string, the width will be determined automatically based on content."
-height -default "" -type int\
-help "Height of resulting frame including borders."
-ansiborder -default "" -type ansistring\
-help "Ansi escape sequence to set border attributes.
${$EG}e.g 1: frame -ansiborder [a+ web-red] contents
e.g 2: frame -ansiborder \"\\x1b\\\[31m\" contents${$RST}"
-ansibase -default "" -type ansistring\
-help "Default ANSI attributes within frame."
-blockalign -default centre -choices {left right centre}\
-help "Alignment of the content block within the frame."
-pad -default 1 -type boolean -help "Whether to pad within the ANSI so content background
extends within the content block inside the frame.
Has no effect if no ANSI in content."
-textalign -default left -choices {left right centre}\
-help "Alignment of text within the content block. (centre unimplemented)"
-ellipsis -default 1 -type boolean\
-help "Whether to show elipsis for truncated content and title/subtitle."
-usecache -default 1 -type boolean
-buildcache -default 1 -type boolean
-crm_mode -default 0 -type boolean\
-help "Show ANSI control characters within frame contents.
(Control Representation Mode)
Frame width doesn't adapt and content may be truncated
so -width may need to be manually set to display more."
*values -min 0 -max 1
contents -default "" -type string\
-help "Frame contents - may be a block of text containing newlines and ANSI.
Text may be 'ragged' - ie unequal line-lengths.
No trailing ANSI reset required.
${$EG}e.g: frame \"[a+ blue White] \\nMy blue foreground text on\\nwhite background\\n\"${$RST}"
}] $args]
#never need to checkargs if only one argument supplied even if it looks like an option - as it will be treated as data to frame
if {[llength $args] != 1 && (!$opts_ok || $check_args)} {
set argd [punk::args::get_by_id textblock::frame $args]
set opts [dict get $argd opts]
set contents [dict get $argd values contents]
}
@ -7446,7 +7479,10 @@ tcl::namespace::eval textblock {
set opt_ansiborder [tcl::dict::get $opts -ansiborder]
set opt_ansibase [tcl::dict::get $opts -ansibase] ;#experimental
set opt_ellipsis [tcl::dict::get $opts -ellipsis]
set opt_blockalign [tcl::dict::get $opts -blockalign]
set opt_textalign [tcl::dict::get $opts -textalign]
set custom_keys [list hl hlt hlb vl vll vlr tlc trc blc brc]
set known_frametypes $frametypes ;# light, heavey etc as defined in the ::textblock::frametypes variable
@ -7463,107 +7499,26 @@ tcl::namespace::eval textblock {
set framedef $ftype
}
set is_boxlimits_ok 1
set exact_boxlimits [list]
foreach v $opt_boxlimits {
switch -- $v {
hl {
lappend exact_boxlimits hlt hlb
}
vl {
lappend exact_boxlimits vll vlr
}
hlt - hlb - vll - vlr - tlc - trc - blc - brc {
lappend exact_boxlimits $v
}
default {
#k not in custom_keys
set is_boxlimits_ok 0
break
}
}
}
#review vllj etc?
if {!$is_boxlimits_ok} {
error "frame option -boxlimits '$opt_boxlimits' must contain only values from the set: hl,hlt,hlb,vl,vll,vlr,tlc,trc,blc,brc"
}
set exact_boxlimits [lsort -unique $exact_boxlimits]
#if check_args?
set is_joins_ok 1
foreach v $opt_joins {
lassign [split $v -] direction target
switch -- $direction {
left - right - up - down {}
default {
set is_joins_ok 0
break
}
}
switch -- $target {
"" - light - light_b - light_c - heavy - heavy_b - heavy_c - ascii - altg - arc - arc_b - arc_c - double - custom - block - block1 - block2 {}
default {
set is_joins_ok 0
break
}
}
}
if {!$is_joins_ok} {
error "frame option -joins '$opt_joins' must contain only values from the set: left,right,up,down with targets heavy,light,ascii,altg,arc,double,block,block1,custom e.g down-light"
}
set is_boxmap_ok 1
tcl::dict::for {boxelement subst} $opt_boxmap {
switch -- $boxelement {
hl - hlt - hlb - vl - vll - vlr - tlc - trc - blc - brc {}
hltj - hlbj - vllj - vlrj {}
default {
set is_boxmap_ok 0
break
}
}
}
if {!$is_boxmap_ok} {
error "frame option -boxmap '$opt_boxmap' must contain only keys from the set: hl,hlt,hlb,vl,vll,vlr,tlc,trc,blc,brc,hltj,hlbj,vllj,vlrj"
}
#sorted order down left right up
#1 x choose 4
#4 x choose 3
#6 x choose 2
#4 x choose 1
#15 combos
set join_directions [list]
#targets - light,heavy (double?) - seem to be some required glyphs missing from unicode
#e.g down-light, up-heavy
set join_targets [tcl::dict::create left "" down "" right "" up ""]
foreach jt $opt_joins {
lassign [split $jt -] direction target
if {$target ne ""} {
tcl::dict::set join_targets $direction $target
}
lappend join_directions $direction
}
set join_directions [lsort -unique $join_directions]
set do_joins [::join $join_directions _]
#REVIEW - now done in framedef?
#set join_directions [list]
##targets - light,heavy (double?) - seem to be some required glyphs missing from unicode
##e.g down-light, up-heavy
#set join_targets [tcl::dict::create left "" down "" right "" up ""]
#foreach jt $opt_joins {
# lassign [split $jt -] direction target
# if {$target ne ""} {
# tcl::dict::set join_targets $direction $target
# }
# lappend join_directions $direction
#}
#set join_directions [lsort -unique $join_directions]
#set do_joins [::join $join_directions _]
#JMN
switch -- $opt_blockalign {
left - right - centre - center {}
default {
error "frame option -blockalign must be left|right|centre|center - received: $opt_blockalign"
}
}
#these are all valid commands for overtype::<cmd>
# -- --- --- --- --- ---
set opt_textalign [tcl::dict::get $opts -textalign]
switch -- $opt_textalign {
left - right - centre - center {}
default {
error "frame option -textalign must be left|right|centre|center - received: $opt_textalign"
}
}
# -- --- --- --- --- ---
@ -7634,20 +7589,28 @@ tcl::namespace::eval textblock {
# -- --- --- --- --- --- --- --- ---
variable frame_cache
#review - custom frame affects frame_inner_width - exclude from caching?
#set cache_key [concat $arglist $frame_inner_width $frame_inner_height]
#set cache_key [concat $optlist $frame_inner_width $frame_inner_height]
#jmn
#set hashables [concat $arglist $frame_inner_width $frame_inner_height]
set hashables [list {*}$arglist $frame_inner_width $frame_inner_height]
#set hashables [concat $optlist $frame_inner_width $frame_inner_height]
set hashables [list {*}$optlist $frame_inner_width $frame_inner_height]
if {$use_md5} {
#package require md5 ;#already required at package load
if {[package vsatisfies [package present md5] 2- ] } {
set hash [md5::md5 -hex [encoding convertto utf-8 $hashables]] ;#need fast and unique to content - not cryptographic - review
} else {
set hash [md5::md5 [encoding convertto utf-8 $hashables]]
switch -- $use_hash {
sha1 {
package require sha1
set hash [sha1::sha1 [encoding convertto utf-8 $hashables]]
}
md5 {
package require md5
if {[package vsatisfies [package present md5] 2- ] } {
set hash [md5::md5 -hex [encoding convertto utf-8 $hashables]] ;#need fast and unique to content - not cryptographic - review
} else {
set hash [md5::md5 [encoding convertto utf-8 $hashables]]
}
}
none {
set hash $hashables
}
} else {
set hash $hashables
}
set cache_key "$hash-$frame_inner_width-$frame_inner_height-actualcontentwidth:$actual_contentwidth"
@ -7709,11 +7672,94 @@ tcl::namespace::eval textblock {
set used [tcl::dict::get $frame_cache $cache_key used]
tcl::dict::set frame_cache $cache_key used [expr {$used+1}] ;#update existing record
set is_cached 1
}
# -- --- --- --- --- --- --- --- ---
if {!$is_cached} {
# -- --- --- --- ---
# -- --- --- --- ---
set is_joins_ok 1
foreach v $opt_joins {
lassign [split $v -] direction target
switch -- $direction {
left - right - up - down {}
default {
set is_joins_ok 0
break
}
}
switch -- $target {
"" - light - light_b - light_c - heavy - heavy_b - heavy_c - ascii - altg - arc - arc_b - arc_c - double - custom - block - block1 - block2 {}
default {
set is_joins_ok 0
break
}
}
}
if {!$is_joins_ok} {
error "frame option -joins '$opt_joins' must contain only values from the set: left,right,up,down with targets heavy,light,ascii,altg,arc,double,block,block1,custom e.g down-light"
}
# -- --- --- --- --- ---
set is_boxmap_ok 1
tcl::dict::for {boxelement subst} $opt_boxmap {
switch -- $boxelement {
hl - hlt - hlb - vl - vll - vlr - tlc - trc - blc - brc {}
hltj - hlbj - vllj - vlrj {}
default {
set is_boxmap_ok 0
break
}
}
}
if {!$is_boxmap_ok} {
error "frame option -boxmap '$opt_boxmap' must contain only keys from the set: hl,hlt,hlb,vl,vll,vlr,tlc,trc,blc,brc,hltj,hlbj,vllj,vlrj"
}
# -- --- --- --- --- ---
#these are all valid commands for overtype::<cmd>
switch -- $opt_textalign {
left - right - centre - center {}
default {
error "frame option -textalign must be left|right|centre|center - received: $opt_textalign"
}
}
# -- --- --- --- --- ---
switch -- $opt_blockalign {
left - right - centre - center {}
default {
error "frame option -blockalign must be left|right|centre|center - received: $opt_blockalign"
}
}
# -- --- --- --- ---
# -- --- --- --- ---
set is_boxlimits_ok 1
set exact_boxlimits [list]
foreach v $opt_boxlimits {
switch -- $v {
hl {
lappend exact_boxlimits hlt hlb
}
vl {
lappend exact_boxlimits vll vlr
}
hlt - hlb - vll - vlr - tlc - trc - blc - brc {
lappend exact_boxlimits $v
}
default {
#k not in custom_keys
set is_boxlimits_ok 0
break
}
}
}
#review vllj etc?
if {!$is_boxlimits_ok} {
error "frame option -boxlimits '$opt_boxlimits' must contain only values from the set: hl,hlt,hlb,vl,vll,vlr,tlc,trc,blc,brc"
}
set exact_boxlimits [lsort -unique $exact_boxlimits]
# -- --- --- --- --- ---
set rst [a]
#set column [tcl::string::repeat " " $frame_inner_width] ;#default - may need to override for custom frame
set underlayline [tcl::string::repeat " " $frame_inner_width]
@ -8038,6 +8084,9 @@ tcl::namespace::eval textblock {
;#end !$is_cached
}
#use the same mechanism to build the final frame - whether from cache or template
if {$actual_contentwidth == 0} {
set fs [tcl::string::map [list $FSUB " "] $template]

76
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk-0.1.tm

@ -9,7 +9,7 @@ namespace eval punk {
zzzload::pkg_require $pkg
}
}
#lazyload twapi
#lazyload twapi ?
catch {package require vfs} ;#attempt load now so we can use faster 'package provide' to test existence later
}
@ -3670,7 +3670,7 @@ namespace eval punk {
incr i
}
#JMN2
#JMN2 - review
#set returnval [lindex $assigned_values 0]
if {[llength $assigned_values] == 1} {
set returnval [join $assigned_values]
@ -7271,55 +7271,59 @@ namespace eval punk {
catch {
package require patternpunk
#lappend chunks [list stderr [>punk . rhs]]
append mascotblock [textblock::frame [>punk . banner -title "Punk Shell" -left Tcl -right [package provide Tcl]]]
append mascotblock [textblock::frame -checkargs 0 [>punk . banner -title "Punk Shell" -left Tcl -right [package provide Tcl]]]
}
set topic [lindex $args end]
set argopts [lrange $args 0 end-1]
set text ""
append text "Punk core navigation commands:\n"
set title "[a+ brightgreen] Punk core navigation commands: "
#todo - load from source code annotation?
set cmdinfo [list]
lappend cmdinfo [list help "This help. To see available subitems type: help topics"]
lappend cmdinfo [list dev "(ensemble command to make new projects/modules and to generate docs)"]
lappend cmdinfo [list a? "view ANSI colours\n e.g a? web"]
lappend cmdinfo [list ./ "view/change directory"]
lappend cmdinfo [list ../ "go up one directory"]
lappend cmdinfo [list ./new "make new directory and switch to it"]
lappend cmdinfo [list n/ "view/change namespace (accepts ns path globs e.g **::*get* to match comands at any level )"]
lappend cmdinfo [list n// "view/change namespace (with command listing)"]
lappend cmdinfo [list nn/ "go up one namespace"]
lappend cmdinfo [list n/new "make child namespace and switch to it"]
set cmds [lsearch -all -inline -index 0 -subindices $cmdinfo *]
set descr [lsearch -all -inline -index 1 -subindices $cmdinfo *]
set widest1 [tcl::mathfunc::max {*}[lmap v $cmds {string length $v}]]
set widest2 [tcl::mathfunc::max {*}[lmap v $descr {string length $v}]]
lappend cmdinfo [list help "?topics?" "This help. To see available subitems type: help topics"]
lappend cmdinfo [list i "cmd ?subcommand...?" "Show usage for a command or ensemble subcommand"]
lappend cmdinfo [list ./ "?subdir?" "view/change directory"]
lappend cmdinfo [list ../ "" "go up one directory"]
lappend cmdinfo [list ./new "subdir" "make new directory and switch to it"]
lappend cmdinfo [list n/ "?glob...?" "view/change namespace\n (accepts ns path globs e.g **::*get* to match comands at any level )"]
lappend cmdinfo [list n// "" "view/change namespace (with command listing)"]
lappend cmdinfo [list "nn/" "" "go up one namespace"]
lappend cmdinfo [list "n/new" "<ns>" "make child namespace and switch to it"]
lappend cmdinfo [list dev "?subcommand?" "(ensemble command to make new projects/modules and to generate docs)"]
lappend cmdinfo [list a? "?subcommand...?" "view ANSI colours\n e.g a? web"]
#set cmds [lsearch -all -inline -index 0 -subindices $cmdinfo *]
#set descr [lsearch -all -inline -index 1 -subindices $cmdinfo *]
#set widest1 [tcl::mathfunc::max {*}[lmap v $cmds {string length $v}]]
#set widest2 [tcl::mathfunc::max {*}[lmap v $descr {string length $v}]]
set t [textblock::class::table new -show_seps 0]
foreach c $cmds d $descr {
#append text " [overtype::left $col1 $c][overtype::left $col2 $d]" \n
$t add_row [list $c $d]
}
set widest1 [$t column_datawidth 0]
$t configure_column 0 -minwidth [expr {$widest1 + 2}]
set widest2 [$t column_datawidth 1]
$t configure_column 1 -minwidth [expr {$widest2 + 1}]
#foreach c $cmds d $descr {
# $t add_row [list $c $d]
#}
foreach row $cmdinfo {
$t add_row $row
}
set width_0 [$t column_datawidth 0]
$t configure_column 0 -minwidth [expr {$width_0 + 2}]
set width_1 [$t column_datawidth 1]
$t configure_column 1 -minwidth [expr {$width_1 + 1}]
$t configure -title $title
set text ""
append text [$t print]
set warningblock ""
set introblock $mascotblock
append introblock \n $text
if {[catch {package require textblock} errM]} {
set introblock $mascotblock
append introblock \n $text
append warningblock \n "WARNING: textblock package couldn't be loaded. Side-by-side display not available"
} else {
set introblock [textblock::join -- " " \n$mascotblock " " $text]
}
#if {[catch {package require textblock} errM]} {
# append warningblock \n "WARNING: textblock package couldn't be loaded. Side-by-side display not available"
#} else {
# set introblock [textblock::join -- " " \n$mascotblock " " $text]
#}
lappend chunks [list stdout $introblock]

140
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/ansi-0.1.1.tm

@ -132,14 +132,29 @@ tcl::namespace::eval punk::ansi::class {
set rendered [overtype::renderspace -cp437 1 -expand_right 0 -wrap 1 -width $w -height $h -appendlines 1 "" [$o_ansistringobj get]]
return $rendered
}
lappend ::punk::ansi::class::PUNKARGS [list {
*id "punk::ansi::class::class_ansi render_to_input_line"
*proc -name "punk::ansi::class::class_ansi render_to_input_line" -help\
"render string from line 0 to line
(experimental/debug)"
-dimensions -type string -help\
"WxH where W is integer width >= 1 and H is integer heigth >= 1"
-minus -type integer -help\
"number of chars to exclude from end"
*values -min 1 -max 1
line -type indexexpression
}]
method render_to_input_line {args} {
if {[llength $args] < 1} {
puts stderr "render_to_input_line usage: ?-dimensions WxH? ?-minus charcount? x"
punk::args::get_by_id "punk::ansi::class::class_ansi render_to_input_line" $args
}
set x [lindex $args end]
set arglist [lrange $args 0 end-1]
if {[llength $arglist] %2 != 0} {
puts stderr "render_to_input_line usage: ?-dimensions WxH? ?-minus charcount? x"
punk::args::get_by_id "punk::ansi::class::class_ansi render_to_input_line" $args
}
set opts [tcl::dict::create\
-dimensions 80x24\
@ -322,6 +337,7 @@ tcl::namespace::eval punk::ansi::class {
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
tcl::namespace::eval punk::ansi {
variable PUNKARGS
#*** !doctools
#[subsection {Namespace punk::ansi}]
#[para] Core API functions for punk::ansi
@ -422,6 +438,8 @@ tcl::namespace::eval punk::ansi {
erase*\
get_*\
hyperlink\
hyperlink_open\
hyperlink_close\
move*\
reset*\
ansistrip*\
@ -554,21 +572,35 @@ tcl::namespace::eval punk::ansi {
$obj destroy
return $result
}
proc example {args} {
set base [punk::repo::find_project]
set default_ansifolder [file join $base src/testansi]
set argd [punk::args::get_dict [tstr -return string {
proc Get_ansifolder {} {
if {[catch {punk::repo::find_project} base]} {
set base ""
}
if {$base eq ""} {
#pwd not avail in safe interp
if {![catch {pwd} CWD]} {
set base $CWD
}
}
return [file join $base src/testansi]
}
lappend PUNKARGS [list -dynamic 1 {
*id punk::ansi::example
*proc -name punk::ansi::example -help "Display .ans image files in a grid that will fit in console
"
-colwidth -default 82 -help "Width of each column - default of 82 will fit a standard 80wide ansi image (when framed)
You can specify a narrower width to truncate images on the right side"
-folder -default "${$default_ansifolder}" -help "Base folder for files if relative paths are used.
-folder -default "${[punk::ansi::Get_ansifolder]}" -help "Base folder for files if relative paths are used.
Defaults to <projectbase>/src/testansi - where projectbase is determined from current directory.
"
*values -min 0 -max -1
files -default {belinda.ans bot.ans flower.ans fish.ans} -multiple true -help "List of filenames - leave empty to display 4 defaults"
}] $args]
} ""]
proc example {args} {
set argd [punk::args::get_by_id punk::ansi::example $args]
set colwidth [dict get $argd opts -colwidth]
set ansifolder [file normalize [dict get $argd opts -folder]]
set fnames [dict get $argd values files]
@ -621,7 +653,7 @@ tcl::namespace::eval punk::ansi {
set subtitle [tcl::dict::get $picinfo status]
}
set title [tcl::dict::get $picinfo filename]
set fr [textblock::frame -width $colwidth -subtitle $subtitle -title $title [tcl::dict::get $picinfo pic]]
set fr [textblock::frame -checkargs 0 -width $colwidth -subtitle $subtitle -title $title [tcl::dict::get $picinfo pic]]
# -- --- --- ---
#we need the max height of a row element to use join_basic instead of join below
# -- --- --- ---
@ -2320,16 +2352,23 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
set sgr_cache [tcl::dict::create]
#sgr_cache clear called by punk::console::ansi when set to off
proc sgr_cache {args} {
set argd [punk::args::get_dict {
*proc -name punk::ansi::sgr_cache -help "Convenience function to view and optionally clear the ansi character attribute cache (ansi SGR codes)
"
-action -default "" -choices "clear" -help "-action clear will unset the keys in the punk::ansi::sgr_cache dict
This is called automatically when setting 'colour false' in the console"
-pretty -default 1 -type boolean -help "use 'pdict punk::ansi::sgr_cache */%str,%ansiview' output"
#punk::args depends on punk::ansi - REVIEW
proc sgr_cache {args} {
set argdef {
*id punk::ansi::sgr_cache
*proc -name punk::ansi::sgr_cache -help\
"Convenience function to view and optionally clear the ansi character attribute cache (ansi SGR codes)
"
-action -default "" -choices "clear" -help\
"-action clear will unset the keys in the punk::ansi::sgr_cache dict
This is called automatically when setting 'colour false' in the console"
-pretty -default 1 -type boolean -help\
"use 'pdict punk::ansi::sgr_cache */%str,%ansiview' output"
*values -min 0 -max 0
} $args]
}
set argd [punk::args::get_dict $argdef $args]
set action [dict get $argd opts -action]
set pretty [dict get $argd opts -pretty]
@ -2372,6 +2411,31 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
return [join $lines \n]
}
lappend PUNKARGS [list {
*id punk::ansi::a+
*proc -name "punk::ansi::a+" -help\
"Returns an ANSI sgr escape sequence based on the list of supplied codes.
"
*values -min 0 -max -1
} [string map [list <choices> [dict keys $SGR_map]] {
code -type string -optional 1 -multiple 1 -choices {<choices>} -choiceprefix 0 -choicerestricted 0 -help\
"SGR code from the list below, or an integer corresponding to the code e.g 31 = red.
A leading capital letter indicates a codename applies to the background colour.
Other accepted codes are:
term-<int> Term-<int> foreground/background where int is 0-255 terminal color
term-<termcolour> Term-<termcolour> foreground/background
rgb-<r>-<g>-<b> Rgb-<r>-<g>-<b> foreground/background where <r> <g> <b> are the
0-255 int values for red, green and blue.
rgb#<hexcode> Rgb#<hexcode> where <hexcode> is a 6 char hex colour e.g rgb#C71585
web-<webcolour> Web-<webcolour>
The acceptable values for <termcolour> and <webcolour> can be queried using
punk::ansi::a? term
and
punk::ansi::a? web"
}]]
proc a+ {args} {
#*** !doctools
#[call [fun a+] [opt {ansicode...}]]
@ -3267,17 +3331,49 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
}
# REVIEW - osc8 replays etc for split lines? - textblock
#Hyperlinks (a.k.a. HTML-like anchors) in terminal emulators https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
#the 'id' parameter logically connects split hyperlinks
#per interp. Rather than try to avoid collisions using something like 'info cmdcount' we will use a simple counter.
#To stop multiple hyperlinks from having ids inadvertently collide - we should do some id mangling/prefixing based on the terminal/window etc
#It is better to use a simple counter with high likelihood of collision so we are more likely to detect problems with ids than to make it more intermittent by using ids that collide only 'rarely'
variable hyperlinkcounter
set hyperlinkcounter 0
proc hyperlink {uri {display ""}} {
variable hyperlinkcounter
if {$display eq ""} {
set display $uri
}
set params "" ;#todo e.g id=xyz123:foo=bar:baz=quux
set uri [punk::ansi::ansistripraw $uri]
#limit uri length we emit based on common limits in other terminals
if {[string length $uri] > 2083} {
error "punk::ansi::hyperlink uri too long: limit 2083"
}
set params "id=punkansi-[incr hyperlinkcounter]" ;#todo e.g id=xyz123:foo=bar:baz=quux
set open "\x1b\]8\;$params\;$uri\x1b\\"
set close "\x1b\]8\;\;\x1b\\"
return ${open}${display}${close}
}
#on windows terminal at least, both uri and id of 2 separated hyperlinks need to match for the hover highlighting to act as a unit.
proc hyperlink_open {uri {id ""}} {
if {$id eq ""} {
set id punkansi-[incr hyperlinkcounter]
}
set uri [punk::ansi::ansistripraw $uri]
if {[string length $uri] > 2083} {
error "punk::ansi::hyperlink uri too long: limit 2083"
}
set id [string map {: . {;} ,} $id] ;#avoid some likely problematic ids. TODO - review, restrict further.
set params "id=$id"
return "\x1b\]8\;$params\;$uri\x1b\\"
}
#It should be ok to close even if no currently active hyperlink (e.g can be used to cleanup if something awry)
proc hyperlink_close {} {
return "\x1b\]8\;\;\x1b\\"
}
# -- --- --- --- ---
proc move {row col} {
#*** !doctools
@ -3837,11 +3933,13 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
#[call [fun ansistrip] [arg text] ]
#[para]Return a string with ansi codes stripped out
#[para]Alternate graphics chars are replaced with modern unicode equivalents (e.g boxdrawing glyphs)
if {[string length $text] < 2} {return $text}
if {[punk::ansi::ta::detect_g0 $text]} {
set text [convert_g0 $text];#Convert ansi borders to unicode line drawing instead of ascii letters
}
if {[string length $text] < 2} {return $text}
set parts [punk::ansi::ta::split_codes $text]
if {[llength $parts] == 1} {return [lindex $parts 0]}
set out ""
#todo - try: join [lsearch -stride 2 -index 0 -subindices -all -inline $parts *] ""
# - (if/when lsearch -stride bug fixed)
@ -3871,6 +3969,7 @@ Brightblack 100 Brightred 101 Brightgreen 102 Brightyellow 103 Brightblu
#[para]Return a string with ansi codes stripped out
#[para]Alternate graphics modes will be stripped rather than converted to unicode - exposing the raw ascii characters as they appear without graphics mode.
#[para]ie instead of a horizontal line you may see: qqqqqq
if {[string length $text] < 2} {return $text}
set parts [punk::ansi::ta::split_codes $text]
set out ""
@ -7294,6 +7393,13 @@ tcl::namespace::eval punk::ansi::internal {
}
}
if {![info exists ::punk::args::register::NAMESPACES]} {
namespace eval ::punk::args::register {
set NAMESPACES [list]
}
}
lappend ::punk::args::register::NAMESPACES ::punk::ansi ::punk::ansi::class
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
## Ready
package provide punk::ansi [tcl::namespace::eval punk::ansi {

1680
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/args-0.1.0.tm

File diff suppressed because it is too large Load Diff

35
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/config-0.1.tm

@ -361,11 +361,14 @@ tcl::namespace::eval punk::config {
}
proc configure {args} {
set argd [punk::args::get_dict {
set argdef {
*id punk::config::configure
*proc -name punk::config::configure -help\
"UNIMPLEMENTED"
*values -min 1 -max 1
whichconfig -type string -choices {startup running stop}
} $args]
}
set argd [punk::args::get_dict $argdef $args]
return "unimplemented - $argd"
}
@ -375,6 +378,8 @@ tcl::namespace::eval punk::config {
return [punk::lib::showdict $configdata]
}
#e.g
# copy running-config startup-config
# copy startup-config test-config.cfg
@ -382,16 +387,22 @@ tcl::namespace::eval punk::config {
#review - consider the merge vs overwrite feature of some routers.. where copy to running-config does a merge rather than an overwrite
#This is to allow partial configs to be loaded to running, whereas a save of running to any target is always a complete configuration
proc copy {args} {
set argd [punk::args::get_dict {
*proc -name punk::config::copy -help "Copy a partial or full configuration from one config to another
If a target config has additional settings, then the source config can be considered to be partial with regards to the target.
"
-type -default "" -choices {replace merge} -help "Defaults to merge when target is running-config
Defaults to replace when source is running-config"
set argdef {
*id punk::config::copy
*proc -name punk::config::copy -help\
"Copy a partial or full configuration from one config to another
If a target config has additional settings, then the source config can be considered to be partial with regards to the target.
"
-type -default "" -choices {replace merge} -help\
"Defaults to merge when target is running-config
Defaults to replace when source is running-config"
*values -min 2 -max 2
fromconfig -help "running or startup or file name (not fully implemented)"
toconfig -help "running or startup or file name (not fully implemented)"
} $args]
fromconfig -help\
"running or startup or file name (not fully implemented)"
toconfig -help\
"running or startup or file name (not fully implemented)"
}
set argd [punk::args::get_dict $argdef $args]
set fromconfig [dict get $argd values fromconfig]
set toconfig [dict get $argd values toconfig]
set fromconfig [string map {-config ""} $fromconfig]

5
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/console-0.1.1.tm

@ -81,6 +81,8 @@ namespace eval punk::console {
#*** !doctools
#[list_begin definitions]
variable PUNKARGS
variable tabwidth 8 ;#default only - will attempt to detect and set to that configured in terminal
#Note that windows terminal cooked mode seems to use 8 for interactive use even if set differently
#e.g typing tab characters may still be echoed 8-spaced while writing to stdout my obey the terminal's tab stops.
@ -1187,7 +1189,8 @@ namespace eval punk::console {
*id punk::console::cell_size
-inoutchannels -default {stdin stdout} -type list
*values -min 0 -max 1
newsize -default ""
newsize -default "" -help\
"character cell pixel dimensions WxH"
}
proc cell_size {args} {
set argd [punk::args::get_by_id punk::console::cell_size $args]

19
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/fileline-0.1.0.tm

@ -1251,6 +1251,16 @@ namespace eval punk::fileline {
#[para] Core API functions for punk::fileline
#[list_begin definitions]
punk::args::definition {
*id punk::fileline::get_textinfo
*proc -name punk::fileline::get_textinfo -help\
"return: textinfo object instance"
-file -default {} -type existingfile
-translation -default iso8859-1
-encoding -default "\uFFFF"
-includebom -default 0
*values -min 0 -max 1
}
proc get_textinfo {args} {
#*** !doctools
#[call get_textinfo [opt {option value...}] [opt datachunk]]
@ -1266,14 +1276,7 @@ namespace eval punk::fileline {
#[para]Currently only utf-8, utf-16* and utf-32* are properly supported even though the other BOMs are detected, reported via get_bomid, and stripped from the data.
#[para]GB18030 falls back to cp936/gbk (unless a gb18030 encoding has been installed). Use -encoding iso8859-1 if this isn't suitable and you need to do your own processing of the bytes.
set argument_specification {
-file -default {} -type existingfile
-translation -default iso8859-1
-encoding -default "\uFFFF"
-includebom -default 0
*values -min 0 -max 1
}
lassign [dict values [punk::args::get_dict $argument_specification $args]] opts values
lassign [dict values [punk::args::get_by_id punk::fileline::get_textinfo $args]] opts values
# -- --- --- ---
set opt_file [dict get $opts -file]
set opt_translation [dict get $opts -translation]

190
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/lib-0.1.1.tm

@ -48,8 +48,10 @@
#[list_begin itemized]
package require Tcl 8.6-
package require punk::args
#*** !doctools
#[item] [package {Tcl 8.6-}]
#[item] [package {punk::args}]
# #package require frobz
# #*** !doctools
@ -140,7 +142,7 @@ tcl::namespace::eval punk::lib::check {
proc has_tclbug_lsearch_strideallinline {} {
#bug only occurs with single -index value combined with -stride -all -inline -subindices
#https://core.tcl-lang.org/tcl/tktview/5a1aaa201d
if {[catch {[lsearch -stride 3 -all -inline -index 1 -subindices {a1 a2 a3} *]} result]} {
if {[catch {lsearch -stride 3 -all -inline -index 1 -subindices {a1 a2 a3} *} result]} {
#we aren't looking for an error result - error most likely indicates tcl too old to support -stride
return 0
}
@ -320,7 +322,7 @@ tcl::namespace::eval punk::lib::compat {
if {"::lmap" ne [info commands ::lmap]} {
#puts stderr "Warning - no built-in lpop"
interp alias {} lpop {} ::punk::lib::compat::lmaptcl
interp alias {} lmap {} ::punk::lib::compat::lmaptcl
}
#lmap came in Tcl 8.6 - so probably not much need for a tcl forward compatibility version - but here it is anyway
proc lmaptcl {varnames list script} {
@ -384,6 +386,7 @@ tcl::namespace::eval punk::lib::compat {
# Base namespace
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
namespace eval punk::lib {
variable PUNKARGS
tcl::namespace::export *
variable has_struct_list
set has_struct_list [expr {![catch {package require struct::list}]}]
@ -956,171 +959,8 @@ namespace eval punk::lib {
proc lzipn {args} [info body ::punk::lib::lzipn_tcl9a]
}
#experiment with equiv of js template literals with ${expression} in templates
#e.g tstr {This is the value of x in calling scope ${$x} !}
#e.g tstr -allowcommands {This is the value of x in calling scope ${[set x]} !}
#e.g tstr -allowcommands {This is the value of [lindex $x 0] in calling scope ${[lindex [set x] 0]} !}
proc tstr {args} {
set argd [punk::args::get_dict {
*proc -name punk::lib::tstr -help "A rough equivalent of js template literals"
-allowcommands -default 0 -type none -help "if -allowcommands is true placeholder can contain commands e.g {${plaintext1 [lindex $var 0] plaintext2}}"
-return -default list -choices {dict list string}
*values -min 1 -max 1
templatestring -help "This argument should be a braced string containing placeholders such as ${$var} e.g {The value is ${$var}}
where $var will be substituted from the calling context
The placeholder itself can contain plaintext portions as well as variables.
It can contain commands in square brackets if -allowcommands is true"
} $args]
set templatestring [dict get $argd values templatestring]
set opt_allowcommands [dict get $argd opts -allowcommands]
set opt_return [dict get $argd opts -return]
set nocommands "-nocommands"
if {$opt_allowcommands == 1} {
set nocommands ""
}
#set parts [_tstr_split $templatestring]
set parts [_parse_tstr_parts $templatestring]
set textchunks [list]
#set expressions [list]
set params [list]
set idx 0
foreach {pt expression} $parts {
lappend textchunks $pt
incr idx ;#pt incr
#ignore last expression
if {$idx == [llength $parts]} {
break
}
#lappend expressions $expression
lappend params [uplevel 1 [list subst {*}$nocommands $expression]]
incr idx ;#expression incr
}
switch -- $opt_return {
dict {
return [dict create template $textchunks params $params]
}
list {
return [list $textchunks {*}$params]
}
string {
set out ""
foreach pt $textchunks param $params {
append out $pt $param
}
return $out
}
default {
}
}
}
#test single placeholder tstr args where single placeholder must be an int
proc tstr_test_one {args} {
set argd [punk::args::get_dict {
*proc -name tstr_test_one -help {An example/test of a function designed to be called with a js-style curly-braced Tstr.
example:
set id 2
tstr_test_one {*}[Tstr {Select * from table where id = ${$id} and etc... ;}]
}
*values -min 2 -max 2
template -type list -minlen 2 -maxlen 2 -help "This could be supplied directly as a 2 element list of each half of the sql statement -
but the Tstr method above does this for you, and also passes in the id automatically"
where -type int -help {Integer param for where clause. Tstr mechanism above will pass the id as the second parameter}
} $args]
set template [dict get $argd values template]
set where [dict get $argd values where]
set result [join [list [lindex $template 0] $where [lindex $template 1]] ""]
return $result
}
proc _parse_tstr_parts {templatestring} {
if {$templatestring eq ""} {
return [list]
}
set chars [split $templatestring ""]
set in_placeholder 0
set tchars ""
set echars ""
set parts [list]
set i 0
foreach ch $chars {
if {!$in_placeholder} {
set nextch [lindex $chars [expr {$i+1}]]
if {"$ch$nextch" eq "\$\{"} {
set in_placeholder 2 ;#2 to signify we just entered placeholder
lappend parts $tchars
set tchars ""
} else {
append tchars $ch
}
} else {
if {$ch eq "\}"} {
if {[tcl::info::complete $echars]} {
set in_placeholder 0
lappend parts $echars
set echars ""
} else {
append echars $ch
}
} else {
if {$in_placeholder == 2} {
#skip opening bracket
set in_placeholder 1
} else {
append echars $ch
}
}
}
incr i
}
if {$tchars ne ""} {
lappend parts $tchars
}
if {[llength $parts] % 2 == 0} {
#always trail with pt for consistency with _perlish_split method so we can test other mechanisms with odd-length pt/code../pt style list
lappend parts ""
}
return $parts
}
#based on punk::ansi::ta::_perlish_split
proc _tstr_split {text} {
if {$text eq ""} {
return {}
}
set list [list]
set start 0
#ideally re should allow curlies within but we will probably need a custom parser to do it
#(js allows nested string interpolation)
#set re {\$\{[^\}]*\}}
set re {\$\{(?:(?!\$\{).)*\}}
#eg regexp {\x1b(?:\(0(?:(?:(?!\x1b\(B).)*\x1b\(B)|\)0(?:(?:(?!\x1b\)B).)*\x1b\)B))} $code
#We can get $matchEnd < $matchStart; we need to ensure there is an exit condition for non-greedy empty results REVIEW
while {[regexp -start $start -indices -- $re $text match]} {
lassign $match matchStart matchEnd
#puts "->start $start ->match $matchStart $matchEnd"
if {$matchEnd < $matchStart} {
puts "e:$matchEnd < s:$matchStart"
lappend list [tcl::string::range $text $start $matchStart-1] [tcl::string::index $text $matchStart]
incr start
if {$start >= [tcl::string::length $text]} {
break
}
continue
}
lappend list [tcl::string::range $text $start $matchStart-1] [tcl::string::range $text $matchStart+2 $matchEnd-1]
set start [expr {$matchEnd+1}]
#?
if {$start >= [tcl::string::length $text]} {
break
}
}
return [lappend list [tcl::string::range $text $start end]]
}
namespace import ::punk::args::lib::tstr
#get info about punk nestindex key ie type: list,dict,undetermined
proc nestindex_info {args} {
@ -1184,8 +1024,11 @@ namespace eval punk::lib {
set sep " [punk::ansi::a+ Green]=[punk::ansi::a] "
}
set argspec [string map [list %sep% $sep] {
*proc -name pdict -help {Print dict keys,values to channel
(see also showdict)}
*id punk::lib::pdict
*proc -name pdict -help\
"Print dict keys,values to channel
The pdict function operates on variable names - passing the value to the showdict function which operates on values
(see also showdict)"
*opts -any 1
@ -1222,7 +1065,6 @@ namespace eval punk::lib {
The second level segement in each pattern switches to a dict operation to retrieve the value by key.
When a list operation such as @* is used - integer list indexes are displayed on the left side of the = for that hierarchy level.
The pdict function operates on variable names - passing the value to the showdict function which operates on values
}
}]
#puts stderr "$argspec"
@ -1282,7 +1124,7 @@ namespace eval punk::lib {
-ansibase_keys -default "" -help "ansi list for each level in -substructure. e.g \[list \[a+ red\] \[a+ web-green\]\]"
-substructure -default {}
-ansibase_values -default ""
-keytemplates -default {${$key}} -type list -help "list of templates for keys at each level"
-keytemplates -default {\$\{$key\}} -type list -help "list of templates for keys at each level"
-keysorttype -default "none" -choices {none dictionary ascii integer real}
-keysortdirection -default increasing -choices {increasing decreasing}
*values -min 1 -max -1
@ -1295,6 +1137,7 @@ namespace eval punk::lib {
set opt_keysortdirection [dict get $argd opts -keysortdirection]
set opt_trimright [dict get $argd opts -trimright]
set opt_keytemplates [dict get $argd opts -keytemplates]
puts stderr "---> $opt_keytemplates <---"
set opt_ansibase_keys [dict get $argd opts -ansibase_keys]
set opt_ansibase_values [dict get $argd opts -ansibase_values]
set opt_return [dict get $argd opts -return]
@ -4272,6 +4115,13 @@ tcl::namespace::eval punk::lib::system {
#*** !doctools
#[list_end] [comment {--- end definitions namespace punk::lib::system ---}]
}
if {![info exists ::punk::args::register::NAMESPACES]} {
namespace eval ::punk::args::register {
set ::punk::args::register::NAMESPACES [list] ;#use fully qualified so 8.6 doesn't find existing var in global namespace
}
}
lappend ::punk::args::register::NAMESPACES ::punk::lib
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
## Ready
package provide punk::lib [tcl::namespace::eval punk::lib {

2
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/mix/commandset/layout-0.1.0.tm

@ -35,7 +35,7 @@ namespace eval punk::mix::commandset::layout {
proc files {{layout ""}} {
set argd [punk::args::get_dict {
*values -min 1 -max 1
layout -type string -minlen 1
layout -type string -minsize 1
} [list $layout]]
set allfiles [lib::layout_all_files $layout]

37
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/mix/commandset/loadedlib-0.1.0.tm

@ -26,19 +26,21 @@ package require punk::lib
namespace eval punk::mix::commandset::loadedlib {
namespace export *
#search automatically wrapped in * * - can contain inner * ? globs
proc search {args} {
set argspecs {
*proc -name "punk::mix::commandset::loadedlib search" -help "search all Tcl libraries available to your local interpreter"
-return -type string -default table -choices {table tableobject list lines}
-present -type integer -default 2 -choices {0 1 2} -choicelabels {absent present both} -help "(unimplemented) Display only those that are 0:absent 1:present 2:both"
-highlight -type boolean -default 1 -help "Highlight which version is present with ansi underline and colour"
-refresh -default 0 -type boolean -help "Re-scan the tm and library folders"
searchstrings -default * -multiple 1 -help "Names to search for, may contain glob chars (* ?) e.g *lib*
punk::args::definition {
*id punk::mix::commandset::loadedlib::search
*proc -name "punk::mix::commandset::loadedlib search" -help "search all Tcl libraries available to your local interpreter"
-return -type string -default table -choices {table tableobject list lines}
-present -type integer -default 2 -choices {0 1 2} -choicelabels {absent present both} -help\
"(unimplemented) Display only those that are 0:absent 1:present 2:both"
-highlight -type boolean -default 1 -help "Highlight which version is present with ansi underline and colour"
-refresh -default 0 -type boolean -help "Re-scan the tm and library folders"
searchstrings -default * -multiple 1 -help\
"Names to search for, may contain glob chars (* ?) e.g *lib*
If no glob chars are explicitly specified, the searchstring will be wrapped with star globs.
eg name -> *name*
"
}
set argd [punk::args::get_dict $argspecs $args]
eg name -> *name*"
}
proc search {args} {
set argd [punk::args::get_by_id punk::mix::commandset::loadedlib::search $args]
set searchstrings [dict get $argd values searchstrings]
set opts [dict get $argd opts]
set opt_return [dict get $opts -return]
@ -179,16 +181,7 @@ namespace eval punk::mix::commandset::loadedlib {
return [join $loaded_libs \n]
}
proc info {args} {
set argspecs {
*values -min 1
libname -help "library/package name"
}
set argd [punk::args::get_dict $argspecs $args]
set libname [dict get $argd values libname]
proc info {libname} {
if {[catch {package require natsort}]} {
set has_natsort 0
} else {

70
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/mix/commandset/module-0.1.0.tm

@ -137,23 +137,39 @@ namespace eval punk::mix::commandset::module {
put stderr "get_template_basefolders WARNING - no handler available for the 'punk.templates' capability - template providers will be unable to provide template locations"
}
}
set moduletypes [punk::mix::cli::lib::module_types]
punk::args::definition [subst {
*id punk::mix::commandset::module::new
*proc -name "punk::mix::commandset::module::new" -help\
"Create a new module file in the appropriate folder within src/modules.
If the name given in the module argument is namespaced,
the necessary subfolder(s) will be used or created."
-project -optional 1
-version -default "0.1.0" -help\
"version to use if not specified as part of the module argument.
If a version is specified in the module argument as well as in -version
the higher version number will be used.
"
-license -default <unspecified>
-template -default punk.module
-type -default "[lindex $moduletypes 0]" -choices {$moduletypes}
-force -default 0 -type boolean -help\
"If set true, will overwrite an existing .tm file if there is one.
If false (default) an error will be raised if there is a conflict."
-quiet -default 0 -type boolean -help\
"Suppress information messages on stdout"
*values -min 1 -max 1
module -type string -help\
"Name of module, possibly including a namespace and/or version number
e.g mynamespace::mymodule-1.0"
}]
proc new {args} {
set year [clock format [clock seconds] -format %Y]
set moduletypes [punk::mix::cli::lib::module_types]
# use \uFFFD because unicode replacement char should consistently render as 1 wide
set argspecs [subst {
-project -default \uFFFD
-version -default \uFFFD
-license -default <unspecified>
-template -default punk.module
-type -default \uFFFD -choices {$moduletypes}
-force -default 0 -type boolean
-quiet -default 0 -type boolean
*values -min 1 -max 1
module -type string
}]
set argd [punk::args::get_dict $argspecs $args]
lassign [dict values $argd] leaders opts values
set argd [punk::args::get_by_id punk::mix::commandset::module::new $args]
lassign [dict values $argd] leaders opts values received
set module [dict get $values module]
#set opts [dict merge $defaults $args]
@ -168,13 +184,9 @@ namespace eval punk::mix::commandset::module {
# we need this value before looking at the named argument
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set opt_version_supplied [dict get $opts -version]
if {$opt_version_supplied eq "\uFFFD"} {
set opt_version "0.1.0"
} else {
set opt_version $opt_version_supplied
if {![util::is_valid_tm_version $opt_version]} {
error "deck module.new error - supplied -version $opt_version doesn't appear to be a valid Tcl module version"
}
set opt_version $opt_version_supplied
if {![util::is_valid_tm_version $opt_version]} {
error "deck module.new error - supplied -version $opt_version doesn't appear to be a valid Tcl module version"
}
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
#named argument
@ -194,7 +206,7 @@ namespace eval punk::mix::commandset::module {
} else {
set vmsg "from -version option: $opt_version_supplied"
}
if {$opt_version_supplied ne "\uFFFD"} {
if {"-version" in $received} {
if {$vcompare_is_mversion_bigger != 0} {
#is bigger or smaller
puts stderr "module.new WARNING: version supplied in module argument as well as -version option. Using the higher version number $vmsg"
@ -231,7 +243,6 @@ namespace eval punk::mix::commandset::module {
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
#options
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set opt_project [dict get $opts -project]
set testdir [pwd]
if {![string length [set projectdir [punk::repo::find_project $testdir]]]} {
if {![string length [set projectdir [punk::repo::find_candidate $testdir]]]} {
@ -239,9 +250,10 @@ namespace eval punk::mix::commandset::module {
error "module.new unable to create module in projectdir:$projectdir - directory doesn't appear to meet basic standards $msg"
}
}
if {$opt_project == "\uFFFF"} {
if {![dict exists $received -project]} {
set projectname [file tail $projectdir]
} else {
set opt_project [dict get $opts -project]
set projectname $opt_project
if {$projectname ne [file tail $projectdir]} {
error "module.new -project '$opt_project' doesn't match detected projectname '$projectname' at path: $projectdir"
@ -309,12 +321,6 @@ namespace eval punk::mix::commandset::module {
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set opt_type [dict get $opts -type]
if {$opt_type eq "\uFFFD"} {
set opt_type [lindex [punk::mix::cli::lib::module_types] 0] ;#default to plain
}
if {$opt_type ni [punk::mix::cli::lib::module_types]} {
error "module.new - error - unknown -type '$opt_type' known-types: [punk::mix::cli::lib::module_types]"
}
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set opt_quiet [dict get $opts -quiet]
set opt_force [dict get $opts -force]
@ -407,7 +413,7 @@ namespace eval punk::mix::commandset::module {
set podfile $modulefolder/#modpod-$moduletail-$infile_version/$moduletail-$infile_version.tm
set has_tm [file exists $tmfile]
set has_pod [file exists $podfile]
if {$has_tm && $has_pos} {
if {$has_tm && $has_pod} {
#invalid configuration - bomb out
error "module.new error: Invalid target configuration found. module folder has both a .tm file $tmfile and a modpod file $podfile. Please delete one of them before trying again."
}
@ -448,7 +454,7 @@ namespace eval punk::mix::commandset::module {
}
set buildversionfile [file join $modulefolder ${moduletail}-buildversion.txt]
set existing_build_version ""
if {[file exists $buildversionfile]} {
if {!$opt_force && [file exists $buildversionfile]} {
set buildversiondata [punk::mix::util::fcat $buildversionfile]
set lines [split $buildversiondata \n]
set existing_build_version [string trim [lindex $lines 0]]

1016
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/ns-0.1.0.tm

File diff suppressed because it is too large Load Diff

31
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/path-0.1.0.tm

@ -45,8 +45,10 @@
#[list_begin itemized]
package require Tcl 8.6-
package require punk::args
#*** !doctools
#[item] [package {Tcl 8.6-}]
#[item] [package {punk::args}]
# #package require frobz
# #*** !doctools
@ -642,6 +644,20 @@ namespace eval punk::path {
return $ismatch
}
punk::args::definition {
*id punk::path::treefilenames
-directory -type directory -help\
"folder in which to begin recursive scan for files."
-call-depth-internal -default 0 -type integer
-antiglob_paths -default {} -help\
"list of path patterns to exclude
may include * and ** path segments e.g /usr/**"
*values -min 0 -max -1 -optional 1 -type string
tailglobs -multiple 1 -help\
"Patterns to match against filename portion (last segment) of each file path
within the directory tree being searched."
}
#todo - implement treefiles which acts like dirfiles but allows path globbing in the same way as punk::ns::ns/
#then review if treefiles can replace dirfiles or if both should exist (dirfiles can have literal glob chars in path segments - but that is a rare usecase)
proc treefilenames {args} {
@ -655,22 +671,17 @@ namespace eval punk::path {
#[para] list of path patterns to exclude - may include * and ** path segments e.g /usr/**
#[para]no natsorting - so order is dependent on filesystem
set argd [punk::args::get_dict {
-directory -default "\uFFFF"
-call-depth-internal -default 0 -type integer
-antiglob_paths -default {}
*values -min 0 -max -1 -optional 1 -type string
tailglobs -multiple 1
} $args]
lassign [dict values $argd] leaders opts values
set argd [punk::args::get_by_id punk::path::treefilenames $args]
lassign [dict values $argd] leaders opts values received
set tailglobs [dict values $values]
# -- --- --- --- --- --- ---
set opt_antiglob_paths [dict get $opts -antiglob_paths]
set CALLDEPTH [dict get $opts -call-depth-internal]
# -- --- --- --- --- --- ---
set opt_dir [dict get $opts -directory]
if {$opt_dir eq "\uFFFF"} {
if {![dict exists $received -directory]} {
set opt_dir [pwd]
} else {
set opt_dir [dict get $opts -directory]
}
# -- --- --- --- --- --- ---

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save