Browse Source

build outputs: bootsupport punk::console 0.3.0 snapshots (supersedes interim 0.2.0-stamped copies)

From 'tclsh src/make.tcl bootsupport' run after commit 0ee66dce -
correctly stamped and containing the final 0.3.0 content (per-console
facts + PUNKARGS @leaders restructure).

Note: the punk.shell-0.1 layout retains console-0.1.0.tm and
console-0.2.0.tm alongside the new 0.3.0 - the prune kept them (no
qualifying punkcheck install record); pending manual removal if
unwanted, per the established prune-leftovers handling.
master
Julian Noble 4 weeks ago
parent
commit
f61b31879e
  1. 221
      src/bootsupport/modules/punk/console-0.3.0.tm
  2. 221
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/console-0.3.0.tm
  3. 5560
      src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/console-0.3.0.tm

221
src/bootsupport/modules/punk/console-0.2.0.tm → src/bootsupport/modules/punk/console-0.3.0.tm

@ -7,7 +7,7 @@
# (C) 2023 # (C) 2023
# #
# @@ Meta Begin # @@ Meta Begin
# Application punk::console 0.2.0 # Application punk::console 0.3.0
# Meta platform tcl # Meta platform tcl
# Meta license <unspecified> # Meta license <unspecified>
# @@ Meta End # @@ Meta End
@ -17,7 +17,7 @@
# doctools header # doctools header
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ # ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#*** !doctools #*** !doctools
#[manpage_begin punkshell_module_punk::console 0 0.2.0] #[manpage_begin punkshell_module_punk::console 0 0.3.0]
#[copyright "2024"] #[copyright "2024"]
#[titledesc {punk console}] [comment {-- Name section and table of contents description --}] #[titledesc {punk console}] [comment {-- Name section and table of contents description --}]
#[moddesc {punk console}] [comment {-- Description at end of page heading --}] #[moddesc {punk console}] [comment {-- Description at end of page heading --}]
@ -304,7 +304,21 @@ namespace eval punk::console {
#(safe for tails that otherwise hold row/col/data triples - a well-formed triple never has #(safe for tails that otherwise hold row/col/data triples - a well-formed triple never has
#the literal '-console' in its 2nd-last position) #the literal '-console' in its 2nd-last position)
#The non-var forms additionally require that nothing else remains in the tail. #The non-var forms additionally require that nothing else remains in the tail.
punk::args::define {
@id -id ::punk::console::internal::opt_console_out_var
@cmd -name punk::console::internal::opt_console_out_var -summary\
"Strip a trailing '-console <consolespec>' pair from the named args variable, returning the resolved output channel."\
-help\
"The variable named by argsvar in the caller's frame is modified in place (the
-console pair is removed if present; other content such as row/col/data triples
is left alone). Returns stdout when no -console pair is present."
@leaders
argsvar -type string -help\
"Name of an args-tail list variable in the caller's frame."
@values -min 0 -max 0
}
proc opt_console_out_var {argsvar} { proc opt_console_out_var {argsvar} {
#see PUNKARGS id ::punk::console::internal::opt_console_out_var
upvar 1 $argsvar tail upvar 1 $argsvar tail
if {[llength $tail] >= 2 && [lindex $tail end-1] eq "-console"} { if {[llength $tail] >= 2 && [lindex $tail end-1] eq "-console"} {
set out [dict get [punk::console::console_spec_resolve [lindex $tail end]] out] set out [dict get [punk::console::console_spec_resolve [lindex $tail end]] out]
@ -313,7 +327,21 @@ namespace eval punk::console {
} }
return stdout return stdout
} }
punk::args::define {
@id -id ::punk::console::internal::opt_console_channels_var
@cmd -name punk::console::internal::opt_console_channels_var -summary\
"Strip a trailing '-console <consolespec>' pair from the named args variable, returning the canonical {in out} channel pair."\
-help\
"The variable named by argsvar in the caller's frame is modified in place (the
-console pair is removed if present; other content such as row/col/data triples
is left alone). Returns {stdin stdout} when no -console pair is present."
@leaders
argsvar -type string -help\
"Name of an args-tail list variable in the caller's frame."
@values -min 0 -max 0
}
proc opt_console_channels_var {argsvar} { proc opt_console_channels_var {argsvar} {
#see PUNKARGS id ::punk::console::internal::opt_console_channels_var
upvar 1 $argsvar tail upvar 1 $argsvar tail
if {[llength $tail] >= 2 && [lindex $tail end-1] eq "-console"} { if {[llength $tail] >= 2 && [lindex $tail end-1] eq "-console"} {
set cinfo [punk::console::console_spec_resolve [lindex $tail end]] set cinfo [punk::console::console_spec_resolve [lindex $tail end]]
@ -322,14 +350,40 @@ namespace eval punk::console {
} }
return {stdin stdout} return {stdin stdout}
} }
punk::args::define {
@id -id ::punk::console::internal::opt_console_out
@cmd -name punk::console::internal::opt_console_out -summary\
"Resolve an emit-function args-tail (empty or exactly '-console <consolespec>') to an output channel."\
-help\
"Errors if the tail contains anything other than a single optional -console pair.
Returns stdout for an empty tail."
@leaders
argstail -type list -help\
"The args-tail value: {} or {-console <consolespec>}."
@values -min 0 -max 0
}
proc opt_console_out {argstail} { proc opt_console_out {argstail} {
#see PUNKARGS id ::punk::console::internal::opt_console_out
set out [opt_console_out_var argstail] set out [opt_console_out_var argstail]
if {[llength $argstail]} { if {[llength $argstail]} {
error "expected optional trailing '-console <consolespec>' - got '$argstail'" error "expected optional trailing '-console <consolespec>' - got '$argstail'"
} }
return $out return $out
} }
punk::args::define {
@id -id ::punk::console::internal::opt_console_channels
@cmd -name punk::console::internal::opt_console_channels -summary\
"Resolve an emit-function args-tail (empty or exactly '-console <consolespec>') to a canonical {in out} channel pair."\
-help\
"Errors if the tail contains anything other than a single optional -console pair.
Returns {stdin stdout} for an empty tail."
@leaders
argstail -type list -help\
"The args-tail value: {} or {-console <consolespec>}."
@values -min 0 -max 0
}
proc opt_console_channels {argstail} { proc opt_console_channels {argstail} {
#see PUNKARGS id ::punk::console::internal::opt_console_channels
set channels [opt_console_channels_var argstail] set channels [opt_console_channels_var argstail]
if {[llength $argstail]} { if {[llength $argstail]} {
error "expected optional trailing '-console <consolespec>' - got '$argstail'" error "expected optional trailing '-console <consolespec>' - got '$argstail'"
@ -1004,13 +1058,14 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::vt52 @id -id ::punk::console::vt52
@cmd -name punk::console::vt52 -summary "Query or set vt52 terminal mode." @cmd -name punk::console::vt52 -summary "Query or set vt52 terminal mode."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 1
onoff -type boolean -optional 1 -help\ onoff -type boolean -optional 1 -help\
"Omit to query the current vt52 state. "Omit to query the current vt52 state.
The vt52 state is a per-console fact (see console_fact_get); the process-default The vt52 state is a per-console fact (see console_fact_get); the process-default
console's state is mirrored in the legacy ::punk::console::is_vt52 variable." console's state is mirrored in the legacy ::punk::console::is_vt52 variable."
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc vt52 {args} { proc vt52 {args} {
#see PUNKARGS id ::punk::console::vt52 #see PUNKARGS id ::punk::console::vt52
@ -1604,13 +1659,14 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::set_tabstop_width @id -id ::punk::console::set_tabstop_width
@cmd -name punk::console::set_tabstop_width -summary "Emit sequences setting evenly spaced terminal tabstops." @cmd -name punk::console::set_tabstop_width -summary "Emit sequences setting evenly spaced terminal tabstops."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} w -type integer -default 8 -optional 1 -help\
@values -min 0 -max 1
w -type integer -default 8 -help\
"Tabstop spacing in character cells. "Tabstop spacing in character cells.
The tabwidth record is a per-console fact (see console_fact_get); the process-default The tabwidth record is a per-console fact (see console_fact_get); the process-default
console's record is mirrored in the legacy ::punk::console::tabwidth variable." console's record is mirrored in the legacy ::punk::console::tabwidth variable."
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc set_tabstop_width {args} { proc set_tabstop_width {args} {
#see PUNKARGS id ::punk::console::set_tabstop_width #see PUNKARGS id ::punk::console::set_tabstop_width
@ -3472,12 +3528,13 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::test_char_width @id -id ::punk::console::test_char_width
@cmd -name punk::console::test_char_width -summary "Measure a string's rendered width via cursor position reports." @cmd -name punk::console::test_char_width -summary "Measure a string's rendered width via cursor position reports."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 2
char_or_string -type string char_or_string -type string
emit -type boolean -default 0 -optional 1 -help\ emit -type boolean -default 0 -optional 1 -help\
"Leave the test string visible instead of erasing the line around the test." "Leave the test string visible instead of erasing the line around the test."
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc test_char_width {char_or_string args} { proc test_char_width {char_or_string args} {
#see PUNKARGS id ::punk::console::test_char_width #see PUNKARGS id ::punk::console::test_char_width
@ -3548,12 +3605,13 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::test_string_cursor @id -id ::punk::console::test_string_cursor
@cmd -name punk::console::test_string_cursor -summary "Report cursor row/column offsets produced by emitting a string (uses alt screen)." @cmd -name punk::console::test_string_cursor -summary "Report cursor row/column offsets produced by emitting a string (uses alt screen)."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 2
teststring -type string teststring -type string
emit -type boolean -default 0 -optional 1 -help\ emit -type boolean -default 0 -optional 1 -help\
"Leave the test string visible instead of erasing the line around the test." "Leave the test string visible instead of erasing the line around the test."
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc test_string_cursor {teststring args} { proc test_string_cursor {teststring args} {
#see PUNKARGS id ::punk::console::test_string_cursor #see PUNKARGS id ::punk::console::test_string_cursor
@ -3960,13 +4018,14 @@ namespace eval punk::console {
modes are supported. modes are supported.
} }
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 2 -max 2
row -type integer -help\ row -type integer -help\
"row number - starting at 1" "row number - starting at 1"
col -type integer -help\ col -type integer -help\
"column number - starting at 1" "column number - starting at 1"
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc move {row col args} { proc move {row col args} {
#see PUNKARGS id ::punk::console::ansi::move #see PUNKARGS id ::punk::console::ansi::move
@ -3982,10 +4041,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_forward @id -id ::punk::console::ansi::move_forward
@cmd -name punk::console::ansi::move_forward -summary "Emit cursor-forward sequence (ANSI or vt52)." @cmd -name punk::console::ansi::move_forward -summary "Emit cursor-forward sequence (ANSI or vt52)."
@leaders
n -type integer -help "number of columns to move forward"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
n -type integer -help "number of columns to move forward"
}] }]
proc move_forward {n args} { proc move_forward {n args} {
#see PUNKARGS id ::punk::console::ansi::move_forward #see PUNKARGS id ::punk::console::ansi::move_forward
@ -4000,10 +4060,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_back @id -id ::punk::console::ansi::move_back
@cmd -name punk::console::ansi::move_back -summary "Emit cursor-back sequence (ANSI or vt52)." @cmd -name punk::console::ansi::move_back -summary "Emit cursor-back sequence (ANSI or vt52)."
@leaders
n -type integer -help "number of columns to move back"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
n -type integer -help "number of columns to move back"
}] }]
proc move_back {n args} { proc move_back {n args} {
#see PUNKARGS id ::punk::console::ansi::move_back #see PUNKARGS id ::punk::console::ansi::move_back
@ -4018,10 +4079,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_up @id -id ::punk::console::ansi::move_up
@cmd -name punk::console::ansi::move_up -summary "Emit cursor-up sequence (ANSI or vt52)." @cmd -name punk::console::ansi::move_up -summary "Emit cursor-up sequence (ANSI or vt52)."
@leaders
n -type integer -help "number of rows to move up"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
n -type integer -help "number of rows to move up"
}] }]
proc move_up {n args} { proc move_up {n args} {
#see PUNKARGS id ::punk::console::ansi::move_up #see PUNKARGS id ::punk::console::ansi::move_up
@ -4036,10 +4098,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_down @id -id ::punk::console::ansi::move_down
@cmd -name punk::console::ansi::move_down -summary "Emit cursor-down sequence (ANSI or vt52)." @cmd -name punk::console::ansi::move_down -summary "Emit cursor-down sequence (ANSI or vt52)."
@leaders
n -type integer -help "number of rows to move down"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
n -type integer -help "number of rows to move down"
}] }]
proc move_down {n args} { proc move_down {n args} {
#see PUNKARGS id ::punk::console::ansi::move_down #see PUNKARGS id ::punk::console::ansi::move_down
@ -4054,10 +4117,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_column @id -id ::punk::console::ansi::move_column
@cmd -name punk::console::ansi::move_column -summary "Emit move-to-column sequence (ANSI or vt52)." @cmd -name punk::console::ansi::move_column -summary "Emit move-to-column sequence (ANSI or vt52)."
@leaders
col -type integer -help "column number - starting at 1"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
col -type integer -help "column number - starting at 1"
}] }]
proc move_column {col args} { proc move_column {col args} {
#see PUNKARGS id ::punk::console::ansi::move_column #see PUNKARGS id ::punk::console::ansi::move_column
@ -4072,10 +4136,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_row @id -id ::punk::console::ansi::move_row
@cmd -name punk::console::ansi::move_row -summary "Emit move-to-row sequence." @cmd -name punk::console::ansi::move_row -summary "Emit move-to-row sequence."
@leaders
row -type integer -help "row number - starting at 1"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
row -type integer -help "row number - starting at 1"
}] }]
proc move_row {row args} { proc move_row {row args} {
#see PUNKARGS id ::punk::console::ansi::move_row #see PUNKARGS id ::punk::console::ansi::move_row
@ -4084,14 +4149,15 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_emit @id -id ::punk::console::ansi::move_emit
@cmd -name punk::console::ansi::move_emit -summary "Emit data at row,col (ANSI or vt52)." @cmd -name punk::console::ansi::move_emit -summary "Emit data at row,col (ANSI or vt52)."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 3 -max -1
row -type integer -help "row number - starting at 1" row -type integer -help "row number - starting at 1"
col -type integer -help "column number - starting at 1" col -type integer -help "column number - starting at 1"
data -type string data -type string
triple -type any -optional 1 -multiple 1 -help\ triple -type any -optional 1 -multiple 1 -help\
"additional row col data triples" "additional row col data triples"
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc move_emit {row col data args} { proc move_emit {row col data args} {
#see PUNKARGS id ::punk::console::ansi::move_emit #see PUNKARGS id ::punk::console::ansi::move_emit
@ -4106,14 +4172,15 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_emit_return @id -id ::punk::console::ansi::move_emit_return
@cmd -name punk::console::ansi::move_emit_return -summary "Emit data at row,col then return cursor to its previous position." @cmd -name punk::console::ansi::move_emit_return -summary "Emit data at row,col then return cursor to its previous position."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 3 -max -1
row -type integer -help "row number - starting at 1" row -type integer -help "row number - starting at 1"
col -type integer -help "column number - starting at 1" col -type integer -help "column number - starting at 1"
data -type string data -type string
triple -type any -optional 1 -multiple 1 -help\ triple -type any -optional 1 -multiple 1 -help\
"additional row col data triples" "additional row col data triples"
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc move_emit_return {row col data args} { proc move_emit_return {row col data args} {
#see PUNKARGS id ::punk::console::ansi::move_emit_return #see PUNKARGS id ::punk::console::ansi::move_emit_return
@ -4137,12 +4204,13 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_emitblock_return @id -id ::punk::console::ansi::move_emitblock_return
@cmd -name punk::console::ansi::move_emitblock_return -summary "Emit a multiline textblock at row,col then return cursor to its previous position." @cmd -name punk::console::ansi::move_emitblock_return -summary "Emit a multiline textblock at row,col then return cursor to its previous position."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 3 -max 3
row -type integer -help "row number - starting at 1" row -type integer -help "row number - starting at 1"
col -type integer -help "column number - starting at 1" col -type integer -help "column number - starting at 1"
textblock -type string textblock -type string
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc move_emitblock_return {row col textblock args} { proc move_emitblock_return {row col textblock args} {
#see PUNKARGS id ::punk::console::ansi::move_emitblock_return #see PUNKARGS id ::punk::console::ansi::move_emitblock_return
@ -4164,14 +4232,15 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::cursorsave_move_emit_return @id -id ::punk::console::ansi::cursorsave_move_emit_return
@cmd -name punk::console::ansi::cursorsave_move_emit_return -summary "Emit data at row,col bracketed by cursor save/restore (ANSI or vt52)." @cmd -name punk::console::ansi::cursorsave_move_emit_return -summary "Emit data at row,col bracketed by cursor save/restore (ANSI or vt52)."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 3 -max -1
row -type integer -help "row number - starting at 1" row -type integer -help "row number - starting at 1"
col -type integer -help "column number - starting at 1" col -type integer -help "column number - starting at 1"
data -type string data -type string
triple -type any -optional 1 -multiple 1 -help\ triple -type any -optional 1 -multiple 1 -help\
"additional row col data triples" "additional row col data triples"
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc cursorsave_move_emit_return {row col data args} { proc cursorsave_move_emit_return {row col data args} {
#see PUNKARGS id ::punk::console::ansi::cursorsave_move_emit_return #see PUNKARGS id ::punk::console::ansi::cursorsave_move_emit_return
@ -4199,12 +4268,13 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::cursorsave_move_emitblock_return @id -id ::punk::console::ansi::cursorsave_move_emitblock_return
@cmd -name punk::console::ansi::cursorsave_move_emitblock_return -summary "Emit a multiline textblock at row,col bracketed by cursor save/restore (ANSI or vt52)." @cmd -name punk::console::ansi::cursorsave_move_emitblock_return -summary "Emit a multiline textblock at row,col bracketed by cursor save/restore (ANSI or vt52)."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 3 -max 3
row -type integer -help "row number - starting at 1" row -type integer -help "row number - starting at 1"
col -type integer -help "column number - starting at 1" col -type integer -help "column number - starting at 1"
textblock -type string textblock -type string
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc cursorsave_move_emitblock_return {row col textblock args} { proc cursorsave_move_emitblock_return {row col textblock args} {
#see PUNKARGS id ::punk::console::ansi::cursorsave_move_emitblock_return #see PUNKARGS id ::punk::console::ansi::cursorsave_move_emitblock_return
@ -4232,12 +4302,13 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_call_return @id -id ::punk::console::ansi::move_call_return
@cmd -name punk::console::ansi::move_call_return -summary "Move cursor to row,col, run script, then return cursor to its previous position." @cmd -name punk::console::ansi::move_call_return -summary "Move cursor to row,col, run script, then return cursor to its previous position."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 3 -max 3
row -type integer -help "row number - starting at 1" row -type integer -help "row number - starting at 1"
col -type integer -help "column number - starting at 1" col -type integer -help "column number - starting at 1"
script -type string script -type string
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc move_call_return {row col script args} { proc move_call_return {row col script args} {
#see PUNKARGS id ::punk::console::ansi::move_call_return #see PUNKARGS id ::punk::console::ansi::move_call_return
@ -4252,10 +4323,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::scroll_up @id -id ::punk::console::ansi::scroll_up
@cmd -name punk::console::ansi::scroll_up -summary "Emit scroll-up sequence." @cmd -name punk::console::ansi::scroll_up -summary "Emit scroll-up sequence."
@leaders
n -type integer -help "number of rows to scroll"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
n -type integer -help "number of rows to scroll"
}] }]
proc scroll_up {n args} { proc scroll_up {n args} {
#see PUNKARGS id ::punk::console::ansi::scroll_up #see PUNKARGS id ::punk::console::ansi::scroll_up
@ -4264,10 +4336,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::scroll_down @id -id ::punk::console::ansi::scroll_down
@cmd -name punk::console::ansi::scroll_down -summary "Emit scroll-down sequence." @cmd -name punk::console::ansi::scroll_down -summary "Emit scroll-down sequence."
@leaders
n -type integer -help "number of rows to scroll"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
n -type integer -help "number of rows to scroll"
}] }]
proc scroll_down {n args} { proc scroll_down {n args} {
#see PUNKARGS id ::punk::console::ansi::scroll_down #see PUNKARGS id ::punk::console::ansi::scroll_down
@ -4355,10 +4428,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::insert_spaces @id -id ::punk::console::ansi::insert_spaces
@cmd -name punk::console::ansi::insert_spaces -summary "Emit insert-spaces (ICH) sequence." @cmd -name punk::console::ansi::insert_spaces -summary "Emit insert-spaces (ICH) sequence."
@leaders
count -type integer
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
count -type integer
}] }]
proc insert_spaces {count args} { proc insert_spaces {count args} {
#see PUNKARGS id ::punk::console::ansi::insert_spaces #see PUNKARGS id ::punk::console::ansi::insert_spaces
@ -4367,10 +4441,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::delete_characters @id -id ::punk::console::ansi::delete_characters
@cmd -name punk::console::ansi::delete_characters -summary "Emit delete-characters (DCH) sequence." @cmd -name punk::console::ansi::delete_characters -summary "Emit delete-characters (DCH) sequence."
@leaders
count -type integer
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
count -type integer
}] }]
proc delete_characters {count args} { proc delete_characters {count args} {
#see PUNKARGS id ::punk::console::ansi::delete_characters #see PUNKARGS id ::punk::console::ansi::delete_characters
@ -4379,10 +4454,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::erase_characters @id -id ::punk::console::ansi::erase_characters
@cmd -name punk::console::ansi::erase_characters -summary "Emit erase-characters (ECH) sequence." @cmd -name punk::console::ansi::erase_characters -summary "Emit erase-characters (ECH) sequence."
@leaders
count -type integer
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
count -type integer
}] }]
proc erase_characters {count args} { proc erase_characters {count args} {
#see PUNKARGS id ::punk::console::ansi::erase_characters #see PUNKARGS id ::punk::console::ansi::erase_characters
@ -4391,10 +4467,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::insert_lines @id -id ::punk::console::ansi::insert_lines
@cmd -name punk::console::ansi::insert_lines -summary "Emit insert-lines (IL) sequence." @cmd -name punk::console::ansi::insert_lines -summary "Emit insert-lines (IL) sequence."
@leaders
count -type integer
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
count -type integer
}] }]
proc insert_lines {count args} { proc insert_lines {count args} {
#see PUNKARGS id ::punk::console::ansi::insert_lines #see PUNKARGS id ::punk::console::ansi::insert_lines
@ -4403,10 +4480,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::delete_lines @id -id ::punk::console::ansi::delete_lines
@cmd -name punk::console::ansi::delete_lines -summary "Emit delete-lines (DL) sequence." @cmd -name punk::console::ansi::delete_lines -summary "Emit delete-lines (DL) sequence."
@leaders
count -type integer
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
count -type integer
}] }]
proc delete_lines {count args} { proc delete_lines {count args} {
#see PUNKARGS id ::punk::console::ansi::delete_lines #see PUNKARGS id ::punk::console::ansi::delete_lines
@ -4415,10 +4493,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::titleset @id -id ::punk::console::ansi::titleset
@cmd -name punk::console::ansi::titleset -summary "Emit window-title (OSC) sequence." @cmd -name punk::console::ansi::titleset -summary "Emit window-title (OSC) sequence."
@leaders
windowtitle -type string
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
windowtitle -type string
}] }]
proc titleset {windowtitle args} { proc titleset {windowtitle args} {
#see PUNKARGS id ::punk::console::ansi::titleset #see PUNKARGS id ::punk::console::ansi::titleset
@ -4447,10 +4526,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::titleset @id -id ::punk::console::titleset
@cmd -name punk::console::titleset -summary "Set the terminal window title (ANSI or local mechanism)." @cmd -name punk::console::titleset -summary "Set the terminal window title (ANSI or local mechanism)."
@leaders
windowtitle -type string
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
windowtitle -type string
}] }]
proc titleset {windowtitle args} { proc titleset {windowtitle args} {
#see PUNKARGS id ::punk::console::titleset #see PUNKARGS id ::punk::console::titleset
@ -4472,11 +4552,12 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::move @id -id ::punk::console::move
@cmd -name punk::console::move -summary "Emit ANSI or vt52 sequence moving the cursor to row,col." @cmd -name punk::console::move -summary "Emit ANSI or vt52 sequence moving the cursor to row,col."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 2 -max 2
row -type integer -help "row number - starting at 1" row -type integer -help "row number - starting at 1"
col -type integer -help "column number - starting at 1" col -type integer -help "column number - starting at 1"
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
catch {rename move ""} catch {rename move ""}
proc move {row col args} { proc move {row col args} {
@ -5471,7 +5552,7 @@ namespace eval ::punk::args::register {
## Ready ## Ready
package provide punk::console [namespace eval punk::console { package provide punk::console [namespace eval punk::console {
variable version variable version
set version 0.2.0 set version 0.3.0
}] }]
return return

221
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/console-0.2.0.tm → src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/console-0.3.0.tm

@ -7,7 +7,7 @@
# (C) 2023 # (C) 2023
# #
# @@ Meta Begin # @@ Meta Begin
# Application punk::console 0.2.0 # Application punk::console 0.3.0
# Meta platform tcl # Meta platform tcl
# Meta license <unspecified> # Meta license <unspecified>
# @@ Meta End # @@ Meta End
@ -17,7 +17,7 @@
# doctools header # doctools header
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ # ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
#*** !doctools #*** !doctools
#[manpage_begin punkshell_module_punk::console 0 0.2.0] #[manpage_begin punkshell_module_punk::console 0 0.3.0]
#[copyright "2024"] #[copyright "2024"]
#[titledesc {punk console}] [comment {-- Name section and table of contents description --}] #[titledesc {punk console}] [comment {-- Name section and table of contents description --}]
#[moddesc {punk console}] [comment {-- Description at end of page heading --}] #[moddesc {punk console}] [comment {-- Description at end of page heading --}]
@ -304,7 +304,21 @@ namespace eval punk::console {
#(safe for tails that otherwise hold row/col/data triples - a well-formed triple never has #(safe for tails that otherwise hold row/col/data triples - a well-formed triple never has
#the literal '-console' in its 2nd-last position) #the literal '-console' in its 2nd-last position)
#The non-var forms additionally require that nothing else remains in the tail. #The non-var forms additionally require that nothing else remains in the tail.
punk::args::define {
@id -id ::punk::console::internal::opt_console_out_var
@cmd -name punk::console::internal::opt_console_out_var -summary\
"Strip a trailing '-console <consolespec>' pair from the named args variable, returning the resolved output channel."\
-help\
"The variable named by argsvar in the caller's frame is modified in place (the
-console pair is removed if present; other content such as row/col/data triples
is left alone). Returns stdout when no -console pair is present."
@leaders
argsvar -type string -help\
"Name of an args-tail list variable in the caller's frame."
@values -min 0 -max 0
}
proc opt_console_out_var {argsvar} { proc opt_console_out_var {argsvar} {
#see PUNKARGS id ::punk::console::internal::opt_console_out_var
upvar 1 $argsvar tail upvar 1 $argsvar tail
if {[llength $tail] >= 2 && [lindex $tail end-1] eq "-console"} { if {[llength $tail] >= 2 && [lindex $tail end-1] eq "-console"} {
set out [dict get [punk::console::console_spec_resolve [lindex $tail end]] out] set out [dict get [punk::console::console_spec_resolve [lindex $tail end]] out]
@ -313,7 +327,21 @@ namespace eval punk::console {
} }
return stdout return stdout
} }
punk::args::define {
@id -id ::punk::console::internal::opt_console_channels_var
@cmd -name punk::console::internal::opt_console_channels_var -summary\
"Strip a trailing '-console <consolespec>' pair from the named args variable, returning the canonical {in out} channel pair."\
-help\
"The variable named by argsvar in the caller's frame is modified in place (the
-console pair is removed if present; other content such as row/col/data triples
is left alone). Returns {stdin stdout} when no -console pair is present."
@leaders
argsvar -type string -help\
"Name of an args-tail list variable in the caller's frame."
@values -min 0 -max 0
}
proc opt_console_channels_var {argsvar} { proc opt_console_channels_var {argsvar} {
#see PUNKARGS id ::punk::console::internal::opt_console_channels_var
upvar 1 $argsvar tail upvar 1 $argsvar tail
if {[llength $tail] >= 2 && [lindex $tail end-1] eq "-console"} { if {[llength $tail] >= 2 && [lindex $tail end-1] eq "-console"} {
set cinfo [punk::console::console_spec_resolve [lindex $tail end]] set cinfo [punk::console::console_spec_resolve [lindex $tail end]]
@ -322,14 +350,40 @@ namespace eval punk::console {
} }
return {stdin stdout} return {stdin stdout}
} }
punk::args::define {
@id -id ::punk::console::internal::opt_console_out
@cmd -name punk::console::internal::opt_console_out -summary\
"Resolve an emit-function args-tail (empty or exactly '-console <consolespec>') to an output channel."\
-help\
"Errors if the tail contains anything other than a single optional -console pair.
Returns stdout for an empty tail."
@leaders
argstail -type list -help\
"The args-tail value: {} or {-console <consolespec>}."
@values -min 0 -max 0
}
proc opt_console_out {argstail} { proc opt_console_out {argstail} {
#see PUNKARGS id ::punk::console::internal::opt_console_out
set out [opt_console_out_var argstail] set out [opt_console_out_var argstail]
if {[llength $argstail]} { if {[llength $argstail]} {
error "expected optional trailing '-console <consolespec>' - got '$argstail'" error "expected optional trailing '-console <consolespec>' - got '$argstail'"
} }
return $out return $out
} }
punk::args::define {
@id -id ::punk::console::internal::opt_console_channels
@cmd -name punk::console::internal::opt_console_channels -summary\
"Resolve an emit-function args-tail (empty or exactly '-console <consolespec>') to a canonical {in out} channel pair."\
-help\
"Errors if the tail contains anything other than a single optional -console pair.
Returns {stdin stdout} for an empty tail."
@leaders
argstail -type list -help\
"The args-tail value: {} or {-console <consolespec>}."
@values -min 0 -max 0
}
proc opt_console_channels {argstail} { proc opt_console_channels {argstail} {
#see PUNKARGS id ::punk::console::internal::opt_console_channels
set channels [opt_console_channels_var argstail] set channels [opt_console_channels_var argstail]
if {[llength $argstail]} { if {[llength $argstail]} {
error "expected optional trailing '-console <consolespec>' - got '$argstail'" error "expected optional trailing '-console <consolespec>' - got '$argstail'"
@ -1004,13 +1058,14 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::vt52 @id -id ::punk::console::vt52
@cmd -name punk::console::vt52 -summary "Query or set vt52 terminal mode." @cmd -name punk::console::vt52 -summary "Query or set vt52 terminal mode."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 1
onoff -type boolean -optional 1 -help\ onoff -type boolean -optional 1 -help\
"Omit to query the current vt52 state. "Omit to query the current vt52 state.
The vt52 state is a per-console fact (see console_fact_get); the process-default The vt52 state is a per-console fact (see console_fact_get); the process-default
console's state is mirrored in the legacy ::punk::console::is_vt52 variable." console's state is mirrored in the legacy ::punk::console::is_vt52 variable."
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc vt52 {args} { proc vt52 {args} {
#see PUNKARGS id ::punk::console::vt52 #see PUNKARGS id ::punk::console::vt52
@ -1604,13 +1659,14 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::set_tabstop_width @id -id ::punk::console::set_tabstop_width
@cmd -name punk::console::set_tabstop_width -summary "Emit sequences setting evenly spaced terminal tabstops." @cmd -name punk::console::set_tabstop_width -summary "Emit sequences setting evenly spaced terminal tabstops."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} w -type integer -default 8 -optional 1 -help\
@values -min 0 -max 1
w -type integer -default 8 -help\
"Tabstop spacing in character cells. "Tabstop spacing in character cells.
The tabwidth record is a per-console fact (see console_fact_get); the process-default The tabwidth record is a per-console fact (see console_fact_get); the process-default
console's record is mirrored in the legacy ::punk::console::tabwidth variable." console's record is mirrored in the legacy ::punk::console::tabwidth variable."
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc set_tabstop_width {args} { proc set_tabstop_width {args} {
#see PUNKARGS id ::punk::console::set_tabstop_width #see PUNKARGS id ::punk::console::set_tabstop_width
@ -3472,12 +3528,13 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::test_char_width @id -id ::punk::console::test_char_width
@cmd -name punk::console::test_char_width -summary "Measure a string's rendered width via cursor position reports." @cmd -name punk::console::test_char_width -summary "Measure a string's rendered width via cursor position reports."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 2
char_or_string -type string char_or_string -type string
emit -type boolean -default 0 -optional 1 -help\ emit -type boolean -default 0 -optional 1 -help\
"Leave the test string visible instead of erasing the line around the test." "Leave the test string visible instead of erasing the line around the test."
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc test_char_width {char_or_string args} { proc test_char_width {char_or_string args} {
#see PUNKARGS id ::punk::console::test_char_width #see PUNKARGS id ::punk::console::test_char_width
@ -3548,12 +3605,13 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::test_string_cursor @id -id ::punk::console::test_string_cursor
@cmd -name punk::console::test_string_cursor -summary "Report cursor row/column offsets produced by emitting a string (uses alt screen)." @cmd -name punk::console::test_string_cursor -summary "Report cursor row/column offsets produced by emitting a string (uses alt screen)."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 2
teststring -type string teststring -type string
emit -type boolean -default 0 -optional 1 -help\ emit -type boolean -default 0 -optional 1 -help\
"Leave the test string visible instead of erasing the line around the test." "Leave the test string visible instead of erasing the line around the test."
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc test_string_cursor {teststring args} { proc test_string_cursor {teststring args} {
#see PUNKARGS id ::punk::console::test_string_cursor #see PUNKARGS id ::punk::console::test_string_cursor
@ -3960,13 +4018,14 @@ namespace eval punk::console {
modes are supported. modes are supported.
} }
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 2 -max 2
row -type integer -help\ row -type integer -help\
"row number - starting at 1" "row number - starting at 1"
col -type integer -help\ col -type integer -help\
"column number - starting at 1" "column number - starting at 1"
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc move {row col args} { proc move {row col args} {
#see PUNKARGS id ::punk::console::ansi::move #see PUNKARGS id ::punk::console::ansi::move
@ -3982,10 +4041,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_forward @id -id ::punk::console::ansi::move_forward
@cmd -name punk::console::ansi::move_forward -summary "Emit cursor-forward sequence (ANSI or vt52)." @cmd -name punk::console::ansi::move_forward -summary "Emit cursor-forward sequence (ANSI or vt52)."
@leaders
n -type integer -help "number of columns to move forward"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
n -type integer -help "number of columns to move forward"
}] }]
proc move_forward {n args} { proc move_forward {n args} {
#see PUNKARGS id ::punk::console::ansi::move_forward #see PUNKARGS id ::punk::console::ansi::move_forward
@ -4000,10 +4060,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_back @id -id ::punk::console::ansi::move_back
@cmd -name punk::console::ansi::move_back -summary "Emit cursor-back sequence (ANSI or vt52)." @cmd -name punk::console::ansi::move_back -summary "Emit cursor-back sequence (ANSI or vt52)."
@leaders
n -type integer -help "number of columns to move back"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
n -type integer -help "number of columns to move back"
}] }]
proc move_back {n args} { proc move_back {n args} {
#see PUNKARGS id ::punk::console::ansi::move_back #see PUNKARGS id ::punk::console::ansi::move_back
@ -4018,10 +4079,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_up @id -id ::punk::console::ansi::move_up
@cmd -name punk::console::ansi::move_up -summary "Emit cursor-up sequence (ANSI or vt52)." @cmd -name punk::console::ansi::move_up -summary "Emit cursor-up sequence (ANSI or vt52)."
@leaders
n -type integer -help "number of rows to move up"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
n -type integer -help "number of rows to move up"
}] }]
proc move_up {n args} { proc move_up {n args} {
#see PUNKARGS id ::punk::console::ansi::move_up #see PUNKARGS id ::punk::console::ansi::move_up
@ -4036,10 +4098,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_down @id -id ::punk::console::ansi::move_down
@cmd -name punk::console::ansi::move_down -summary "Emit cursor-down sequence (ANSI or vt52)." @cmd -name punk::console::ansi::move_down -summary "Emit cursor-down sequence (ANSI or vt52)."
@leaders
n -type integer -help "number of rows to move down"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
n -type integer -help "number of rows to move down"
}] }]
proc move_down {n args} { proc move_down {n args} {
#see PUNKARGS id ::punk::console::ansi::move_down #see PUNKARGS id ::punk::console::ansi::move_down
@ -4054,10 +4117,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_column @id -id ::punk::console::ansi::move_column
@cmd -name punk::console::ansi::move_column -summary "Emit move-to-column sequence (ANSI or vt52)." @cmd -name punk::console::ansi::move_column -summary "Emit move-to-column sequence (ANSI or vt52)."
@leaders
col -type integer -help "column number - starting at 1"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
col -type integer -help "column number - starting at 1"
}] }]
proc move_column {col args} { proc move_column {col args} {
#see PUNKARGS id ::punk::console::ansi::move_column #see PUNKARGS id ::punk::console::ansi::move_column
@ -4072,10 +4136,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_row @id -id ::punk::console::ansi::move_row
@cmd -name punk::console::ansi::move_row -summary "Emit move-to-row sequence." @cmd -name punk::console::ansi::move_row -summary "Emit move-to-row sequence."
@leaders
row -type integer -help "row number - starting at 1"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
row -type integer -help "row number - starting at 1"
}] }]
proc move_row {row args} { proc move_row {row args} {
#see PUNKARGS id ::punk::console::ansi::move_row #see PUNKARGS id ::punk::console::ansi::move_row
@ -4084,14 +4149,15 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_emit @id -id ::punk::console::ansi::move_emit
@cmd -name punk::console::ansi::move_emit -summary "Emit data at row,col (ANSI or vt52)." @cmd -name punk::console::ansi::move_emit -summary "Emit data at row,col (ANSI or vt52)."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 3 -max -1
row -type integer -help "row number - starting at 1" row -type integer -help "row number - starting at 1"
col -type integer -help "column number - starting at 1" col -type integer -help "column number - starting at 1"
data -type string data -type string
triple -type any -optional 1 -multiple 1 -help\ triple -type any -optional 1 -multiple 1 -help\
"additional row col data triples" "additional row col data triples"
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc move_emit {row col data args} { proc move_emit {row col data args} {
#see PUNKARGS id ::punk::console::ansi::move_emit #see PUNKARGS id ::punk::console::ansi::move_emit
@ -4106,14 +4172,15 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_emit_return @id -id ::punk::console::ansi::move_emit_return
@cmd -name punk::console::ansi::move_emit_return -summary "Emit data at row,col then return cursor to its previous position." @cmd -name punk::console::ansi::move_emit_return -summary "Emit data at row,col then return cursor to its previous position."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 3 -max -1
row -type integer -help "row number - starting at 1" row -type integer -help "row number - starting at 1"
col -type integer -help "column number - starting at 1" col -type integer -help "column number - starting at 1"
data -type string data -type string
triple -type any -optional 1 -multiple 1 -help\ triple -type any -optional 1 -multiple 1 -help\
"additional row col data triples" "additional row col data triples"
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc move_emit_return {row col data args} { proc move_emit_return {row col data args} {
#see PUNKARGS id ::punk::console::ansi::move_emit_return #see PUNKARGS id ::punk::console::ansi::move_emit_return
@ -4137,12 +4204,13 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_emitblock_return @id -id ::punk::console::ansi::move_emitblock_return
@cmd -name punk::console::ansi::move_emitblock_return -summary "Emit a multiline textblock at row,col then return cursor to its previous position." @cmd -name punk::console::ansi::move_emitblock_return -summary "Emit a multiline textblock at row,col then return cursor to its previous position."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 3 -max 3
row -type integer -help "row number - starting at 1" row -type integer -help "row number - starting at 1"
col -type integer -help "column number - starting at 1" col -type integer -help "column number - starting at 1"
textblock -type string textblock -type string
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc move_emitblock_return {row col textblock args} { proc move_emitblock_return {row col textblock args} {
#see PUNKARGS id ::punk::console::ansi::move_emitblock_return #see PUNKARGS id ::punk::console::ansi::move_emitblock_return
@ -4164,14 +4232,15 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::cursorsave_move_emit_return @id -id ::punk::console::ansi::cursorsave_move_emit_return
@cmd -name punk::console::ansi::cursorsave_move_emit_return -summary "Emit data at row,col bracketed by cursor save/restore (ANSI or vt52)." @cmd -name punk::console::ansi::cursorsave_move_emit_return -summary "Emit data at row,col bracketed by cursor save/restore (ANSI or vt52)."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 3 -max -1
row -type integer -help "row number - starting at 1" row -type integer -help "row number - starting at 1"
col -type integer -help "column number - starting at 1" col -type integer -help "column number - starting at 1"
data -type string data -type string
triple -type any -optional 1 -multiple 1 -help\ triple -type any -optional 1 -multiple 1 -help\
"additional row col data triples" "additional row col data triples"
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc cursorsave_move_emit_return {row col data args} { proc cursorsave_move_emit_return {row col data args} {
#see PUNKARGS id ::punk::console::ansi::cursorsave_move_emit_return #see PUNKARGS id ::punk::console::ansi::cursorsave_move_emit_return
@ -4199,12 +4268,13 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::cursorsave_move_emitblock_return @id -id ::punk::console::ansi::cursorsave_move_emitblock_return
@cmd -name punk::console::ansi::cursorsave_move_emitblock_return -summary "Emit a multiline textblock at row,col bracketed by cursor save/restore (ANSI or vt52)." @cmd -name punk::console::ansi::cursorsave_move_emitblock_return -summary "Emit a multiline textblock at row,col bracketed by cursor save/restore (ANSI or vt52)."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 3 -max 3
row -type integer -help "row number - starting at 1" row -type integer -help "row number - starting at 1"
col -type integer -help "column number - starting at 1" col -type integer -help "column number - starting at 1"
textblock -type string textblock -type string
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc cursorsave_move_emitblock_return {row col textblock args} { proc cursorsave_move_emitblock_return {row col textblock args} {
#see PUNKARGS id ::punk::console::ansi::cursorsave_move_emitblock_return #see PUNKARGS id ::punk::console::ansi::cursorsave_move_emitblock_return
@ -4232,12 +4302,13 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::move_call_return @id -id ::punk::console::ansi::move_call_return
@cmd -name punk::console::ansi::move_call_return -summary "Move cursor to row,col, run script, then return cursor to its previous position." @cmd -name punk::console::ansi::move_call_return -summary "Move cursor to row,col, run script, then return cursor to its previous position."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 3 -max 3
row -type integer -help "row number - starting at 1" row -type integer -help "row number - starting at 1"
col -type integer -help "column number - starting at 1" col -type integer -help "column number - starting at 1"
script -type string script -type string
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
proc move_call_return {row col script args} { proc move_call_return {row col script args} {
#see PUNKARGS id ::punk::console::ansi::move_call_return #see PUNKARGS id ::punk::console::ansi::move_call_return
@ -4252,10 +4323,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::scroll_up @id -id ::punk::console::ansi::scroll_up
@cmd -name punk::console::ansi::scroll_up -summary "Emit scroll-up sequence." @cmd -name punk::console::ansi::scroll_up -summary "Emit scroll-up sequence."
@leaders
n -type integer -help "number of rows to scroll"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
n -type integer -help "number of rows to scroll"
}] }]
proc scroll_up {n args} { proc scroll_up {n args} {
#see PUNKARGS id ::punk::console::ansi::scroll_up #see PUNKARGS id ::punk::console::ansi::scroll_up
@ -4264,10 +4336,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::scroll_down @id -id ::punk::console::ansi::scroll_down
@cmd -name punk::console::ansi::scroll_down -summary "Emit scroll-down sequence." @cmd -name punk::console::ansi::scroll_down -summary "Emit scroll-down sequence."
@leaders
n -type integer -help "number of rows to scroll"
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
n -type integer -help "number of rows to scroll"
}] }]
proc scroll_down {n args} { proc scroll_down {n args} {
#see PUNKARGS id ::punk::console::ansi::scroll_down #see PUNKARGS id ::punk::console::ansi::scroll_down
@ -4355,10 +4428,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::insert_spaces @id -id ::punk::console::ansi::insert_spaces
@cmd -name punk::console::ansi::insert_spaces -summary "Emit insert-spaces (ICH) sequence." @cmd -name punk::console::ansi::insert_spaces -summary "Emit insert-spaces (ICH) sequence."
@leaders
count -type integer
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
count -type integer
}] }]
proc insert_spaces {count args} { proc insert_spaces {count args} {
#see PUNKARGS id ::punk::console::ansi::insert_spaces #see PUNKARGS id ::punk::console::ansi::insert_spaces
@ -4367,10 +4441,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::delete_characters @id -id ::punk::console::ansi::delete_characters
@cmd -name punk::console::ansi::delete_characters -summary "Emit delete-characters (DCH) sequence." @cmd -name punk::console::ansi::delete_characters -summary "Emit delete-characters (DCH) sequence."
@leaders
count -type integer
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
count -type integer
}] }]
proc delete_characters {count args} { proc delete_characters {count args} {
#see PUNKARGS id ::punk::console::ansi::delete_characters #see PUNKARGS id ::punk::console::ansi::delete_characters
@ -4379,10 +4454,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::erase_characters @id -id ::punk::console::ansi::erase_characters
@cmd -name punk::console::ansi::erase_characters -summary "Emit erase-characters (ECH) sequence." @cmd -name punk::console::ansi::erase_characters -summary "Emit erase-characters (ECH) sequence."
@leaders
count -type integer
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
count -type integer
}] }]
proc erase_characters {count args} { proc erase_characters {count args} {
#see PUNKARGS id ::punk::console::ansi::erase_characters #see PUNKARGS id ::punk::console::ansi::erase_characters
@ -4391,10 +4467,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::insert_lines @id -id ::punk::console::ansi::insert_lines
@cmd -name punk::console::ansi::insert_lines -summary "Emit insert-lines (IL) sequence." @cmd -name punk::console::ansi::insert_lines -summary "Emit insert-lines (IL) sequence."
@leaders
count -type integer
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
count -type integer
}] }]
proc insert_lines {count args} { proc insert_lines {count args} {
#see PUNKARGS id ::punk::console::ansi::insert_lines #see PUNKARGS id ::punk::console::ansi::insert_lines
@ -4403,10 +4480,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::delete_lines @id -id ::punk::console::ansi::delete_lines
@cmd -name punk::console::ansi::delete_lines -summary "Emit delete-lines (DL) sequence." @cmd -name punk::console::ansi::delete_lines -summary "Emit delete-lines (DL) sequence."
@leaders
count -type integer
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
count -type integer
}] }]
proc delete_lines {count args} { proc delete_lines {count args} {
#see PUNKARGS id ::punk::console::ansi::delete_lines #see PUNKARGS id ::punk::console::ansi::delete_lines
@ -4415,10 +4493,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::ansi::titleset @id -id ::punk::console::ansi::titleset
@cmd -name punk::console::ansi::titleset -summary "Emit window-title (OSC) sequence." @cmd -name punk::console::ansi::titleset -summary "Emit window-title (OSC) sequence."
@leaders
windowtitle -type string
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
windowtitle -type string
}] }]
proc titleset {windowtitle args} { proc titleset {windowtitle args} {
#see PUNKARGS id ::punk::console::ansi::titleset #see PUNKARGS id ::punk::console::ansi::titleset
@ -4447,10 +4526,11 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::titleset @id -id ::punk::console::titleset
@cmd -name punk::console::titleset -summary "Set the terminal window title (ANSI or local mechanism)." @cmd -name punk::console::titleset -summary "Set the terminal window title (ANSI or local mechanism)."
@leaders
windowtitle -type string
@opts @opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]} ${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 1 -max 1 @values -min 0 -max 0
windowtitle -type string
}] }]
proc titleset {windowtitle args} { proc titleset {windowtitle args} {
#see PUNKARGS id ::punk::console::titleset #see PUNKARGS id ::punk::console::titleset
@ -4472,11 +4552,12 @@ namespace eval punk::console {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@id -id ::punk::console::move @id -id ::punk::console::move
@cmd -name punk::console::move -summary "Emit ANSI or vt52 sequence moving the cursor to row,col." @cmd -name punk::console::move -summary "Emit ANSI or vt52 sequence moving the cursor to row,col."
@opts @leaders
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 2 -max 2
row -type integer -help "row number - starting at 1" row -type integer -help "row number - starting at 1"
col -type integer -help "column number - starting at 1" col -type integer -help "column number - starting at 1"
@opts
${[punk::args::resolved_def -types opts ::punk::console::argdoc::console_emit_opts -console]}
@values -min 0 -max 0
}] }]
catch {rename move ""} catch {rename move ""}
proc move {row col args} { proc move {row col args} {
@ -5471,7 +5552,7 @@ namespace eval ::punk::args::register {
## Ready ## Ready
package provide punk::console [namespace eval punk::console { package provide punk::console [namespace eval punk::console {
variable version variable version
set version 0.2.0 set version 0.3.0
}] }]
return return

5560
src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/console-0.3.0.tm

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save