Julian Noble
8 months ago
59 changed files with 3793 additions and 1020 deletions
@ -0,0 +1,354 @@ |
|||||||
|
'\" |
||||||
|
'\" Generated from file '_module_overtype-1\&.6\&.2\&.tm\&.man' by tcllib/doctools with format 'nroff' |
||||||
|
'\" Copyright (c) 2024 |
||||||
|
'\" |
||||||
|
.TH "overtype_module_overtype" 0 1\&.6\&.2 doc "overtype text layout" |
||||||
|
.\" 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 |
||||||
|
overtype_module_overtype \- overtype text layout - ansi aware |
||||||
|
.SH SYNOPSIS |
||||||
|
package require \fBovertype \fR |
||||||
|
.sp |
||||||
|
\fBovertype::left\fR \fIargs\fR |
||||||
|
.sp |
||||||
|
\fBovertype::renderline\fR \fIargs\fR |
||||||
|
.sp |
||||||
|
.BE |
||||||
|
.SH DESCRIPTION |
||||||
|
.PP |
||||||
|
- |
||||||
|
.SH OVERVIEW |
||||||
|
.PP |
||||||
|
overview of overtype |
||||||
|
.SS CONCEPTS |
||||||
|
.PP |
||||||
|
- |
||||||
|
.SS DEPENDENCIES |
||||||
|
.PP |
||||||
|
packages used by overtype |
||||||
|
.IP \(bu |
||||||
|
\fBTcl 8\&.6\fR |
||||||
|
.IP \(bu |
||||||
|
\fBtextutil\fR |
||||||
|
.IP \(bu |
||||||
|
\fBpunk::ansi\fR |
||||||
|
.sp |
||||||
|
- required to detect, split, strip and calculate lengths of text possibly containing ansi codes |
||||||
|
.IP \(bu |
||||||
|
\fBpunk::char\fR |
||||||
|
.sp |
||||||
|
- box drawing - and also unicode character width determination for proper layout of text with double-column-width chars |
||||||
|
.PP |
||||||
|
.SH API |
||||||
|
.SS "NAMESPACE OVERTYPE" |
||||||
|
.PP |
||||||
|
Core API functions for overtype |
||||||
|
.TP |
||||||
|
\fBovertype::left\fR \fIargs\fR |
||||||
|
.sp |
||||||
|
usage: ?-transparent [0|1]? ?-overflow [1|0]? ?-ellipsis [1|0]? ?-ellipsistext \&.\&.\&.? undertext overtext |
||||||
|
.TP |
||||||
|
\fBovertype::renderline\fR \fIargs\fR |
||||||
|
.sp |
||||||
|
renderline is the core engine for overtype string processing (frames & textblocks), and the raw mode commandline repl for the Tcl Punk Shell |
||||||
|
.sp |
||||||
|
It is also a central part of an ansi (micro) virtual terminal-emulator of sorts |
||||||
|
.sp |
||||||
|
This system does a half decent job at rendering 90's ANSI art to manipulable colour text blocks that can be joined & framed for layout display within a unix or windows terminal |
||||||
|
.sp |
||||||
|
Renderline helps maintain ANSI text styling reset/replay codes so that the styling of one block doesn't affect another\&. |
||||||
|
.sp |
||||||
|
Calling on the punk::ansi library - it can coalesce codes to keep the size down\&. |
||||||
|
.sp |
||||||
|
It is a giant mess of doing exactly what common wisdom says not to do\&.\&.\&. lots at once\&. |
||||||
|
.sp |
||||||
|
renderline is part of the Unicode and ANSI aware Overtype system which 'renders' a block of text onto a static underlay |
||||||
|
.sp |
||||||
|
The underlay is generally expected to be an ordered set of lines or a rectangular text block analogous to a terminal screen - but it can also be ragged in line length, or just blank\&. |
||||||
|
.sp |
||||||
|
The overlay couuld be similar - in which case it may often be used to overwrite a column or section of the underlay\&. |
||||||
|
.sp |
||||||
|
The overlay could however be a sequence of ANSI-laden text that jumps all over the place\&. |
||||||
|
.sp |
||||||
|
renderline itself only deals with a single line - or sometimes a single character\&. It is generally called from a loop that does further terminal-like or textblock processing\&. |
||||||
|
.sp |
||||||
|
By suppyling the -info 1 option - it can return various fields indicating the state of the render\&. |
||||||
|
.sp |
||||||
|
The main 3 are the result, overflow_right, and unapplied\&. |
||||||
|
.sp |
||||||
|
Renderline handles cursor movements from either keystrokes or ANSI sequences but for a full system the aforementioned loop will need to be in place to manage the set of lines under manipulation\&. |
||||||
|
.PP |
||||||
|
.SH KEYWORDS |
||||||
|
ansi, module, text |
||||||
|
.SH COPYRIGHT |
||||||
|
.nf |
||||||
|
Copyright (c) 2024 |
||||||
|
|
||||||
|
.fi |
@ -0,0 +1,482 @@ |
|||||||
|
'\" |
||||||
|
'\" Generated from file '_module_sshrun-0\&.1\&.0\&.tm\&.man' by tcllib/doctools with format 'nroff' |
||||||
|
'\" Copyright (c) 2009 |
||||||
|
'\" |
||||||
|
.TH "shellspy_module_punk::sshrun" 0 0\&.1\&.0 doc "punk::sshrun tclssh clone" |
||||||
|
.\" 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_punk::sshrun \- Tcl procedures to execute tcl scripts in remote hosts |
||||||
|
.SH SYNOPSIS |
||||||
|
package require \fBpunk::sshrun \fR |
||||||
|
.sp |
||||||
|
connect \fIargs\fR |
||||||
|
.sp |
||||||
|
disconnect \fIhost\fR |
||||||
|
.sp |
||||||
|
push \fIhost\fR \fIscript\fR |
||||||
|
.sp |
||||||
|
send \fIhost\fR |
||||||
|
.sp |
||||||
|
send_exit \fIhost\fR |
||||||
|
.sp |
||||||
|
send_exit \fIhost\fR |
||||||
|
.sp |
||||||
|
pop_all \fIhost\fR \fIoutput_varname\fR |
||||||
|
.sp |
||||||
|
pop_read \fIhost\fR \fInumbytes\fR \fIoutput_varname\fR |
||||||
|
.sp |
||||||
|
hfileevent \fIhost\fR \fIreadable_writable\fR \fIscript\fR |
||||||
|
.sp |
||||||
|
hconfigure \fIhost\fR \fIargs\fR |
||||||
|
.sp |
||||||
|
rexec \fIhost\fR \fIscript\fR \fIoutput_varname\fR |
||||||
|
.sp |
||||||
|
get_filehandle \fIhost\fR |
||||||
|
.sp |
||||||
|
.BE |
||||||
|
.SH DESCRIPTION |
||||||
|
.PP |
||||||
|
This is a clone of tclssh by Jose F\&. Nieves |
||||||
|
.PP |
||||||
|
The original repo is at: https://bitbucket\&.org/noaaport/tclssh/src/master/ |
||||||
|
.PP |
||||||
|
This version is namespaced under punk::sshrun specifically for the Punk shell project - and may lag the original project or diverge\&. |
||||||
|
.PP |
||||||
|
You are encouraged to use the original Tclssh source from the above URL for your own projects |
||||||
|
.SH OVERVIEW |
||||||
|
.PP |
||||||
|
overview of punk::sshrun |
||||||
|
.PP |
||||||
|
SYNOPSIS |
||||||
|
.PP |
||||||
|
package require punk::sshrun |
||||||
|
.PP |
||||||
|
- |
||||||
|
.PP |
||||||
|
punk::sshrun::connect [-t <tclsh_name>] [-- <ssh_options>] [<user>@]<host> |
||||||
|
.PP |
||||||
|
Defaults: -t tclsh |
||||||
|
.SS CONCEPTS |
||||||
|
.PP |
||||||
|
- |
||||||
|
.SS DEPENDENCIES |
||||||
|
.PP |
||||||
|
packages used by punk::sshrun |
||||||
|
.IP \(bu |
||||||
|
\fBTcl 8\&.6\fR |
||||||
|
.IP \(bu |
||||||
|
\fBcmdline\fR |
||||||
|
.PP |
||||||
|
.SH API |
||||||
|
.SS "NAMESPACE PUNK::SSHRUN::CLASS" |
||||||
|
.PP |
||||||
|
class definitions |
||||||
|
.PP |
||||||
|
.SS "NAMESPACE PUNK::SSHRUN" |
||||||
|
.PP |
||||||
|
Core API functions for punk::sshrun |
||||||
|
.TP |
||||||
|
connect \fIargs\fR |
||||||
|
.sp |
||||||
|
Must be called first\&. |
||||||
|
.sp |
||||||
|
This proc opens an io channel to the tclsh in the remote host (via ssh) that is kept in an internal variable for subsequent use\&. |
||||||
|
.sp |
||||||
|
The file handle can be retrieved if desired through the command: get_filehandle {host} |
||||||
|
.TP |
||||||
|
disconnect \fIhost\fR |
||||||
|
.sp |
||||||
|
Must be called last\&. Closes the filehandle opened by connect\&. |
||||||
|
.TP |
||||||
|
push \fIhost\fR \fIscript\fR |
||||||
|
.sp |
||||||
|
<script> can be any tcl code\&. |
||||||
|
.sp |
||||||
|
For example, if the remote host is named "diablo" |
||||||
|
.CS |
||||||
|
|
||||||
|
|
||||||
|
ssh::push "diablo" "exec date" |
||||||
|
ssh::push "diablo" "exec uname -a" |
||||||
|
|
||||||
|
.CE |
||||||
|
.sp |
||||||
|
The commands are note executed immediately\&. Instead, the "push" proc simply accumulates them in a list that is sent to the host when the "send" procedure is executed\&. |
||||||
|
.sp |
||||||
|
Each push proc inserts the newline '\\n' character after each <script> |
||||||
|
.sp |
||||||
|
In the above example\&. Internally, each <script> is a member of a list, and when the "send" proc is invoked the entire script is constructed as a "join <list> \\n |
||||||
|
.TP |
||||||
|
send \fIhost\fR |
||||||
|
.sp |
||||||
|
This proc does the equivalent of a |
||||||
|
.CS |
||||||
|
|
||||||
|
|
||||||
|
puts <filehandle> [join <script_list> \\n] |
||||||
|
flush <filehandle> |
||||||
|
|
||||||
|
.CE |
||||||
|
.TP |
||||||
|
send_exit \fIhost\fR |
||||||
|
.sp |
||||||
|
This proc is similar to the above, but it "pushes" an exit command at the end of the script\&. The proc does the equivalent of |
||||||
|
.CS |
||||||
|
|
||||||
|
|
||||||
|
ssh::push <host> "exit" |
||||||
|
ssh::send <host> |
||||||
|
|
||||||
|
.CE |
||||||
|
.sp |
||||||
|
The net effect if this is that the remote host's tclsh will exit, so that the filehandle receives an eof and we can use |
||||||
|
.CS |
||||||
|
|
||||||
|
|
||||||
|
[read <filehandle>] |
||||||
|
|
||||||
|
.CE |
||||||
|
.sp |
||||||
|
to read the entire output at once (see the pop proc below) |
||||||
|
.TP |
||||||
|
send_exit \fIhost\fR |
||||||
|
.sp |
||||||
|
After executing a "send", this can be used to read one line of output\&. The proc does the equivalent of |
||||||
|
.CS |
||||||
|
|
||||||
|
|
||||||
|
[gets <filehandle> line] |
||||||
|
|
||||||
|
.CE |
||||||
|
.TP |
||||||
|
pop_all \fIhost\fR \fIoutput_varname\fR |
||||||
|
.sp |
||||||
|
This proc does the equivalent of |
||||||
|
.CS |
||||||
|
|
||||||
|
|
||||||
|
while {[pop_line $host line] >=0} { |
||||||
|
puts $line; |
||||||
|
} |
||||||
|
|
||||||
|
.CE |
||||||
|
.sp |
||||||
|
but all the output is returned as one string in output_varname\&. |
||||||
|
.sp |
||||||
|
It should be used only when we know that the remote host's tclsh will exit, so that the above code will detect the eof and exit |
||||||
|
.sp |
||||||
|
(see the send_exit proc above) |
||||||
|
.sp |
||||||
|
The function returns the number of lines read (0 if nothing is read before encoutering eof) |
||||||
|
.TP |
||||||
|
pop_read \fIhost\fR \fInumbytes\fR \fIoutput_varname\fR |
||||||
|
.sp |
||||||
|
Returns: numbytes read\&. If numbytes is not positive, then read is called without the numbytes argument\&. |
||||||
|
.TP |
||||||
|
hfileevent \fIhost\fR \fIreadable_writable\fR \fIscript\fR |
||||||
|
.sp |
||||||
|
Equivalent to: |
||||||
|
.CS |
||||||
|
|
||||||
|
|
||||||
|
fileevent <filehandle> $readable_writable $script |
||||||
|
|
||||||
|
.CE |
||||||
|
.TP |
||||||
|
hconfigure \fIhost\fR \fIargs\fR |
||||||
|
.TP |
||||||
|
rexec \fIhost\fR \fIscript\fR \fIoutput_varname\fR |
||||||
|
.sp |
||||||
|
shortcut for: |
||||||
|
.CS |
||||||
|
|
||||||
|
|
||||||
|
ssh::rexec_nopop $host $script |
||||||
|
ssh::pop_all $host outputvar |
||||||
|
|
||||||
|
.CE |
||||||
|
.TP |
||||||
|
get_filehandle \fIhost\fR |
||||||
|
.PP |
||||||
|
.SS "NAMESPACE PUNK::SSHRUN::LIB" |
||||||
|
.PP |
||||||
|
Secondary functions that are part of the API |
||||||
|
.PP |
||||||
|
.SH INTERNAL |
||||||
|
.SS "NAMESPACE PUNK::SSHRUN::SYSTEM" |
||||||
|
.PP |
||||||
|
Internal functions that are not part of the API |
||||||
|
.SH KEYWORDS |
||||||
|
module, ssh |
||||||
|
.SH COPYRIGHT |
||||||
|
.nf |
||||||
|
Copyright (c) 2009 |
||||||
|
|
||||||
|
.fi |
@ -1,18 +1,20 @@ |
|||||||
[toc_begin {Table Of Contents} doc] |
[toc_begin {Table Of Contents} doc] |
||||||
[item doc/files/_module_overtype-1.5.2.tm.md overtype_module_overtype {overtype text layout - ansi aware}] |
[item doc/files/_module_overtype-1.6.2.tm.md overtype_module_overtype {overtype text layout - ansi aware}] |
||||||
[item doc/files/_module_overtype-1.5.3.tm.md overtype_module_overtype {overtype text layout - ansi aware}] |
|
||||||
[item doc/files/_module_overtype-1.5.1.tm.md overtype_module_overtype {overtype text layout - ansi aware}] |
|
||||||
[item doc/files/main.md punkshell {punkshell - Core}] |
[item doc/files/main.md punkshell {punkshell - Core}] |
||||||
[item doc/files/project_changes.md punkshell__project_changes {punkshell Changes}] |
[item doc/files/project_changes.md punkshell__project_changes {punkshell Changes}] |
||||||
[item doc/files/project_intro.md punkshell__project_intro {Introduction to punkshell}] |
[item doc/files/project_intro.md punkshell__project_intro {Introduction to punkshell}] |
||||||
[item doc/files/punk/_module_ansi-0.1.0.tm.md punkshell_module_punk::ansi {Ansi string functions}] |
[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/_module_args-0.1.0.tm.md punkshell_module_punk::args {args parsing}] |
||||||
[item doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap {capability provider and handler plugin system}] |
[item doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap {capability provider and handler plugin system}] |
||||||
[item doc/files/punk/_module_char-0.1.0.tm.md punkshell_module_punk::char {character-set and unicode utilities}] |
[item doc/files/punk/_module_char-0.1.0.tm.md punkshell_module_punk::char {character-set and unicode utilities}] |
||||||
[item doc/files/punk/_module_encmime-0.1.0.tm.md punkshell_module_punk::encmime {mime encodings related subset of tcllib mime}] |
[item doc/files/punk/_module_encmime-0.1.0.tm.md punkshell_module_punk::encmime {mime encodings related subset of tcllib mime}] |
||||||
[item doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline {file line-handling utilities}] |
[item doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline {file line-handling utilities}] |
||||||
[item doc/files/punk/_module_flib-0.1.0.tm.md punkshell_module_punk::flib {flib experimental}] |
[item doc/files/punk/_module_flib-0.1.0.tm.md punkshell_module_punk::flib {flib experimental}] |
||||||
[item doc/files/punk/_module_lib-0.1.0.tm.md punkshell_module_punk::lib {punk general utility functions}] |
[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/mix/commandset/_module_project-0.1.0.tm.md punkshell_module_punk::mix::commandset::project {dec commandset - project}] |
||||||
[item doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path {Filesystem path utilities}] |
[item doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path {Filesystem path utilities}] |
||||||
|
[item doc/files/punk/_module_assertion-0.1.0.tm.md shellspy_module_punk::assertion {assertion alternative to control::assert}] |
||||||
|
[item doc/files/punk/_module_basictelnet-0.1.0.tm.md shellspy_module_punk::basictelnet {basic telnet client - DKF/Wiki}] |
||||||
|
[item doc/files/punk/_module_sshrun-0.1.0.tm.md shellspy_module_punk::sshrun {Tcl procedures to execute tcl scripts in remote hosts}] |
||||||
|
[item doc/files/punk/_module_uc-0.1.0.tm.md shellspy_module_punk::uc {Module API}] |
||||||
[toc_end] |
[toc_end] |
||||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@ |
|||||||
doc {doc/toc {{doc/files/project_intro.md punkshell__project_intro {Introduction to punkshell}} {doc/files/_module_overtype-1.5.2.tm.md overtype_module_overtype {overtype text layout - ansi aware}} {doc/files/_module_overtype-1.5.3.tm.md overtype_module_overtype {overtype text layout - ansi aware}} {doc/files/main.md punkshell {punkshell - Core}} {doc/files/punk/_module_flib-0.1.0.tm.md punkshell_module_punk::flib {flib experimental}} {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_fileline-0.1.0.tm.md punkshell_module_punk::fileline {file line-handling utilities}} {doc/files/punk/_module_ansi-0.1.0.tm.md punkshell_module_punk::ansi {Ansi string functions}} {doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap {capability provider and handler plugin system}} {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/files/punk/_module_lib-0.1.0.tm.md punkshell_module_punk::lib {punk general utility functions}} {doc/files/_module_overtype-1.5.1.tm.md overtype_module_overtype {overtype text layout - ansi aware}}}} |
doc {doc/toc {{doc/files/punk/_module_uc-0.1.0.tm.md shellspy_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_assertion-0.1.0.tm.md shellspy_module_punk::assertion {assertion alternative to control::assert}} {doc/files/project_intro.md punkshell__project_intro {Introduction to punkshell}} {doc/files/_module_overtype-1.6.2.tm.md overtype_module_overtype {overtype text layout - ansi aware}} {doc/files/punk/_module_sshrun-0.1.0.tm.md shellspy_module_punk::sshrun {Tcl procedures to execute tcl scripts in remote hosts}} {doc/files/main.md punkshell {punkshell - Core}} {doc/files/punk/_module_flib-0.1.0.tm.md punkshell_module_punk::flib {flib experimental}} {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_basictelnet-0.1.0.tm.md shellspy_module_punk::basictelnet {basic telnet client - DKF/Wiki}} {doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline {file line-handling utilities}} {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/_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}}}} |
File diff suppressed because one or more lines are too long
@ -1,78 +0,0 @@ |
|||||||
|
|
||||||
[//000000001]: # (overtype\_module\_overtype \- overtype text layout) |
|
||||||
[//000000002]: # (Generated from file '\_module\_overtype\-1\.5\.1\.tm\.man' by tcllib/doctools with format 'markdown') |
|
||||||
[//000000003]: # (Copyright © 2024) |
|
||||||
[//000000004]: # (overtype\_module\_overtype\(0\) 1\.5\.1 doc "overtype text layout") |
|
||||||
|
|
||||||
<hr> [ <a href="../../toc.md">Main Table Of Contents</a> | <a |
|
||||||
href="../toc.md">Table Of Contents</a> | <a |
|
||||||
href="../../index.md">Keyword Index</a> ] <hr> |
|
||||||
|
|
||||||
# NAME |
|
||||||
|
|
||||||
overtype\_module\_overtype \- overtype text layout \- ansi aware |
|
||||||
|
|
||||||
# <a name='toc'></a>Table Of Contents |
|
||||||
|
|
||||||
- [Table Of Contents](#toc) |
|
||||||
|
|
||||||
- [Synopsis](#synopsis) |
|
||||||
|
|
||||||
- [Description](#section1) |
|
||||||
|
|
||||||
- [Overview](#section2) |
|
||||||
|
|
||||||
- [Concepts](#subsection1) |
|
||||||
|
|
||||||
- [dependencies](#subsection2) |
|
||||||
|
|
||||||
- [API](#section3) |
|
||||||
|
|
||||||
- [Keywords](#keywords) |
|
||||||
|
|
||||||
- [Copyright](#copyright) |
|
||||||
|
|
||||||
# <a name='synopsis'></a>SYNOPSIS |
|
||||||
|
|
||||||
package require overtype |
|
||||||
|
|
||||||
# <a name='description'></a>DESCRIPTION |
|
||||||
|
|
||||||
\- |
|
||||||
|
|
||||||
# <a name='section2'></a>Overview |
|
||||||
|
|
||||||
overview of overtype |
|
||||||
|
|
||||||
## <a name='subsection1'></a>Concepts |
|
||||||
|
|
||||||
\- |
|
||||||
|
|
||||||
## <a name='subsection2'></a>dependencies |
|
||||||
|
|
||||||
packages used by overtype |
|
||||||
|
|
||||||
- __Tcl 8\.6__ |
|
||||||
|
|
||||||
- __textutil__ |
|
||||||
|
|
||||||
- __punk::ansi__ |
|
||||||
|
|
||||||
\- required to detect, split, strip and calculate lengths of text possibly |
|
||||||
containing ansi codes |
|
||||||
|
|
||||||
- __punk::char__ |
|
||||||
|
|
||||||
\- box drawing \- and also unicode character width determination for proper |
|
||||||
layout of text with double\-column\-width chars |
|
||||||
|
|
||||||
# <a name='section3'></a>API |
|
||||||
|
|
||||||
# <a name='keywords'></a>KEYWORDS |
|
||||||
|
|
||||||
[ansi](\.\./\.\./index\.md\#ansi), [module](\.\./\.\./index\.md\#module), |
|
||||||
[text](\.\./\.\./index\.md\#text) |
|
||||||
|
|
||||||
# <a name='copyright'></a>COPYRIGHT |
|
||||||
|
|
||||||
Copyright © 2024 |
|
@ -1,78 +0,0 @@ |
|||||||
|
|
||||||
[//000000001]: # (overtype\_module\_overtype \- overtype text layout) |
|
||||||
[//000000002]: # (Generated from file '\_module\_overtype\-1\.5\.2\.tm\.man' by tcllib/doctools with format 'markdown') |
|
||||||
[//000000003]: # (Copyright © 2024) |
|
||||||
[//000000004]: # (overtype\_module\_overtype\(0\) 1\.5\.2 doc "overtype text layout") |
|
||||||
|
|
||||||
<hr> [ <a href="../../toc.md">Main Table Of Contents</a> | <a |
|
||||||
href="../toc.md">Table Of Contents</a> | <a |
|
||||||
href="../../index.md">Keyword Index</a> ] <hr> |
|
||||||
|
|
||||||
# NAME |
|
||||||
|
|
||||||
overtype\_module\_overtype \- overtype text layout \- ansi aware |
|
||||||
|
|
||||||
# <a name='toc'></a>Table Of Contents |
|
||||||
|
|
||||||
- [Table Of Contents](#toc) |
|
||||||
|
|
||||||
- [Synopsis](#synopsis) |
|
||||||
|
|
||||||
- [Description](#section1) |
|
||||||
|
|
||||||
- [Overview](#section2) |
|
||||||
|
|
||||||
- [Concepts](#subsection1) |
|
||||||
|
|
||||||
- [dependencies](#subsection2) |
|
||||||
|
|
||||||
- [API](#section3) |
|
||||||
|
|
||||||
- [Keywords](#keywords) |
|
||||||
|
|
||||||
- [Copyright](#copyright) |
|
||||||
|
|
||||||
# <a name='synopsis'></a>SYNOPSIS |
|
||||||
|
|
||||||
package require overtype |
|
||||||
|
|
||||||
# <a name='description'></a>DESCRIPTION |
|
||||||
|
|
||||||
\- |
|
||||||
|
|
||||||
# <a name='section2'></a>Overview |
|
||||||
|
|
||||||
overview of overtype |
|
||||||
|
|
||||||
## <a name='subsection1'></a>Concepts |
|
||||||
|
|
||||||
\- |
|
||||||
|
|
||||||
## <a name='subsection2'></a>dependencies |
|
||||||
|
|
||||||
packages used by overtype |
|
||||||
|
|
||||||
- __Tcl 8\.6__ |
|
||||||
|
|
||||||
- __textutil__ |
|
||||||
|
|
||||||
- __punk::ansi__ |
|
||||||
|
|
||||||
\- required to detect, split, strip and calculate lengths of text possibly |
|
||||||
containing ansi codes |
|
||||||
|
|
||||||
- __punk::char__ |
|
||||||
|
|
||||||
\- box drawing \- and also unicode character width determination for proper |
|
||||||
layout of text with double\-column\-width chars |
|
||||||
|
|
||||||
# <a name='section3'></a>API |
|
||||||
|
|
||||||
# <a name='keywords'></a>KEYWORDS |
|
||||||
|
|
||||||
[ansi](\.\./\.\./index\.md\#ansi), [module](\.\./\.\./index\.md\#module), |
|
||||||
[text](\.\./\.\./index\.md\#text) |
|
||||||
|
|
||||||
# <a name='copyright'></a>COPYRIGHT |
|
||||||
|
|
||||||
Copyright © 2024 |
|
@ -1,78 +0,0 @@ |
|||||||
|
|
||||||
[//000000001]: # (overtype\_module\_overtype \- overtype text layout) |
|
||||||
[//000000002]: # (Generated from file '\_module\_overtype\-1\.5\.3\.tm\.man' by tcllib/doctools with format 'markdown') |
|
||||||
[//000000003]: # (Copyright © 2024) |
|
||||||
[//000000004]: # (overtype\_module\_overtype\(0\) 1\.5\.3 doc "overtype text layout") |
|
||||||
|
|
||||||
<hr> [ <a href="../../toc.md">Main Table Of Contents</a> | <a |
|
||||||
href="../toc.md">Table Of Contents</a> | <a |
|
||||||
href="../../index.md">Keyword Index</a> ] <hr> |
|
||||||
|
|
||||||
# NAME |
|
||||||
|
|
||||||
overtype\_module\_overtype \- overtype text layout \- ansi aware |
|
||||||
|
|
||||||
# <a name='toc'></a>Table Of Contents |
|
||||||
|
|
||||||
- [Table Of Contents](#toc) |
|
||||||
|
|
||||||
- [Synopsis](#synopsis) |
|
||||||
|
|
||||||
- [Description](#section1) |
|
||||||
|
|
||||||
- [Overview](#section2) |
|
||||||
|
|
||||||
- [Concepts](#subsection1) |
|
||||||
|
|
||||||
- [dependencies](#subsection2) |
|
||||||
|
|
||||||
- [API](#section3) |
|
||||||
|
|
||||||
- [Keywords](#keywords) |
|
||||||
|
|
||||||
- [Copyright](#copyright) |
|
||||||
|
|
||||||
# <a name='synopsis'></a>SYNOPSIS |
|
||||||
|
|
||||||
package require overtype |
|
||||||
|
|
||||||
# <a name='description'></a>DESCRIPTION |
|
||||||
|
|
||||||
\- |
|
||||||
|
|
||||||
# <a name='section2'></a>Overview |
|
||||||
|
|
||||||
overview of overtype |
|
||||||
|
|
||||||
## <a name='subsection1'></a>Concepts |
|
||||||
|
|
||||||
\- |
|
||||||
|
|
||||||
## <a name='subsection2'></a>dependencies |
|
||||||
|
|
||||||
packages used by overtype |
|
||||||
|
|
||||||
- __Tcl 8\.6__ |
|
||||||
|
|
||||||
- __textutil__ |
|
||||||
|
|
||||||
- __punk::ansi__ |
|
||||||
|
|
||||||
\- required to detect, split, strip and calculate lengths of text possibly |
|
||||||
containing ansi codes |
|
||||||
|
|
||||||
- __punk::char__ |
|
||||||
|
|
||||||
\- box drawing \- and also unicode character width determination for proper |
|
||||||
layout of text with double\-column\-width chars |
|
||||||
|
|
||||||
# <a name='section3'></a>API |
|
||||||
|
|
||||||
# <a name='keywords'></a>KEYWORDS |
|
||||||
|
|
||||||
[ansi](\.\./\.\./index\.md\#ansi), [module](\.\./\.\./index\.md\#module), |
|
||||||
[text](\.\./\.\./index\.md\#text) |
|
||||||
|
|
||||||
# <a name='copyright'></a>COPYRIGHT |
|
||||||
|
|
||||||
Copyright © 2024 |
|
@ -0,0 +1,139 @@ |
|||||||
|
|
||||||
|
[//000000001]: # (overtype\_module\_overtype \- overtype text layout) |
||||||
|
[//000000002]: # (Generated from file '\_module\_overtype\-1\.6\.2\.tm\.man' by tcllib/doctools with format 'markdown') |
||||||
|
[//000000003]: # (Copyright © 2024) |
||||||
|
[//000000004]: # (overtype\_module\_overtype\(0\) 1\.6\.2 doc "overtype text layout") |
||||||
|
|
||||||
|
<hr> [ <a href="../../toc.md">Main Table Of Contents</a> | <a |
||||||
|
href="../toc.md">Table Of Contents</a> | <a |
||||||
|
href="../../index.md">Keyword Index</a> ] <hr> |
||||||
|
|
||||||
|
# NAME |
||||||
|
|
||||||
|
overtype\_module\_overtype \- overtype text layout \- ansi aware |
||||||
|
|
||||||
|
# <a name='toc'></a>Table Of Contents |
||||||
|
|
||||||
|
- [Table Of Contents](#toc) |
||||||
|
|
||||||
|
- [Synopsis](#synopsis) |
||||||
|
|
||||||
|
- [Description](#section1) |
||||||
|
|
||||||
|
- [Overview](#section2) |
||||||
|
|
||||||
|
- [Concepts](#subsection1) |
||||||
|
|
||||||
|
- [dependencies](#subsection2) |
||||||
|
|
||||||
|
- [API](#section3) |
||||||
|
|
||||||
|
- [Namespace overtype](#subsection3) |
||||||
|
|
||||||
|
- [Keywords](#keywords) |
||||||
|
|
||||||
|
- [Copyright](#copyright) |
||||||
|
|
||||||
|
# <a name='synopsis'></a>SYNOPSIS |
||||||
|
|
||||||
|
package require overtype |
||||||
|
|
||||||
|
[__overtype::left__ *args*](#1) |
||||||
|
[__overtype::renderline__ *args*](#2) |
||||||
|
|
||||||
|
# <a name='description'></a>DESCRIPTION |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
# <a name='section2'></a>Overview |
||||||
|
|
||||||
|
overview of overtype |
||||||
|
|
||||||
|
## <a name='subsection1'></a>Concepts |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
## <a name='subsection2'></a>dependencies |
||||||
|
|
||||||
|
packages used by overtype |
||||||
|
|
||||||
|
- __Tcl 8\.6__ |
||||||
|
|
||||||
|
- __textutil__ |
||||||
|
|
||||||
|
- __punk::ansi__ |
||||||
|
|
||||||
|
\- required to detect, split, strip and calculate lengths of text possibly |
||||||
|
containing ansi codes |
||||||
|
|
||||||
|
- __punk::char__ |
||||||
|
|
||||||
|
\- box drawing \- and also unicode character width determination for proper |
||||||
|
layout of text with double\-column\-width chars |
||||||
|
|
||||||
|
# <a name='section3'></a>API |
||||||
|
|
||||||
|
## <a name='subsection3'></a>Namespace overtype |
||||||
|
|
||||||
|
Core API functions for overtype |
||||||
|
|
||||||
|
- <a name='1'></a>__overtype::left__ *args* |
||||||
|
|
||||||
|
usage: ?\-transparent \[0|1\]? ?\-overflow \[1|0\]? ?\-ellipsis \[1|0\]? |
||||||
|
?\-ellipsistext \.\.\.? undertext overtext |
||||||
|
|
||||||
|
- <a name='2'></a>__overtype::renderline__ *args* |
||||||
|
|
||||||
|
renderline is the core engine for overtype string processing \(frames & |
||||||
|
textblocks\), and the raw mode commandline repl for the Tcl Punk Shell |
||||||
|
|
||||||
|
It is also a central part of an ansi \(micro\) virtual terminal\-emulator of |
||||||
|
sorts |
||||||
|
|
||||||
|
This system does a half decent job at rendering 90's ANSI art to manipulable |
||||||
|
colour text blocks that can be joined & framed for layout display within a |
||||||
|
unix or windows terminal |
||||||
|
|
||||||
|
Renderline helps maintain ANSI text styling reset/replay codes so that the |
||||||
|
styling of one block doesn't affect another\. |
||||||
|
|
||||||
|
Calling on the punk::ansi library \- it can coalesce codes to keep the size |
||||||
|
down\. |
||||||
|
|
||||||
|
It is a giant mess of doing exactly what common wisdom says not to do\.\.\. |
||||||
|
lots at once\. |
||||||
|
|
||||||
|
renderline is part of the Unicode and ANSI aware Overtype system which |
||||||
|
'renders' a block of text onto a static underlay |
||||||
|
|
||||||
|
The underlay is generally expected to be an ordered set of lines or a |
||||||
|
rectangular text block analogous to a terminal screen \- but it can also be |
||||||
|
ragged in line length, or just blank\. |
||||||
|
|
||||||
|
The overlay couuld be similar \- in which case it may often be used to |
||||||
|
overwrite a column or section of the underlay\. |
||||||
|
|
||||||
|
The overlay could however be a sequence of ANSI\-laden text that jumps all |
||||||
|
over the place\. |
||||||
|
|
||||||
|
renderline itself only deals with a single line \- or sometimes a single |
||||||
|
character\. It is generally called from a loop that does further |
||||||
|
terminal\-like or textblock processing\. |
||||||
|
|
||||||
|
By suppyling the \-info 1 option \- it can return various fields indicating |
||||||
|
the state of the render\. |
||||||
|
|
||||||
|
The main 3 are the result, overflow\_right, and unapplied\. |
||||||
|
|
||||||
|
Renderline handles cursor movements from either keystrokes or ANSI sequences |
||||||
|
but for a full system the aforementioned loop will need to be in place to |
||||||
|
manage the set of lines under manipulation\. |
||||||
|
|
||||||
|
# <a name='keywords'></a>KEYWORDS |
||||||
|
|
||||||
|
[ansi](\.\./\.\./index\.md\#ansi), [module](\.\./\.\./index\.md\#module), |
||||||
|
[text](\.\./\.\./index\.md\#text) |
||||||
|
|
||||||
|
# <a name='copyright'></a>COPYRIGHT |
||||||
|
|
||||||
|
Copyright © 2024 |
@ -1,390 +0,0 @@ |
|||||||
|
|
||||||
[//000000001]: # (punkshell\_module\_punk::ansi \- punk Ansi library) |
|
||||||
[//000000002]: # (Generated from file '\_module\_ansi\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown') |
|
||||||
[//000000003]: # (Copyright © 2023) |
|
||||||
[//000000004]: # (punkshell\_module\_punk::ansi\(0\) 0\.1\.0 doc "punk Ansi library") |
|
||||||
|
|
||||||
<hr> [ <a href="../../../toc.md">Main Table Of Contents</a> | <a |
|
||||||
href="../../toc.md">Table Of Contents</a> | <a |
|
||||||
href="../../../index.md">Keyword Index</a> ] <hr> |
|
||||||
|
|
||||||
# NAME |
|
||||||
|
|
||||||
punkshell\_module\_punk::ansi \- Ansi string functions |
|
||||||
|
|
||||||
# <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::ansi](#subsection3) |
|
||||||
|
|
||||||
- [Namespace punk::ansi::ta](#subsection4) |
|
||||||
|
|
||||||
- [Namespace punk::ansi::ansistring](#subsection5) |
|
||||||
|
|
||||||
- [Keywords](#keywords) |
|
||||||
|
|
||||||
- [Copyright](#copyright) |
|
||||||
|
|
||||||
# <a name='synopsis'></a>SYNOPSIS |
|
||||||
|
|
||||||
package require punk::ansi |
|
||||||
|
|
||||||
[__stripansi__ *text*](#1) |
|
||||||
[__a?__ ?ansicode\.\.\.?](#2) |
|
||||||
[__a\+__ ?ansicode\.\.\.?](#3) |
|
||||||
[__a__ ?ansicode\.\.\.?](#4) |
|
||||||
[__get\_code\_name__ *code*](#5) |
|
||||||
[__reset__](#6) |
|
||||||
[__reset\_soft__](#7) |
|
||||||
[__reset\_colour__](#8) |
|
||||||
[__clear__](#9) |
|
||||||
[__clear\_above__](#10) |
|
||||||
[__clear\_below__](#11) |
|
||||||
[__cursor\_on__](#12) |
|
||||||
[__cursor\_off__](#13) |
|
||||||
[__move__ *row* *col*](#14) |
|
||||||
[__move\_emit__ *row* *col* *data* ?row col data\.\.\.?](#15) |
|
||||||
[__move\_forward__ *n*](#16) |
|
||||||
[__move\_back__ *n*](#17) |
|
||||||
[__move\_up__ *n*](#18) |
|
||||||
[__move\_down__ *n*](#19) |
|
||||||
[__erase\_line__](#20) |
|
||||||
[__erase\_sol__](#21) |
|
||||||
[__erase\_eol__](#22) |
|
||||||
[__cursor\_pos__](#23) |
|
||||||
[__titleset__ *windowtitles*](#24) |
|
||||||
[__detect__ *text*](#25) |
|
||||||
[__detect\_csi__ *text*](#26) |
|
||||||
[__detect\_sgr__ *text*](#27) |
|
||||||
[__strip__ *text*](#28) |
|
||||||
[__length__ *text*](#29) |
|
||||||
[__index__ *string* *index*](#30) |
|
||||||
|
|
||||||
# <a name='description'></a>DESCRIPTION |
|
||||||
|
|
||||||
Ansi based terminal control string functions |
|
||||||
|
|
||||||
See __punk::ansi::console__ for related functions for controlling a console |
|
||||||
|
|
||||||
# <a name='section2'></a>Overview |
|
||||||
|
|
||||||
overview of punk::ansi |
|
||||||
|
|
||||||
punk::ansi functions return their values \- no implicit emission to |
|
||||||
console/stdout |
|
||||||
|
|
||||||
## <a name='subsection1'></a>Concepts |
|
||||||
|
|
||||||
Ansi codes can be used to control most terminals on most platforms in an |
|
||||||
'almost' standard manner |
|
||||||
|
|
||||||
There are many differences in terminal implementations \- but most should support |
|
||||||
a core set of features |
|
||||||
|
|
||||||
punk::ansi does not contain any code for direct terminal manipulation via the |
|
||||||
local system APIs\. |
|
||||||
|
|
||||||
Sticking to ansi codes where possible may be better for cross\-platform and |
|
||||||
remote operation where such APIs are unlikely to be useable\. |
|
||||||
|
|
||||||
## <a name='subsection2'></a>dependencies |
|
||||||
|
|
||||||
packages used by punk::ansi |
|
||||||
|
|
||||||
- __Tcl 8\.6__ |
|
||||||
|
|
||||||
# <a name='section3'></a>API |
|
||||||
|
|
||||||
## <a name='subsection3'></a>Namespace punk::ansi |
|
||||||
|
|
||||||
Core API functions for punk::ansi |
|
||||||
|
|
||||||
- <a name='1'></a>__stripansi__ *text* |
|
||||||
|
|
||||||
Return a string with ansi codes stripped out |
|
||||||
|
|
||||||
- <a name='2'></a>__a?__ ?ansicode\.\.\.? |
|
||||||
|
|
||||||
Return an ansi string representing a table of codes and a panel showing the |
|
||||||
colours |
|
||||||
|
|
||||||
- <a name='3'></a>__a\+__ ?ansicode\.\.\.? |
|
||||||
|
|
||||||
Returns the ansi code to apply those from the supplied list \- without any |
|
||||||
reset being performed first |
|
||||||
|
|
||||||
e\.g to set foreground red and bold |
|
||||||
|
|
||||||
punk::ansi::a red bold |
|
||||||
|
|
||||||
to set background red |
|
||||||
|
|
||||||
punk::ansi::a Red |
|
||||||
|
|
||||||
see __punk::ansi::a?__ to display a list of codes |
|
||||||
|
|
||||||
- <a name='4'></a>__a__ ?ansicode\.\.\.? |
|
||||||
|
|
||||||
Returns the ansi code to reset any current settings and apply those from the |
|
||||||
supplied list |
|
||||||
|
|
||||||
by calling punk::ansi::a with no arguments \- the result is a reset to plain |
|
||||||
text |
|
||||||
|
|
||||||
e\.g to set foreground red and bold |
|
||||||
|
|
||||||
punk::ansi::a red bold |
|
||||||
|
|
||||||
to set background red |
|
||||||
|
|
||||||
punk::ansi::a Red |
|
||||||
|
|
||||||
see __punk::ansi::a?__ to display a list of codes |
|
||||||
|
|
||||||
- <a name='5'></a>__get\_code\_name__ *code* |
|
||||||
|
|
||||||
for example |
|
||||||
|
|
||||||
get\_code\_name red will return 31 |
|
||||||
|
|
||||||
get\_code\_name 31 will return red |
|
||||||
|
|
||||||
- <a name='6'></a>__reset__ |
|
||||||
|
|
||||||
reset console |
|
||||||
|
|
||||||
- <a name='7'></a>__reset\_soft__ |
|
||||||
|
|
||||||
- <a name='8'></a>__reset\_colour__ |
|
||||||
|
|
||||||
reset colour only |
|
||||||
|
|
||||||
- <a name='9'></a>__clear__ |
|
||||||
|
|
||||||
- <a name='10'></a>__clear\_above__ |
|
||||||
|
|
||||||
- <a name='11'></a>__clear\_below__ |
|
||||||
|
|
||||||
- <a name='12'></a>__cursor\_on__ |
|
||||||
|
|
||||||
- <a name='13'></a>__cursor\_off__ |
|
||||||
|
|
||||||
- <a name='14'></a>__move__ *row* *col* |
|
||||||
|
|
||||||
Return an ansi sequence to move to row,col |
|
||||||
|
|
||||||
aka cursor home |
|
||||||
|
|
||||||
- <a name='15'></a>__move\_emit__ *row* *col* *data* ?row col data\.\.\.? |
|
||||||
|
|
||||||
Return an ansi string representing a move to row col with data appended |
|
||||||
|
|
||||||
row col data can be repeated any number of times to return a string |
|
||||||
representing the output of the data elements at all those points |
|
||||||
|
|
||||||
Compare to punk::console::move\_emit which calls this function \- but writes |
|
||||||
it to stdout |
|
||||||
|
|
||||||
punk::console::move\_emit\_return will also return the cursor to the original |
|
||||||
position |
|
||||||
|
|
||||||
There is no punk::ansi::move\_emit\_return because in a standard console there |
|
||||||
is no ansi string which can represent a jump back to starting position\. |
|
||||||
|
|
||||||
There is an ansi code to write the current cursor position to stdin \(which |
|
||||||
will generally display on the console\) \- this is not quite the same thing\. |
|
||||||
|
|
||||||
punk::console::move\_emit\_return does it by emitting that code and starting a |
|
||||||
loop to read stdin |
|
||||||
|
|
||||||
punk::ansi could implement a move\_emit\_return using the punk::console |
|
||||||
mechanism \- but the resulting string would capture the cursor position at |
|
||||||
the time the string is built \- which is not necessarily when the string is |
|
||||||
used\. |
|
||||||
|
|
||||||
The following example shows how to do this manually, emitting the string |
|
||||||
blah at screen position 10,10 and emitting DONE back at the line we started: |
|
||||||
|
|
||||||
punk::ansi::move_emit 10 10 blah {*}[punk::console::get_cursor_pos_list] DONE |
|
||||||
|
|
||||||
A string created by any move\_emit\_return for punk::ansi would not behave in |
|
||||||
an intuitive manner compared to other punk::ansi move functions \- so is |
|
||||||
deliberately omitted\. |
|
||||||
|
|
||||||
- <a name='16'></a>__move\_forward__ *n* |
|
||||||
|
|
||||||
- <a name='17'></a>__move\_back__ *n* |
|
||||||
|
|
||||||
- <a name='18'></a>__move\_up__ *n* |
|
||||||
|
|
||||||
- <a name='19'></a>__move\_down__ *n* |
|
||||||
|
|
||||||
- <a name='20'></a>__erase\_line__ |
|
||||||
|
|
||||||
- <a name='21'></a>__erase\_sol__ |
|
||||||
|
|
||||||
Erase to start of line, leaving cursor position alone\. |
|
||||||
|
|
||||||
- <a name='22'></a>__erase\_eol__ |
|
||||||
|
|
||||||
- <a name='23'></a>__cursor\_pos__ |
|
||||||
|
|
||||||
cursor\_pos unlikely to be useful on it's own like this as when written to |
|
||||||
the terminal, this sequence causes the terminal to emit the row;col sequence |
|
||||||
to stdin |
|
||||||
|
|
||||||
The output on screen will look something like ^\[\[47;3R |
|
||||||
|
|
||||||
Use punk::console::get\_cursor\_pos or punk::console::get\_cursor\_pos\_list |
|
||||||
instead\. |
|
||||||
|
|
||||||
These functions will emit the code \- but read it in from stdin so that it |
|
||||||
doesn't display, and then return the row and column as a colon\-delimited |
|
||||||
string or list respectively\. |
|
||||||
|
|
||||||
The punk::ansi::cursor\_pos function is used by punk::console::get\_cursor\_pos |
|
||||||
and punk::console::get\_cursor\_pos\_list |
|
||||||
|
|
||||||
- <a name='24'></a>__titleset__ *windowtitles* |
|
||||||
|
|
||||||
Returns the code to set the title of the terminal window to windowtitle |
|
||||||
|
|
||||||
This may not work on terminals which have multiple panes/windows |
|
||||||
|
|
||||||
## <a name='subsection4'></a>Namespace punk::ansi::ta |
|
||||||
|
|
||||||
text ansi functions |
|
||||||
|
|
||||||
based on but not identical to the Perl Text Ansi module: |
|
||||||
|
|
||||||
https://github\.com/perlancar/perl\-Text\-ANSI\-Util/blob/master/lib/Text/ANSI/BaseUtil\.pm |
|
||||||
|
|
||||||
- <a name='25'></a>__detect__ *text* |
|
||||||
|
|
||||||
Return a boolean indicating whether Ansi codes were detected in text |
|
||||||
|
|
||||||
- <a name='26'></a>__detect\_csi__ *text* |
|
||||||
|
|
||||||
Return a boolean indicating whether an Ansi Control Sequence Introducer |
|
||||||
\(CSI\) was detected in text |
|
||||||
|
|
||||||
The csi is often represented in code as \\x1b or \\033 followed by a left |
|
||||||
bracket \[ |
|
||||||
|
|
||||||
The initial byte or escape is commonly referenced as ESC in Ansi |
|
||||||
documentation |
|
||||||
|
|
||||||
There is also a multi\-byte escape sequence \\u009b |
|
||||||
|
|
||||||
This is less commonly used but is also detected here |
|
||||||
|
|
||||||
\(This function is not in perl ta\) |
|
||||||
|
|
||||||
- <a name='27'></a>__detect\_sgr__ *text* |
|
||||||
|
|
||||||
Return a boolean indicating whether an ansi Select Graphics Rendition code |
|
||||||
was detected\. |
|
||||||
|
|
||||||
This is the set of CSI sequences ending in 'm' |
|
||||||
|
|
||||||
This is most commonly an Ansi colour code \- but also things such as |
|
||||||
underline and italics |
|
||||||
|
|
||||||
An SGR with empty or a single zero argument is a reset of the SGR features \- |
|
||||||
this is also detected\. |
|
||||||
|
|
||||||
\(This function is not in perl ta\) |
|
||||||
|
|
||||||
- <a name='28'></a>__strip__ *text* |
|
||||||
|
|
||||||
Return text stripped of Ansi codes |
|
||||||
|
|
||||||
This is a tailcall to punk::ansi::stripansi |
|
||||||
|
|
||||||
- <a name='29'></a>__length__ *text* |
|
||||||
|
|
||||||
Return the character length after stripping ansi codes \- not the printing |
|
||||||
length |
|
||||||
|
|
||||||
## <a name='subsection5'></a>Namespace punk::ansi::ansistring |
|
||||||
|
|
||||||
punk::ansi::string ensemble |
|
||||||
|
|
||||||
- <a name='30'></a>__index__ *string* *index* |
|
||||||
|
|
||||||
Takes a string that possibly contains ansi codes such as colour,underline |
|
||||||
etc \(SGR codes\) |
|
||||||
|
|
||||||
Returns the character \(with applied ansi effect\) at position index |
|
||||||
|
|
||||||
The string could contain non SGR ansi codes \- and these will \(mostly\) be |
|
||||||
ignored, so shouldn't affect the output\. |
|
||||||
|
|
||||||
Some terminals don't hide 'privacy message' and other strings within an ESC |
|
||||||
X ESC ^ or ESC \_ sequence \(terminated by ST\) |
|
||||||
|
|
||||||
It's arguable some of these are application specific \- but this function |
|
||||||
takes the view that they are probably non\-displaying \- so index won't see |
|
||||||
them\. |
|
||||||
|
|
||||||
If the caller wants just the character \- they should use a normal string |
|
||||||
index after calling stripansi, or call stripansi afterwards\. |
|
||||||
|
|
||||||
As any operation using end\-\+<int> will need to strip ansi to precalculate |
|
||||||
the length anyway; the caller should probably just use stripansi and |
|
||||||
standard string index if the ansi coded output isn't required and they are |
|
||||||
using and end\-based index\. |
|
||||||
|
|
||||||
In fact, any operation where the ansi info isn't required in the output |
|
||||||
would probably be slightly more efficiently obtained by using stripansi and |
|
||||||
normal string operations on that\. |
|
||||||
|
|
||||||
The returned character will \(possibly\) have a leading ansi escape sequence |
|
||||||
but no trailing escape sequence \- even if the string was taken from a |
|
||||||
position immediately before a reset or other SGR ansi code |
|
||||||
|
|
||||||
The ansi\-code prefix in the returned string is built up by concatenating |
|
||||||
previous SGR ansi codes seen \- but it is optimised to re\-start the process |
|
||||||
if any full SGR reset is encountered\. |
|
||||||
|
|
||||||
The code sequence doesn't detect individual properties being turned on and |
|
||||||
then off again, only full resets; so in some cases the ansi\-prefix may not |
|
||||||
be as short as it could be\. |
|
||||||
|
|
||||||
This shouldn't make any difference to the visual output \- but a possible |
|
||||||
future enhancement is something to produce the shortest ansi sequence |
|
||||||
possible |
|
||||||
|
|
||||||
Notes: |
|
||||||
|
|
||||||
This function has to split the whole string into plaintext & ansi codes even |
|
||||||
for a very low index |
|
||||||
|
|
||||||
Some sort of generator that parses more of the string as required might be |
|
||||||
more efficient for large chunks\. |
|
||||||
|
|
||||||
For end\-x operations we have to pre\-calculate the content\-length by |
|
||||||
stripping the ansi \- which is also potentially sub\-optimal |
|
||||||
|
|
||||||
# <a name='keywords'></a>KEYWORDS |
|
||||||
|
|
||||||
[ansi](\.\./\.\./\.\./index\.md\#ansi), [console](\.\./\.\./\.\./index\.md\#console), |
|
||||||
[module](\.\./\.\./\.\./index\.md\#module), [string](\.\./\.\./\.\./index\.md\#string), |
|
||||||
[terminal](\.\./\.\./\.\./index\.md\#terminal) |
|
||||||
|
|
||||||
# <a name='copyright'></a>COPYRIGHT |
|
||||||
|
|
||||||
Copyright © 2023 |
|
@ -0,0 +1,601 @@ |
|||||||
|
|
||||||
|
[//000000001]: # (punkshell\_module\_punk::ansi \- punk Ansi library) |
||||||
|
[//000000002]: # (Generated from file '\_module\_ansi\-0\.1\.1\.tm\.man' by tcllib/doctools with format 'markdown') |
||||||
|
[//000000003]: # (Copyright © 2023) |
||||||
|
[//000000004]: # (punkshell\_module\_punk::ansi\(0\) 0\.1\.1 doc "punk Ansi library") |
||||||
|
|
||||||
|
<hr> [ <a href="../../../toc.md">Main Table Of Contents</a> | <a |
||||||
|
href="../../toc.md">Table Of Contents</a> | <a |
||||||
|
href="../../../index.md">Keyword Index</a> ] <hr> |
||||||
|
|
||||||
|
# NAME |
||||||
|
|
||||||
|
punkshell\_module\_punk::ansi \- Ansi string functions |
||||||
|
|
||||||
|
# <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::ansi](#subsection3) |
||||||
|
|
||||||
|
- [Namespace punk::ansi::codetype](#subsection4) |
||||||
|
|
||||||
|
- [Namespace punk::ansi::ta](#subsection5) |
||||||
|
|
||||||
|
- [Namespace punk::ansi::ansistring](#subsection6) |
||||||
|
|
||||||
|
- [Keywords](#keywords) |
||||||
|
|
||||||
|
- [Copyright](#copyright) |
||||||
|
|
||||||
|
# <a name='synopsis'></a>SYNOPSIS |
||||||
|
|
||||||
|
package require punk::ansi |
||||||
|
|
||||||
|
[__stripansi__ *text*](#1) |
||||||
|
[__stripansi__ *text*](#2) |
||||||
|
[__a?__ ?ansicode\.\.\.?](#3) |
||||||
|
[__a\+__ ?ansicode\.\.\.?](#4) |
||||||
|
[__a__ ?ansicode\.\.\.?](#5) |
||||||
|
[__a__ ?ansicode\.\.\.?](#6) |
||||||
|
[__get\_code\_name__ *code*](#7) |
||||||
|
[__reset__](#8) |
||||||
|
[__reset\_soft__](#9) |
||||||
|
[__reset\_colour__](#10) |
||||||
|
[__clear__](#11) |
||||||
|
[__clear\_above__](#12) |
||||||
|
[__clear\_below__](#13) |
||||||
|
[__cursor\_on__](#14) |
||||||
|
[__cursor\_off__](#15) |
||||||
|
[__move__ *row* *col*](#16) |
||||||
|
[__move\_emit__ *row* *col* *data* ?row col data\.\.\.?](#17) |
||||||
|
[__move\_forward__ *n*](#18) |
||||||
|
[__move\_back__ *n*](#19) |
||||||
|
[__move\_up__ *n*](#20) |
||||||
|
[__move\_down__ *n*](#21) |
||||||
|
[__move\_column__ *col*](#22) |
||||||
|
[__move\_row__ *row*](#23) |
||||||
|
[__cursor\_save__](#24) |
||||||
|
[__cursor\_restore__](#25) |
||||||
|
[__cursor\_save\_dec__](#26) |
||||||
|
[__cursor\_restore\_attributes__](#27) |
||||||
|
[__enable\_line\_wrap__](#28) |
||||||
|
[__disable\_line\_wrap__](#29) |
||||||
|
[__query\_mode\_line\_wrap__](#30) |
||||||
|
[__erase\_line__](#31) |
||||||
|
[__erase\_sol__](#32) |
||||||
|
[__erase\_eol__](#33) |
||||||
|
[__scroll\_up__ *n*](#34) |
||||||
|
[__scroll\_down__ *n*](#35) |
||||||
|
[__insert\_spaces__ *count*](#36) |
||||||
|
[__delete\_characters__ *count*](#37) |
||||||
|
[__erase\_characters__ *count*](#38) |
||||||
|
[__insert\_lines__ *count*](#39) |
||||||
|
[__delete\_lines__ *count*](#40) |
||||||
|
[__cursor\_pos__](#41) |
||||||
|
[__request\_cursor\_information__](#42) |
||||||
|
[__request\_tabstops__](#43) |
||||||
|
[__titleset__ *windowtitles*](#44) |
||||||
|
[__is\_sgr\_reset__ *code*](#45) |
||||||
|
[__has\_sgr\_leadingreset__ *code*](#46) |
||||||
|
[__detect__ *text*](#47) |
||||||
|
[__detect\_csi__ *text*](#48) |
||||||
|
[__detect\_sgr__ *text*](#49) |
||||||
|
[__strip__ *text*](#50) |
||||||
|
[__length__ *text*](#51) |
||||||
|
[__VIEW__ *string*](#52) |
||||||
|
[__COUNT__ *string*](#53) |
||||||
|
[__index__ *string* *index*](#54) |
||||||
|
|
||||||
|
# <a name='description'></a>DESCRIPTION |
||||||
|
|
||||||
|
Ansi based terminal control string functions |
||||||
|
|
||||||
|
See __punk::ansi::console__ for related functions for controlling a console |
||||||
|
|
||||||
|
# <a name='section2'></a>Overview |
||||||
|
|
||||||
|
overview of punk::ansi |
||||||
|
|
||||||
|
punk::ansi functions return their values \- no implicit emission to |
||||||
|
console/stdout |
||||||
|
|
||||||
|
## <a name='subsection1'></a>Concepts |
||||||
|
|
||||||
|
Ansi codes can be used to control most terminals on most platforms in an |
||||||
|
'almost' standard manner |
||||||
|
|
||||||
|
There are many differences in terminal implementations \- but most should support |
||||||
|
a core set of features |
||||||
|
|
||||||
|
punk::ansi does not contain any code for direct terminal manipulation via the |
||||||
|
local system APIs\. |
||||||
|
|
||||||
|
Sticking to ansi codes where possible may be better for cross\-platform and |
||||||
|
remote operation where such APIs are unlikely to be useable\. |
||||||
|
|
||||||
|
## <a name='subsection2'></a>dependencies |
||||||
|
|
||||||
|
packages used by punk::ansi |
||||||
|
|
||||||
|
- __Tcl 8\.6\-__ |
||||||
|
|
||||||
|
- __punk::char__ |
||||||
|
|
||||||
|
# <a name='section3'></a>API |
||||||
|
|
||||||
|
## <a name='subsection3'></a>Namespace punk::ansi |
||||||
|
|
||||||
|
Core API functions for punk::ansi |
||||||
|
|
||||||
|
- <a name='1'></a>__stripansi__ *text* |
||||||
|
|
||||||
|
Return a string with ansi codes stripped out |
||||||
|
|
||||||
|
Alternate graphics chars are replaced with modern unicode equivalents \(e\.g |
||||||
|
boxdrawing glyphs\) |
||||||
|
|
||||||
|
- <a name='2'></a>__stripansi__ *text* |
||||||
|
|
||||||
|
Return a string with ansi codes stripped out |
||||||
|
|
||||||
|
Alternate graphics modes will be stripped \- exposing the raw characters as |
||||||
|
they appear without graphics mode\. |
||||||
|
|
||||||
|
ie instead of a horizontal line you may see: qqqqqq |
||||||
|
|
||||||
|
- <a name='3'></a>__a?__ ?ansicode\.\.\.? |
||||||
|
|
||||||
|
Return an ansi string representing a table of codes and a panel showing the |
||||||
|
colours |
||||||
|
|
||||||
|
- <a name='4'></a>__a\+__ ?ansicode\.\.\.? |
||||||
|
|
||||||
|
Returns the ansi code to apply those from the supplied list \- without any |
||||||
|
reset being performed first |
||||||
|
|
||||||
|
e\.g to set foreground red and bold |
||||||
|
|
||||||
|
punk::ansi::a red bold |
||||||
|
|
||||||
|
to set background red |
||||||
|
|
||||||
|
punk::ansi::a Red |
||||||
|
|
||||||
|
see __punk::ansi::a?__ to display a list of codes |
||||||
|
|
||||||
|
- <a name='5'></a>__a__ ?ansicode\.\.\.? |
||||||
|
|
||||||
|
Returns the ansi code to reset any current settings and apply those from the |
||||||
|
supplied list |
||||||
|
|
||||||
|
by calling punk::ansi::a with no arguments \- the result is a reset to plain |
||||||
|
text |
||||||
|
|
||||||
|
e\.g to set foreground red and bold |
||||||
|
|
||||||
|
punk::ansi::a red bold |
||||||
|
|
||||||
|
to set background red |
||||||
|
|
||||||
|
punk::ansi::a Red |
||||||
|
|
||||||
|
see __punk::ansi::a?__ to display a list of codes |
||||||
|
|
||||||
|
- <a name='6'></a>__a__ ?ansicode\.\.\.? |
||||||
|
|
||||||
|
Returns the ansi code to reset any current settings and apply those from the |
||||||
|
supplied list |
||||||
|
|
||||||
|
by calling punk::ansi::a with no arguments \- the result is a reset to plain |
||||||
|
text |
||||||
|
|
||||||
|
e\.g to set foreground red and bold |
||||||
|
|
||||||
|
punk::ansi::a red bold |
||||||
|
|
||||||
|
to set background red |
||||||
|
|
||||||
|
punk::ansi::a Red |
||||||
|
|
||||||
|
see __punk::ansi::a?__ to display a list of codes |
||||||
|
|
||||||
|
- <a name='7'></a>__get\_code\_name__ *code* |
||||||
|
|
||||||
|
for example |
||||||
|
|
||||||
|
get\_code\_name red will return 31 |
||||||
|
|
||||||
|
get\_code\_name 31 will return red |
||||||
|
|
||||||
|
- <a name='8'></a>__reset__ |
||||||
|
|
||||||
|
reset console |
||||||
|
|
||||||
|
- <a name='9'></a>__reset\_soft__ |
||||||
|
|
||||||
|
- <a name='10'></a>__reset\_colour__ |
||||||
|
|
||||||
|
reset colour only |
||||||
|
|
||||||
|
- <a name='11'></a>__clear__ |
||||||
|
|
||||||
|
- <a name='12'></a>__clear\_above__ |
||||||
|
|
||||||
|
- <a name='13'></a>__clear\_below__ |
||||||
|
|
||||||
|
- <a name='14'></a>__cursor\_on__ |
||||||
|
|
||||||
|
- <a name='15'></a>__cursor\_off__ |
||||||
|
|
||||||
|
- <a name='16'></a>__move__ *row* *col* |
||||||
|
|
||||||
|
Return an ansi sequence to move to row,col |
||||||
|
|
||||||
|
aka cursor home |
||||||
|
|
||||||
|
- <a name='17'></a>__move\_emit__ *row* *col* *data* ?row col data\.\.\.? |
||||||
|
|
||||||
|
Return an ansi string representing a move to row col with data appended |
||||||
|
|
||||||
|
row col data can be repeated any number of times to return a string |
||||||
|
representing the output of the data elements at all those points |
||||||
|
|
||||||
|
Compare to punk::console::move\_emit which calls this function \- but writes |
||||||
|
it to stdout |
||||||
|
|
||||||
|
punk::console::move\_emit\_return will also return the cursor to the original |
||||||
|
position |
||||||
|
|
||||||
|
There is no punk::ansi::move\_emit\_return because in a standard console there |
||||||
|
is no ansi string which can represent a jump back to starting position\. |
||||||
|
|
||||||
|
There is an ansi code to write the current cursor position to stdin \(which |
||||||
|
will generally display on the console\) \- this is not quite the same thing\. |
||||||
|
|
||||||
|
punk::console::move\_emit\_return does it by emitting that code and starting a |
||||||
|
loop to read stdin |
||||||
|
|
||||||
|
punk::ansi could implement a move\_emit\_return using the punk::console |
||||||
|
mechanism \- but the resulting string would capture the cursor position at |
||||||
|
the time the string is built \- which is not necessarily when the string is |
||||||
|
used\. |
||||||
|
|
||||||
|
The following example shows how to do this manually, emitting the string |
||||||
|
blah at screen position 10,10 and emitting DONE back at the line we started: |
||||||
|
|
||||||
|
punk::ansi::move_emit 10 10 blah {*}[punk::console::get_cursor_pos_list] DONE |
||||||
|
|
||||||
|
A string created by any move\_emit\_return for punk::ansi would not behave in |
||||||
|
an intuitive manner compared to other punk::ansi move functions \- so is |
||||||
|
deliberately omitted\. |
||||||
|
|
||||||
|
- <a name='18'></a>__move\_forward__ *n* |
||||||
|
|
||||||
|
- <a name='19'></a>__move\_back__ *n* |
||||||
|
|
||||||
|
- <a name='20'></a>__move\_up__ *n* |
||||||
|
|
||||||
|
- <a name='21'></a>__move\_down__ *n* |
||||||
|
|
||||||
|
- <a name='22'></a>__move\_column__ *col* |
||||||
|
|
||||||
|
- <a name='23'></a>__move\_row__ *row* |
||||||
|
|
||||||
|
VPA \- Vertical Line Position Absolute |
||||||
|
|
||||||
|
- <a name='24'></a>__cursor\_save__ |
||||||
|
|
||||||
|
equivalent term::ansi::code::ctrl::sc |
||||||
|
|
||||||
|
This is the ANSI/SCO cursor save as opposed to the DECSC version |
||||||
|
|
||||||
|
On many terminals either will work \- but cursor\_save\_dec is shorter and |
||||||
|
perhaps more widely supported |
||||||
|
|
||||||
|
- <a name='25'></a>__cursor\_restore__ |
||||||
|
|
||||||
|
equivalent term::ansi::code::ctrl::rc |
||||||
|
|
||||||
|
ANSI/SCO \- see also cursor\_restore\_dec for the DECRC version |
||||||
|
|
||||||
|
- <a name='26'></a>__cursor\_save\_dec__ |
||||||
|
|
||||||
|
equivalent term::ansi::code::ctrl::sca |
||||||
|
|
||||||
|
DECSC |
||||||
|
|
||||||
|
- <a name='27'></a>__cursor\_restore\_attributes__ |
||||||
|
|
||||||
|
equivalent term::ansi::code::ctrl::rca |
||||||
|
|
||||||
|
DECRC |
||||||
|
|
||||||
|
- <a name='28'></a>__enable\_line\_wrap__ |
||||||
|
|
||||||
|
enable automatic line wrapping when characters entered beyond rightmost |
||||||
|
column |
||||||
|
|
||||||
|
This will also allow forward movements to move to subsequent lines |
||||||
|
|
||||||
|
This is DECAWM \- and is the same sequence output by 'tput smam' |
||||||
|
|
||||||
|
- <a name='29'></a>__disable\_line\_wrap__ |
||||||
|
|
||||||
|
disable automatic line wrapping |
||||||
|
|
||||||
|
reset DECAWM \- same sequence output by 'tput rmam' tput rmam |
||||||
|
|
||||||
|
- <a name='30'></a>__query\_mode\_line\_wrap__ |
||||||
|
|
||||||
|
DECRQM to query line\-wrap state |
||||||
|
|
||||||
|
The punk::ansi::query\_mode\_ functions just emit the ansi query sequence\. |
||||||
|
|
||||||
|
- <a name='31'></a>__erase\_line__ |
||||||
|
|
||||||
|
- <a name='32'></a>__erase\_sol__ |
||||||
|
|
||||||
|
Erase to start of line, leaving cursor position alone\. |
||||||
|
|
||||||
|
- <a name='33'></a>__erase\_eol__ |
||||||
|
|
||||||
|
- <a name='34'></a>__scroll\_up__ *n* |
||||||
|
|
||||||
|
- <a name='35'></a>__scroll\_down__ *n* |
||||||
|
|
||||||
|
- <a name='36'></a>__insert\_spaces__ *count* |
||||||
|
|
||||||
|
- <a name='37'></a>__delete\_characters__ *count* |
||||||
|
|
||||||
|
- <a name='38'></a>__erase\_characters__ *count* |
||||||
|
|
||||||
|
- <a name='39'></a>__insert\_lines__ *count* |
||||||
|
|
||||||
|
- <a name='40'></a>__delete\_lines__ *count* |
||||||
|
|
||||||
|
- <a name='41'></a>__cursor\_pos__ |
||||||
|
|
||||||
|
cursor\_pos unlikely to be useful on it's own like this as when written to |
||||||
|
the terminal, this sequence causes the terminal to emit the row;col sequence |
||||||
|
to stdin |
||||||
|
|
||||||
|
The output on screen will look something like ^\[\[47;3R |
||||||
|
|
||||||
|
Use punk::console::get\_cursor\_pos or punk::console::get\_cursor\_pos\_list |
||||||
|
instead\. |
||||||
|
|
||||||
|
These functions will emit the code \- but read it in from stdin so that it |
||||||
|
doesn't display, and then return the row and column as a colon\-delimited |
||||||
|
string or list respectively\. |
||||||
|
|
||||||
|
The punk::ansi::cursor\_pos function is used by punk::console::get\_cursor\_pos |
||||||
|
and punk::console::get\_cursor\_pos\_list |
||||||
|
|
||||||
|
- <a name='42'></a>__request\_cursor\_information__ |
||||||
|
|
||||||
|
DECRQPSR \(DEC Request Presentation State Report\) for DECCCIR Cursor |
||||||
|
Information report |
||||||
|
|
||||||
|
When written to the terminal, this sequence causes the terminal to emit |
||||||
|
cursor information to stdin |
||||||
|
|
||||||
|
A stdin readloop will need to be in place to read this information |
||||||
|
|
||||||
|
- <a name='43'></a>__request\_tabstops__ |
||||||
|
|
||||||
|
DECRQPSR \(DEC Request Presentation State Report\) for DECTABSR Tab stop |
||||||
|
report |
||||||
|
|
||||||
|
When written to the terminal, this sequence causes the terminal to emit |
||||||
|
tabstop information to stdin |
||||||
|
|
||||||
|
- <a name='44'></a>__titleset__ *windowtitles* |
||||||
|
|
||||||
|
Returns the code to set the title of the terminal window to windowtitle |
||||||
|
|
||||||
|
This may not work on terminals which have multiple panes/windows |
||||||
|
|
||||||
|
## <a name='subsection4'></a>Namespace punk::ansi::codetype |
||||||
|
|
||||||
|
API functions for punk::ansi::codetype |
||||||
|
|
||||||
|
Utility functions for processing ansi code sequences |
||||||
|
|
||||||
|
- <a name='45'></a>__is\_sgr\_reset__ *code* |
||||||
|
|
||||||
|
Return a boolean indicating whether this string has a trailing pure SGR |
||||||
|
reset |
||||||
|
|
||||||
|
Note that if the reset is not the very last item in the string \- it will not |
||||||
|
be detected\. |
||||||
|
|
||||||
|
This is primarily intended for testing a single ansi code sequence, but code |
||||||
|
can be any string where the trailing SGR code is to be tested\. |
||||||
|
|
||||||
|
- <a name='46'></a>__has\_sgr\_leadingreset__ *code* |
||||||
|
|
||||||
|
The reset must be the very first item in code to be detected\. Trailing |
||||||
|
strings/codes ignored\. |
||||||
|
|
||||||
|
## <a name='subsection5'></a>Namespace punk::ansi::ta |
||||||
|
|
||||||
|
text ansi functions |
||||||
|
|
||||||
|
based on but not identical to the Perl Text Ansi module: |
||||||
|
|
||||||
|
https://github\.com/perlancar/perl\-Text\-ANSI\-Util/blob/master/lib/Text/ANSI/BaseUtil\.pm |
||||||
|
|
||||||
|
- <a name='47'></a>__detect__ *text* |
||||||
|
|
||||||
|
Return a boolean indicating whether Ansi codes were detected in text |
||||||
|
|
||||||
|
- <a name='48'></a>__detect\_csi__ *text* |
||||||
|
|
||||||
|
Return a boolean indicating whether an Ansi Control Sequence Introducer |
||||||
|
\(CSI\) was detected in text |
||||||
|
|
||||||
|
The csi is often represented in code as \\x1b or \\033 followed by a left |
||||||
|
bracket \[ |
||||||
|
|
||||||
|
The initial byte or escape is commonly referenced as ESC in Ansi |
||||||
|
documentation |
||||||
|
|
||||||
|
There is also a multi\-byte escape sequence \\u009b |
||||||
|
|
||||||
|
This is less commonly used but is also detected here |
||||||
|
|
||||||
|
\(This function is not in perl ta\) |
||||||
|
|
||||||
|
- <a name='49'></a>__detect\_sgr__ *text* |
||||||
|
|
||||||
|
Return a boolean indicating whether an ansi Select Graphics Rendition code |
||||||
|
was detected\. |
||||||
|
|
||||||
|
This is the set of CSI sequences ending in 'm' |
||||||
|
|
||||||
|
This is most commonly an Ansi colour code \- but also things such as |
||||||
|
underline and italics |
||||||
|
|
||||||
|
An SGR with empty or a single zero argument is a reset of the SGR features \- |
||||||
|
this is also detected\. |
||||||
|
|
||||||
|
\(This function is not in perl ta\) |
||||||
|
|
||||||
|
- <a name='50'></a>__strip__ *text* |
||||||
|
|
||||||
|
Return text stripped of Ansi codes |
||||||
|
|
||||||
|
This is a tailcall to punk::ansi::stripansi |
||||||
|
|
||||||
|
- <a name='51'></a>__length__ *text* |
||||||
|
|
||||||
|
Return the character length after stripping ansi codes \- not the printing |
||||||
|
length |
||||||
|
|
||||||
|
## <a name='subsection6'></a>Namespace punk::ansi::ansistring |
||||||
|
|
||||||
|
punk::ansi::ansistring ensemble \- ansi\-aware string operations |
||||||
|
|
||||||
|
Working with strings containing ansi in a way that preserves/understands the |
||||||
|
codes is always going to be significantly slower than working with plain strings |
||||||
|
|
||||||
|
Just as working with other forms of markup such as HTML \- you simply need to be |
||||||
|
aware of the tradeoffs and design accordingly\. |
||||||
|
|
||||||
|
- <a name='52'></a>__VIEW__ *string* |
||||||
|
|
||||||
|
Return a string with specific ANSI control characters substituted with |
||||||
|
visual equivalents frome the appropriate unicode C0 and C1 visualisation |
||||||
|
sets |
||||||
|
|
||||||
|
For debugging purposes, certain other standard control characters are |
||||||
|
converted to visual representation, for example backspace \(mapped to \\\\U2408 |
||||||
|
'\\U2408'\) |
||||||
|
|
||||||
|
Horizontal tab is mapped to \\\\U2409 '\\U2409'\. For many of the punk terminal |
||||||
|
text operations, tabs have already been mapped to the appropriate number of |
||||||
|
spaces using textutil::tabify functions |
||||||
|
|
||||||
|
As punkshell uses linefeed where possible in preference to crlf even on |
||||||
|
windows, cr is mapped to \\\\U240D '\\U240D' \- but lf is left as is\. |
||||||
|
|
||||||
|
- <a name='53'></a>__COUNT__ *string* |
||||||
|
|
||||||
|
Returns the count of visible graphemes and non\-ansi control characters |
||||||
|
|
||||||
|
Incomplete\! grapheme clustering support not yet implemented \- only |
||||||
|
diacritics are currently clustered to count as one grapheme\. |
||||||
|
|
||||||
|
This will not count strings hidden inside a 'privacy message' or other ansi |
||||||
|
codes which may have content between their opening escape and their |
||||||
|
termination sequence\. |
||||||
|
|
||||||
|
This is not quite equivalent to calling string length on the result of |
||||||
|
stripansi $string due to diacritics and/or grapheme combinations |
||||||
|
|
||||||
|
Note that this returns the number of characters in the payload \(after |
||||||
|
applying combiners\) It is not always the same as the width of the string as |
||||||
|
rendered on a terminal due to 2wide Unicode characters and the usual |
||||||
|
invisible control characters such as \\r and \\n |
||||||
|
|
||||||
|
To get the width, use punk::ansi::printing\_length instead, which is also |
||||||
|
ansi aware\. |
||||||
|
|
||||||
|
- <a name='54'></a>__index__ *string* *index* |
||||||
|
|
||||||
|
Takes a string that possibly contains ansi codes such as colour,underline |
||||||
|
etc \(SGR codes\) |
||||||
|
|
||||||
|
Returns the character \(with applied ansi effect\) at position index |
||||||
|
|
||||||
|
The string could contain non SGR ansi codes \- and these will \(mostly\) be |
||||||
|
ignored, so shouldn't affect the output\. |
||||||
|
|
||||||
|
Some terminals don't hide 'privacy message' and other strings within an ESC |
||||||
|
X ESC ^ or ESC \_ sequence \(terminated by ST\) |
||||||
|
|
||||||
|
It's arguable some of these are application specific \- but this function |
||||||
|
takes the view that they are probably non\-displaying \- so index won't see |
||||||
|
them\. |
||||||
|
|
||||||
|
If the caller wants just the character \- they should use a normal string |
||||||
|
index after calling stripansi, or call stripansi afterwards\. |
||||||
|
|
||||||
|
As any operation using end\-\+<int> will need to strip ansi to precalculate |
||||||
|
the length anyway; the caller should probably just use stripansi and |
||||||
|
standard string index if the ansi coded output isn't required and they are |
||||||
|
using and end\-based index\. |
||||||
|
|
||||||
|
In fact, any operation where the ansi info isn't required in the output |
||||||
|
would probably be slightly more efficiently obtained by using stripansi and |
||||||
|
normal string operations on that\. |
||||||
|
|
||||||
|
The returned character will \(possibly\) have a leading ansi escape sequence |
||||||
|
but no trailing escape sequence \- even if the string was taken from a |
||||||
|
position immediately before a reset or other SGR ansi code |
||||||
|
|
||||||
|
The ansi\-code prefix in the returned string is built up by concatenating |
||||||
|
previous SGR ansi codes seen \- but it is optimised to re\-start the process |
||||||
|
if any full SGR reset is encountered\. |
||||||
|
|
||||||
|
The code sequence doesn't detect individual properties being turned on and |
||||||
|
then off again, only full resets; so in some cases the ansi\-prefix may not |
||||||
|
be as short as it could be\. |
||||||
|
|
||||||
|
This shouldn't make any difference to the visual output \- but a possible |
||||||
|
future enhancement is something to produce the shortest ansi sequence |
||||||
|
possible |
||||||
|
|
||||||
|
Notes: |
||||||
|
|
||||||
|
This function has to split the whole string into plaintext & ansi codes even |
||||||
|
for a very low index |
||||||
|
|
||||||
|
Some sort of generator that parses more of the string as required might be |
||||||
|
more efficient for large chunks\. |
||||||
|
|
||||||
|
For end\-x operations we have to pre\-calculate the content\-length by |
||||||
|
stripping the ansi \- which is also potentially sub\-optimal |
||||||
|
|
||||||
|
# <a name='keywords'></a>KEYWORDS |
||||||
|
|
||||||
|
[ansi](\.\./\.\./\.\./index\.md\#ansi), [console](\.\./\.\./\.\./index\.md\#console), |
||||||
|
[module](\.\./\.\./\.\./index\.md\#module), [string](\.\./\.\./\.\./index\.md\#string), |
||||||
|
[terminal](\.\./\.\./\.\./index\.md\#terminal) |
||||||
|
|
||||||
|
# <a name='copyright'></a>COPYRIGHT |
||||||
|
|
||||||
|
Copyright © 2023 |
@ -0,0 +1,108 @@ |
|||||||
|
|
||||||
|
[//000000001]: # (shellspy\_module\_punk::assertion \- per\-namespace assertions with ) |
||||||
|
[//000000002]: # (Generated from file '\_module\_assertion\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown') |
||||||
|
[//000000003]: # (Copyright © 2024) |
||||||
|
[//000000004]: # (shellspy\_module\_punk::assertion\(0\) 0\.1\.0 doc "per\-namespace assertions with ") |
||||||
|
|
||||||
|
<hr> [ <a href="../../../toc.md">Main Table Of Contents</a> | <a |
||||||
|
href="../../toc.md">Table Of Contents</a> | <a |
||||||
|
href="../../../index.md">Keyword Index</a> ] <hr> |
||||||
|
|
||||||
|
# NAME |
||||||
|
|
||||||
|
shellspy\_module\_punk::assertion \- assertion alternative to control::assert |
||||||
|
|
||||||
|
# <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::assertion::class](#subsection3) |
||||||
|
|
||||||
|
- [Namespace punk::assertion](#subsection4) |
||||||
|
|
||||||
|
- [Namespace punk::assertion::lib](#subsection5) |
||||||
|
|
||||||
|
- [Internal](#section4) |
||||||
|
|
||||||
|
- [Namespace punk::assertion::system](#subsection6) |
||||||
|
|
||||||
|
- [Keywords](#keywords) |
||||||
|
|
||||||
|
- [Copyright](#copyright) |
||||||
|
|
||||||
|
# <a name='synopsis'></a>SYNOPSIS |
||||||
|
|
||||||
|
package require punk::assertion |
||||||
|
|
||||||
|
# <a name='description'></a>DESCRIPTION |
||||||
|
|
||||||
|
The punk::assertion library has the same semantics as Tcllib's control::assert |
||||||
|
library for the assert command itself\. |
||||||
|
|
||||||
|
The main difference is the way in which assert is enabled/disabled in |
||||||
|
namespaces\. |
||||||
|
|
||||||
|
Due to commands such as 'namespace path' \- the assert command could be available |
||||||
|
in arbitrary namespaces unrelated by tree structure to namespaces where assert |
||||||
|
has been directly imported\. |
||||||
|
|
||||||
|
punk::assertion::active 0|1 allows activating and deactivating assertions in any |
||||||
|
namespace where the assert command is available \- but only affecting the |
||||||
|
activations state of the namespace in which it is called\. |
||||||
|
|
||||||
|
If such a non\-primary assertion namespace never had active set to 0 or 1 \- then |
||||||
|
it will activate/deactivate when the namespace corresponding to the found assert |
||||||
|
command \(primary\) is activated/deactivated\. |
||||||
|
|
||||||
|
Once marked active or inactive \- such a non\-primary namespace will no longer |
||||||
|
follow the primary |
||||||
|
|
||||||
|
# <a name='section2'></a>Overview |
||||||
|
|
||||||
|
overview of punk::assertion |
||||||
|
|
||||||
|
## <a name='subsection1'></a>Concepts |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
## <a name='subsection2'></a>dependencies |
||||||
|
|
||||||
|
packages used by punk::assertion |
||||||
|
|
||||||
|
- __Tcl 8\.6__ |
||||||
|
|
||||||
|
# <a name='section3'></a>API |
||||||
|
|
||||||
|
## <a name='subsection3'></a>Namespace punk::assertion::class |
||||||
|
|
||||||
|
class definitions |
||||||
|
|
||||||
|
## <a name='subsection4'></a>Namespace punk::assertion |
||||||
|
|
||||||
|
## <a name='subsection5'></a>Namespace punk::assertion::lib |
||||||
|
|
||||||
|
# <a name='section4'></a>Internal |
||||||
|
|
||||||
|
## <a name='subsection6'></a>Namespace punk::assertion::system |
||||||
|
|
||||||
|
# <a name='keywords'></a>KEYWORDS |
||||||
|
|
||||||
|
[assert](\.\./\.\./\.\./index\.md\#assert), |
||||||
|
[assertion](\.\./\.\./\.\./index\.md\#assertion), |
||||||
|
[debug](\.\./\.\./\.\./index\.md\#debug), [module](\.\./\.\./\.\./index\.md\#module) |
||||||
|
|
||||||
|
# <a name='copyright'></a>COPYRIGHT |
||||||
|
|
||||||
|
Copyright © 2024 |
@ -0,0 +1,87 @@ |
|||||||
|
|
||||||
|
[//000000001]: # (shellspy\_module\_punk::basictelnet \- basic telnet client) |
||||||
|
[//000000002]: # (Generated from file '\_module\_basictelnet\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown') |
||||||
|
[//000000003]: # (Copyright © 2024) |
||||||
|
[//000000004]: # (shellspy\_module\_punk::basictelnet\(0\) 0\.1\.0 doc "basic telnet client") |
||||||
|
|
||||||
|
<hr> [ <a href="../../../toc.md">Main Table Of Contents</a> | <a |
||||||
|
href="../../toc.md">Table Of Contents</a> | <a |
||||||
|
href="../../../index.md">Keyword Index</a> ] <hr> |
||||||
|
|
||||||
|
# NAME |
||||||
|
|
||||||
|
shellspy\_module\_punk::basictelnet \- basic telnet client \- DKF/Wiki |
||||||
|
|
||||||
|
# <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::basictelnet::class](#subsection3) |
||||||
|
|
||||||
|
- [Namespace punk::basictelnet](#subsection4) |
||||||
|
|
||||||
|
- [Namespace punk::basictelnet::lib](#subsection5) |
||||||
|
|
||||||
|
- [Internal](#section4) |
||||||
|
|
||||||
|
- [Namespace punk::basictelnet::system](#subsection6) |
||||||
|
|
||||||
|
- [Keywords](#keywords) |
||||||
|
|
||||||
|
- [Copyright](#copyright) |
||||||
|
|
||||||
|
# <a name='synopsis'></a>SYNOPSIS |
||||||
|
|
||||||
|
package require punk::basictelnet |
||||||
|
|
||||||
|
# <a name='description'></a>DESCRIPTION |
||||||
|
|
||||||
|
see https://wiki\.tcl\-lang\.org/page/Tcl\+Telnet |
||||||
|
|
||||||
|
# <a name='section2'></a>Overview |
||||||
|
|
||||||
|
overview of punk::basictelnet |
||||||
|
|
||||||
|
## <a name='subsection1'></a>Concepts |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
## <a name='subsection2'></a>dependencies |
||||||
|
|
||||||
|
packages used by punk::basictelnet |
||||||
|
|
||||||
|
- __Tcl 8\.6__ |
||||||
|
|
||||||
|
# <a name='section3'></a>API |
||||||
|
|
||||||
|
## <a name='subsection3'></a>Namespace punk::basictelnet::class |
||||||
|
|
||||||
|
class definitions |
||||||
|
|
||||||
|
## <a name='subsection4'></a>Namespace punk::basictelnet |
||||||
|
|
||||||
|
## <a name='subsection5'></a>Namespace punk::basictelnet::lib |
||||||
|
|
||||||
|
# <a name='section4'></a>Internal |
||||||
|
|
||||||
|
## <a name='subsection6'></a>Namespace punk::basictelnet::system |
||||||
|
|
||||||
|
# <a name='keywords'></a>KEYWORDS |
||||||
|
|
||||||
|
[module](\.\./\.\./\.\./index\.md\#module) |
||||||
|
|
||||||
|
# <a name='copyright'></a>COPYRIGHT |
||||||
|
|
||||||
|
Copyright © 2024 |
@ -0,0 +1,225 @@ |
|||||||
|
|
||||||
|
[//000000001]: # (shellspy\_module\_punk::sshrun \- punk::sshrun tclssh clone) |
||||||
|
[//000000002]: # (Generated from file '\_module\_sshrun\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown') |
||||||
|
[//000000003]: # (Copyright © 2009) |
||||||
|
[//000000004]: # (shellspy\_module\_punk::sshrun\(0\) 0\.1\.0 doc "punk::sshrun tclssh clone") |
||||||
|
|
||||||
|
<hr> [ <a href="../../../toc.md">Main Table Of Contents</a> | <a |
||||||
|
href="../../toc.md">Table Of Contents</a> | <a |
||||||
|
href="../../../index.md">Keyword Index</a> ] <hr> |
||||||
|
|
||||||
|
# NAME |
||||||
|
|
||||||
|
shellspy\_module\_punk::sshrun \- Tcl procedures to execute tcl scripts in remote |
||||||
|
hosts |
||||||
|
|
||||||
|
# <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::sshrun::class](#subsection3) |
||||||
|
|
||||||
|
- [Namespace punk::sshrun](#subsection4) |
||||||
|
|
||||||
|
- [Namespace punk::sshrun::lib](#subsection5) |
||||||
|
|
||||||
|
- [Internal](#section4) |
||||||
|
|
||||||
|
- [Namespace punk::sshrun::system](#subsection6) |
||||||
|
|
||||||
|
- [Keywords](#keywords) |
||||||
|
|
||||||
|
- [Copyright](#copyright) |
||||||
|
|
||||||
|
# <a name='synopsis'></a>SYNOPSIS |
||||||
|
|
||||||
|
package require punk::sshrun |
||||||
|
|
||||||
|
[connect *args*](#1) |
||||||
|
[disconnect *host*](#2) |
||||||
|
[push *host* *script*](#3) |
||||||
|
[send *host*](#4) |
||||||
|
[send\_exit *host*](#5) |
||||||
|
[send\_exit *host*](#6) |
||||||
|
[pop\_all *host* *output\_varname*](#7) |
||||||
|
[pop\_read *host* *numbytes* *output\_varname*](#8) |
||||||
|
[hfileevent *host* *readable\_writable* *script*](#9) |
||||||
|
[hconfigure *host* *args*](#10) |
||||||
|
[rexec *host* *script* *output\_varname*](#11) |
||||||
|
[get\_filehandle *host*](#12) |
||||||
|
|
||||||
|
# <a name='description'></a>DESCRIPTION |
||||||
|
|
||||||
|
This is a clone of tclssh by Jose F\. Nieves |
||||||
|
|
||||||
|
The original repo is at: https://bitbucket\.org/noaaport/tclssh/src/master/ |
||||||
|
|
||||||
|
This version is namespaced under punk::sshrun specifically for the Punk shell |
||||||
|
project \- and may lag the original project or diverge\. |
||||||
|
|
||||||
|
You are encouraged to use the original Tclssh source from the above URL for your |
||||||
|
own projects |
||||||
|
|
||||||
|
# <a name='section2'></a>Overview |
||||||
|
|
||||||
|
overview of punk::sshrun |
||||||
|
|
||||||
|
SYNOPSIS |
||||||
|
|
||||||
|
package require punk::sshrun |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
punk::sshrun::connect \[\-t <tclsh\_name>\] \[\-\- <ssh\_options>\] \[<user>@\]<host> |
||||||
|
|
||||||
|
Defaults: \-t tclsh |
||||||
|
|
||||||
|
## <a name='subsection1'></a>Concepts |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
## <a name='subsection2'></a>dependencies |
||||||
|
|
||||||
|
packages used by punk::sshrun |
||||||
|
|
||||||
|
- __Tcl 8\.6__ |
||||||
|
|
||||||
|
- __cmdline__ |
||||||
|
|
||||||
|
# <a name='section3'></a>API |
||||||
|
|
||||||
|
## <a name='subsection3'></a>Namespace punk::sshrun::class |
||||||
|
|
||||||
|
class definitions |
||||||
|
|
||||||
|
## <a name='subsection4'></a>Namespace punk::sshrun |
||||||
|
|
||||||
|
- <a name='1'></a>connect *args* |
||||||
|
|
||||||
|
Must be called first\. |
||||||
|
|
||||||
|
This proc opens an io channel to the tclsh in the remote host \(via ssh\) that |
||||||
|
is kept in an internal variable for subsequent use\. |
||||||
|
|
||||||
|
The file handle can be retrieved if desired through the command: |
||||||
|
get\_filehandle \{host\} |
||||||
|
|
||||||
|
- <a name='2'></a>disconnect *host* |
||||||
|
|
||||||
|
Must be called last\. Closes the filehandle opened by connect\. |
||||||
|
|
||||||
|
- <a name='3'></a>push *host* *script* |
||||||
|
|
||||||
|
<script> can be any tcl code\. |
||||||
|
|
||||||
|
For example, if the remote host is named "diablo" |
||||||
|
|
||||||
|
ssh::push "diablo" "exec date" |
||||||
|
ssh::push "diablo" "exec uname -a" |
||||||
|
|
||||||
|
The commands are note executed immediately\. Instead, the "push" proc simply |
||||||
|
accumulates them in a list that is sent to the host when the "send" |
||||||
|
procedure is executed\. |
||||||
|
|
||||||
|
Each push proc inserts the newline '\\n' character after each <script> |
||||||
|
|
||||||
|
In the above example\. Internally, each <script> is a member of a list, and |
||||||
|
when the "send" proc is invoked the entire script is constructed as a "join |
||||||
|
<list> \\n |
||||||
|
|
||||||
|
- <a name='4'></a>send *host* |
||||||
|
|
||||||
|
This proc does the equivalent of a |
||||||
|
|
||||||
|
puts <filehandle> [join <script_list> \n] |
||||||
|
flush <filehandle> |
||||||
|
|
||||||
|
- <a name='5'></a>send\_exit *host* |
||||||
|
|
||||||
|
This proc is similar to the above, but it "pushes" an exit command at the |
||||||
|
end of the script\. The proc does the equivalent of |
||||||
|
|
||||||
|
ssh::push <host> "exit" |
||||||
|
ssh::send <host> |
||||||
|
|
||||||
|
The net effect if this is that the remote host's tclsh will exit, so that |
||||||
|
the filehandle receives an eof and we can use |
||||||
|
|
||||||
|
[read <filehandle>] |
||||||
|
|
||||||
|
to read the entire output at once \(see the pop proc below\) |
||||||
|
|
||||||
|
- <a name='6'></a>send\_exit *host* |
||||||
|
|
||||||
|
After executing a "send", this can be used to read one line of output\. The |
||||||
|
proc does the equivalent of |
||||||
|
|
||||||
|
[gets <filehandle> line] |
||||||
|
|
||||||
|
- <a name='7'></a>pop\_all *host* *output\_varname* |
||||||
|
|
||||||
|
This proc does the equivalent of |
||||||
|
|
||||||
|
while {[pop_line $host line] >=0} { |
||||||
|
puts $line; |
||||||
|
} |
||||||
|
|
||||||
|
but all the output is returned as one string in output\_varname\. |
||||||
|
|
||||||
|
It should be used only when we know that the remote host's tclsh will exit, |
||||||
|
so that the above code will detect the eof and exit |
||||||
|
|
||||||
|
\(see the send\_exit proc above\) |
||||||
|
|
||||||
|
The function returns the number of lines read \(0 if nothing is read before |
||||||
|
encoutering eof\) |
||||||
|
|
||||||
|
- <a name='8'></a>pop\_read *host* *numbytes* *output\_varname* |
||||||
|
|
||||||
|
Returns: numbytes read\. If numbytes is not positive, then read is called |
||||||
|
without the numbytes argument\. |
||||||
|
|
||||||
|
- <a name='9'></a>hfileevent *host* *readable\_writable* *script* |
||||||
|
|
||||||
|
Equivalent to: |
||||||
|
|
||||||
|
fileevent <filehandle> $readable_writable $script |
||||||
|
|
||||||
|
- <a name='10'></a>hconfigure *host* *args* |
||||||
|
|
||||||
|
- <a name='11'></a>rexec *host* *script* *output\_varname* |
||||||
|
|
||||||
|
shortcut for: |
||||||
|
|
||||||
|
ssh::rexec_nopop $host $script |
||||||
|
ssh::pop_all $host outputvar |
||||||
|
|
||||||
|
- <a name='12'></a>get\_filehandle *host* |
||||||
|
|
||||||
|
## <a name='subsection5'></a>Namespace punk::sshrun::lib |
||||||
|
|
||||||
|
Secondary functions that are part of the API |
||||||
|
|
||||||
|
# <a name='section4'></a>Internal |
||||||
|
|
||||||
|
## <a name='subsection6'></a>Namespace punk::sshrun::system |
||||||
|
|
||||||
|
# <a name='keywords'></a>KEYWORDS |
||||||
|
|
||||||
|
[module](\.\./\.\./\.\./index\.md\#module), [ssh](\.\./\.\./\.\./index\.md\#ssh) |
||||||
|
|
||||||
|
# <a name='copyright'></a>COPYRIGHT |
||||||
|
|
||||||
|
Copyright © 2009 |
@ -0,0 +1,87 @@ |
|||||||
|
|
||||||
|
[//000000001]: # (shellspy\_module\_punk::uc \- \-) |
||||||
|
[//000000002]: # (Generated from file '\_module\_uc\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown') |
||||||
|
[//000000003]: # (Copyright © 2024) |
||||||
|
[//000000004]: # (shellspy\_module\_punk::uc\(0\) 0\.1\.0 doc "\-") |
||||||
|
|
||||||
|
<hr> [ <a href="../../../toc.md">Main Table Of Contents</a> | <a |
||||||
|
href="../../toc.md">Table Of Contents</a> | <a |
||||||
|
href="../../../index.md">Keyword Index</a> ] <hr> |
||||||
|
|
||||||
|
# NAME |
||||||
|
|
||||||
|
shellspy\_module\_punk::uc \- 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::uc::class](#subsection3) |
||||||
|
|
||||||
|
- [Namespace punk::uc](#subsection4) |
||||||
|
|
||||||
|
- [Namespace punk::uc::lib](#subsection5) |
||||||
|
|
||||||
|
- [Internal](#section4) |
||||||
|
|
||||||
|
- [Namespace punk::uc::system](#subsection6) |
||||||
|
|
||||||
|
- [Keywords](#keywords) |
||||||
|
|
||||||
|
- [Copyright](#copyright) |
||||||
|
|
||||||
|
# <a name='synopsis'></a>SYNOPSIS |
||||||
|
|
||||||
|
package require punk::uc |
||||||
|
|
||||||
|
# <a name='description'></a>DESCRIPTION |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
# <a name='section2'></a>Overview |
||||||
|
|
||||||
|
overview of punk::uc |
||||||
|
|
||||||
|
## <a name='subsection1'></a>Concepts |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
## <a name='subsection2'></a>dependencies |
||||||
|
|
||||||
|
packages used by punk::uc |
||||||
|
|
||||||
|
- __Tcl 8\.6__ |
||||||
|
|
||||||
|
# <a name='section3'></a>API |
||||||
|
|
||||||
|
## <a name='subsection3'></a>Namespace punk::uc::class |
||||||
|
|
||||||
|
class definitions |
||||||
|
|
||||||
|
## <a name='subsection4'></a>Namespace punk::uc |
||||||
|
|
||||||
|
## <a name='subsection5'></a>Namespace punk::uc::lib |
||||||
|
|
||||||
|
# <a name='section4'></a>Internal |
||||||
|
|
||||||
|
## <a name='subsection6'></a>Namespace punk::uc::system |
||||||
|
|
||||||
|
# <a name='keywords'></a>KEYWORDS |
||||||
|
|
||||||
|
[module](\.\./\.\./\.\./index\.md\#module) |
||||||
|
|
||||||
|
# <a name='copyright'></a>COPYRIGHT |
||||||
|
|
||||||
|
Copyright © 2024 |
@ -1,18 +1,20 @@ |
|||||||
[toc_begin {Table Of Contents} doc] |
[toc_begin {Table Of Contents} doc] |
||||||
[item doc/files/_module_overtype-1.5.1.tm.html overtype_module_overtype {overtype text layout - ansi aware}] |
[item doc/files/_module_overtype-1.6.2.tm.html overtype_module_overtype {overtype text layout - ansi aware}] |
||||||
[item doc/files/_module_overtype-1.5.2.tm.html overtype_module_overtype {overtype text layout - ansi aware}] |
|
||||||
[item doc/files/_module_overtype-1.5.3.tm.html overtype_module_overtype {overtype text layout - ansi aware}] |
|
||||||
[item doc/files/main.html punkshell {punkshell - Core}] |
[item doc/files/main.html punkshell {punkshell - Core}] |
||||||
[item doc/files/project_changes.html punkshell__project_changes {punkshell Changes}] |
[item doc/files/project_changes.html punkshell__project_changes {punkshell Changes}] |
||||||
[item doc/files/project_intro.html punkshell__project_intro {Introduction to punkshell}] |
[item doc/files/project_intro.html punkshell__project_intro {Introduction to punkshell}] |
||||||
[item doc/files/punk/_module_ansi-0.1.0.tm.html punkshell_module_punk::ansi {Ansi string functions}] |
[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/_module_args-0.1.0.tm.html punkshell_module_punk::args {args parsing}] |
||||||
[item doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap {capability provider and handler plugin system}] |
[item doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap {capability provider and handler plugin system}] |
||||||
[item doc/files/punk/_module_char-0.1.0.tm.html punkshell_module_punk::char {character-set and unicode utilities}] |
[item doc/files/punk/_module_char-0.1.0.tm.html punkshell_module_punk::char {character-set and unicode utilities}] |
||||||
[item doc/files/punk/_module_encmime-0.1.0.tm.html punkshell_module_punk::encmime {mime encodings related subset of tcllib mime}] |
[item doc/files/punk/_module_encmime-0.1.0.tm.html punkshell_module_punk::encmime {mime encodings related subset of tcllib mime}] |
||||||
[item doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline {file line-handling utilities}] |
[item doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline {file line-handling utilities}] |
||||||
[item doc/files/punk/_module_flib-0.1.0.tm.html punkshell_module_punk::flib {flib experimental}] |
[item doc/files/punk/_module_flib-0.1.0.tm.html punkshell_module_punk::flib {flib experimental}] |
||||||
[item doc/files/punk/_module_lib-0.1.0.tm.html punkshell_module_punk::lib {punk general utility functions}] |
[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/mix/commandset/_module_project-0.1.0.tm.html punkshell_module_punk::mix::commandset::project {dec commandset - project}] |
||||||
[item doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path {Filesystem path utilities}] |
[item doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path {Filesystem path utilities}] |
||||||
|
[item doc/files/punk/_module_assertion-0.1.0.tm.html shellspy_module_punk::assertion {assertion alternative to control::assert}] |
||||||
|
[item doc/files/punk/_module_basictelnet-0.1.0.tm.html shellspy_module_punk::basictelnet {basic telnet client - DKF/Wiki}] |
||||||
|
[item doc/files/punk/_module_sshrun-0.1.0.tm.html shellspy_module_punk::sshrun {Tcl procedures to execute tcl scripts in remote hosts}] |
||||||
|
[item doc/files/punk/_module_uc-0.1.0.tm.html shellspy_module_punk::uc {Module API}] |
||||||
[toc_end] |
[toc_end] |
||||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@ |
|||||||
doc {doc/toc {{doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap {capability provider and handler plugin system}} {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_lib-0.1.0.tm.html punkshell_module_punk::lib {punk general utility functions}} {doc/files/_module_overtype-1.5.1.tm.html overtype_module_overtype {overtype text layout - ansi aware}} {doc/files/project_intro.html punkshell__project_intro {Introduction to punkshell}} {doc/files/_module_overtype-1.5.2.tm.html overtype_module_overtype {overtype text layout - ansi aware}} {doc/files/_module_overtype-1.5.3.tm.html overtype_module_overtype {overtype text layout - ansi aware}} {doc/files/main.html punkshell {punkshell - Core}} {doc/files/punk/_module_flib-0.1.0.tm.html punkshell_module_punk::flib {flib experimental}} {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_fileline-0.1.0.tm.html punkshell_module_punk::fileline {file line-handling utilities}} {doc/files/punk/_module_ansi-0.1.0.tm.html punkshell_module_punk::ansi {Ansi string functions}}}} |
doc {doc/toc {{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/_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 shellspy_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_assertion-0.1.0.tm.html shellspy_module_punk::assertion {assertion alternative to control::assert}} {doc/files/project_intro.html punkshell__project_intro {Introduction to punkshell}} {doc/files/_module_overtype-1.6.2.tm.html overtype_module_overtype {overtype text layout - ansi aware}} {doc/files/punk/_module_sshrun-0.1.0.tm.html shellspy_module_punk::sshrun {Tcl procedures to execute tcl scripts in remote hosts}} {doc/files/main.html punkshell {punkshell - Core}} {doc/files/punk/_module_flib-0.1.0.tm.html punkshell_module_punk::flib {flib experimental}} {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_basictelnet-0.1.0.tm.html shellspy_module_punk::basictelnet {basic telnet client - DKF/Wiki}} {doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline {file line-handling utilities}}}} |
File diff suppressed because one or more lines are too long
@ -0,0 +1,192 @@ |
|||||||
|
<!DOCTYPE html><html><head> |
||||||
|
<title>shellspy_module_punk::assertion - per-namespace assertions with </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_assertion-0.1.0.tm.man' by tcllib/doctools with format 'html' |
||||||
|
--> |
||||||
|
<!-- Copyright &copy; 2024 |
||||||
|
--> |
||||||
|
<!-- shellspy_module_punk::assertion.0 |
||||||
|
--> |
||||||
|
<body><hr> [ |
||||||
|
<a href="../../../toc.html">Main Table Of Contents</a> |
||||||
|
| <a href="../../toc.html">Table Of Contents</a> |
||||||
|
| <a href="../../../index.html">Keyword Index</a> |
||||||
|
] <hr> |
||||||
|
<div class="doctools"> |
||||||
|
<h1 class="doctools_title">shellspy_module_punk::assertion(0) 0.1.0 doc "per-namespace assertions with "</h1> |
||||||
|
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2> |
||||||
|
<p>shellspy_module_punk::assertion - assertion alternative to control::assert</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::assertion::class</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection4">Namespace punk::assertion</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection5">Namespace punk::assertion::lib</a></li> |
||||||
|
</ul> |
||||||
|
</li> |
||||||
|
<li class="doctools_section"><a href="#section4">Internal</a> |
||||||
|
<ul> |
||||||
|
<li class="doctools_subsection"><a href="#subsection6">Namespace punk::assertion::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::assertion</b></li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2> |
||||||
|
<p>The punk::assertion library has the same semantics as Tcllib's control::assert library for the assert command itself.</p> |
||||||
|
<p>The main difference is the way in which assert is enabled/disabled in namespaces.</p> |
||||||
|
<p>Due to commands such as 'namespace path' - the assert command could be available in arbitrary namespaces unrelated by tree structure to namespaces where assert has been directly imported.</p> |
||||||
|
<p>punk::assertion::active 0|1 allows activating and deactivating assertions in any namespace where the assert command is available - but only affecting the activations state of the namespace in which it is called.</p> |
||||||
|
<p>If such a non-primary assertion namespace never had active set to 0 or 1 - then it will activate/deactivate when the namespace corresponding to the found assert command (primary) is activated/deactivated.</p> |
||||||
|
<p>Once marked active or inactive - such a non-primary namespace will no longer follow the primary</p> |
||||||
|
</div> |
||||||
|
<div id="section2" class="doctools_section"><h2><a name="section2">Overview</a></h2> |
||||||
|
<p>overview of punk::assertion</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::assertion</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::assertion::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::assertion</a></h3> |
||||||
|
<p>Core API functions for punk::assertion</p> |
||||||
|
<dl class="doctools_definitions"> |
||||||
|
</dl> |
||||||
|
</div> |
||||||
|
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Namespace punk::assertion::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::assertion::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#assert">assert</a>, <a href="../../../index.html#assertion">assertion</a>, <a href="../../../index.html#debug">debug</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 © 2024</p> |
||||||
|
</div> |
||||||
|
</div></body></html> |
@ -0,0 +1,280 @@ |
|||||||
|
<!DOCTYPE html><html><head> |
||||||
|
<title>shellspy_module_punk::sshrun - punk::sshrun tclssh clone</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_sshrun-0.1.0.tm.man' by tcllib/doctools with format 'html' |
||||||
|
--> |
||||||
|
<!-- Copyright &copy; 2009 |
||||||
|
--> |
||||||
|
<!-- shellspy_module_punk::sshrun.0 |
||||||
|
--> |
||||||
|
<body><hr> [ |
||||||
|
<a href="../../../toc.html">Main Table Of Contents</a> |
||||||
|
| <a href="../../toc.html">Table Of Contents</a> |
||||||
|
| <a href="../../../index.html">Keyword Index</a> |
||||||
|
] <hr> |
||||||
|
<div class="doctools"> |
||||||
|
<h1 class="doctools_title">shellspy_module_punk::sshrun(0) 0.1.0 doc "punk::sshrun tclssh clone"</h1> |
||||||
|
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2> |
||||||
|
<p>shellspy_module_punk::sshrun - Tcl procedures to execute tcl scripts in remote hosts</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::sshrun::class</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection4">Namespace punk::sshrun</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection5">Namespace punk::sshrun::lib</a></li> |
||||||
|
</ul> |
||||||
|
</li> |
||||||
|
<li class="doctools_section"><a href="#section4">Internal</a> |
||||||
|
<ul> |
||||||
|
<li class="doctools_subsection"><a href="#subsection6">Namespace punk::sshrun::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::sshrun</b></li> |
||||||
|
</ul> |
||||||
|
<ul class="doctools_syntax"> |
||||||
|
<li><a href="#1">connect <i class="arg">args</i></a></li> |
||||||
|
<li><a href="#2">disconnect <i class="arg">host</i></a></li> |
||||||
|
<li><a href="#3">push <i class="arg">host</i> <i class="arg">script</i></a></li> |
||||||
|
<li><a href="#4">send <i class="arg">host</i></a></li> |
||||||
|
<li><a href="#5">send_exit <i class="arg">host</i></a></li> |
||||||
|
<li><a href="#6">send_exit <i class="arg">host</i></a></li> |
||||||
|
<li><a href="#7">pop_all <i class="arg">host</i> <i class="arg">output_varname</i></a></li> |
||||||
|
<li><a href="#8">pop_read <i class="arg">host</i> <i class="arg">numbytes</i> <i class="arg">output_varname</i></a></li> |
||||||
|
<li><a href="#9">hfileevent <i class="arg">host</i> <i class="arg">readable_writable</i> <i class="arg">script</i></a></li> |
||||||
|
<li><a href="#10">hconfigure <i class="arg">host</i> <i class="arg">args</i></a></li> |
||||||
|
<li><a href="#11">rexec <i class="arg">host</i> <i class="arg">script</i> <i class="arg">output_varname</i></a></li> |
||||||
|
<li><a href="#12">get_filehandle <i class="arg">host</i></a></li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2> |
||||||
|
<p>This is a clone of tclssh by Jose F. Nieves</p> |
||||||
|
<p>The original repo is at: https://bitbucket.org/noaaport/tclssh/src/master/</p> |
||||||
|
<p>This version is namespaced under punk::sshrun specifically for the Punk shell project - and may lag the original project or diverge.</p> |
||||||
|
<p>You are encouraged to use the original Tclssh source from the above URL for your own projects</p> |
||||||
|
</div> |
||||||
|
<div id="section2" class="doctools_section"><h2><a name="section2">Overview</a></h2> |
||||||
|
<p>overview of punk::sshrun</p> |
||||||
|
<p>SYNOPSIS</p> |
||||||
|
<p>package require punk::sshrun</p> |
||||||
|
<p>-</p> |
||||||
|
<p>punk::sshrun::connect [-t <tclsh_name>] [-- <ssh_options>] [<user>@]<host></p> |
||||||
|
<p>Defaults: -t tclsh</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::sshrun</p> |
||||||
|
<ul class="doctools_itemized"> |
||||||
|
<li><p><b class="package">Tcl 8.6</b></p></li> |
||||||
|
<li><p><b class="package">cmdline</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::sshrun::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::sshrun</a></h3> |
||||||
|
<p>Core API functions for punk::sshrun</p> |
||||||
|
<dl class="doctools_definitions"> |
||||||
|
<dt><a name="1">connect <i class="arg">args</i></a></dt> |
||||||
|
<dd><p>Must be called first.</p> |
||||||
|
<p>This proc opens an io channel to the tclsh in the remote host (via ssh) that is kept in an internal variable for subsequent use.</p> |
||||||
|
<p>The file handle can be retrieved if desired through the command: get_filehandle {host}</p></dd> |
||||||
|
<dt><a name="2">disconnect <i class="arg">host</i></a></dt> |
||||||
|
<dd><p>Must be called last. Closes the filehandle opened by connect.</p></dd> |
||||||
|
<dt><a name="3">push <i class="arg">host</i> <i class="arg">script</i></a></dt> |
||||||
|
<dd><p><script> can be any tcl code.</p> |
||||||
|
<p>For example, if the remote host is named "diablo"</p> |
||||||
|
<pre class="doctools_example"> |
||||||
|
ssh::push "diablo" "exec date" |
||||||
|
ssh::push "diablo" "exec uname -a" |
||||||
|
</pre> |
||||||
|
<p>The commands are note executed immediately. Instead, the "push" proc simply accumulates them in a list that is sent to the host when the "send" procedure is executed.</p> |
||||||
|
<p>Each push proc inserts the newline '\n' character after each <script></p> |
||||||
|
<p>In the above example. Internally, each <script> is a member of a list, and when the "send" proc is invoked the entire script is constructed as a "join <list> \n</p></dd> |
||||||
|
<dt><a name="4">send <i class="arg">host</i></a></dt> |
||||||
|
<dd><p>This proc does the equivalent of a</p> |
||||||
|
<pre class="doctools_example"> |
||||||
|
puts <filehandle> [join <script_list> \n] |
||||||
|
flush <filehandle> |
||||||
|
</pre> |
||||||
|
</dd> |
||||||
|
<dt><a name="5">send_exit <i class="arg">host</i></a></dt> |
||||||
|
<dd><p>This proc is similar to the above, but it "pushes" an exit command at the end of the script. The proc does the equivalent of</p> |
||||||
|
<pre class="doctools_example"> |
||||||
|
ssh::push <host> "exit" |
||||||
|
ssh::send <host> |
||||||
|
</pre> |
||||||
|
<p>The net effect if this is that the remote host's tclsh will exit, so that the filehandle receives an eof and we can use</p> |
||||||
|
<pre class="doctools_example"> |
||||||
|
[read <filehandle>] |
||||||
|
</pre> |
||||||
|
<p>to read the entire output at once (see the pop proc below)</p></dd> |
||||||
|
<dt><a name="6">send_exit <i class="arg">host</i></a></dt> |
||||||
|
<dd><p>After executing a "send", this can be used to read one line of output. The proc does the equivalent of</p> |
||||||
|
<pre class="doctools_example"> |
||||||
|
[gets <filehandle> line] |
||||||
|
</pre> |
||||||
|
</dd> |
||||||
|
<dt><a name="7">pop_all <i class="arg">host</i> <i class="arg">output_varname</i></a></dt> |
||||||
|
<dd><p>This proc does the equivalent of</p> |
||||||
|
<pre class="doctools_example"> |
||||||
|
while {[pop_line $host line] >=0} { |
||||||
|
puts $line; |
||||||
|
} |
||||||
|
</pre> |
||||||
|
<p>but all the output is returned as one string in output_varname.</p> |
||||||
|
<p>It should be used only when we know that the remote host's tclsh will exit, so that the above code will detect the eof and exit</p> |
||||||
|
<p>(see the send_exit proc above)</p> |
||||||
|
<p>The function returns the number of lines read (0 if nothing is read before encoutering eof)</p></dd> |
||||||
|
<dt><a name="8">pop_read <i class="arg">host</i> <i class="arg">numbytes</i> <i class="arg">output_varname</i></a></dt> |
||||||
|
<dd><p>Returns: numbytes read. If numbytes is not positive, then read is called without the numbytes argument.</p></dd> |
||||||
|
<dt><a name="9">hfileevent <i class="arg">host</i> <i class="arg">readable_writable</i> <i class="arg">script</i></a></dt> |
||||||
|
<dd><p>Equivalent to:</p> |
||||||
|
<pre class="doctools_example"> |
||||||
|
fileevent <filehandle> $readable_writable $script |
||||||
|
</pre> |
||||||
|
</dd> |
||||||
|
<dt><a name="10">hconfigure <i class="arg">host</i> <i class="arg">args</i></a></dt> |
||||||
|
<dd></dd> |
||||||
|
<dt><a name="11">rexec <i class="arg">host</i> <i class="arg">script</i> <i class="arg">output_varname</i></a></dt> |
||||||
|
<dd><p>shortcut for:</p> |
||||||
|
<pre class="doctools_example"> |
||||||
|
ssh::rexec_nopop $host $script |
||||||
|
ssh::pop_all $host outputvar |
||||||
|
</pre> |
||||||
|
</dd> |
||||||
|
<dt><a name="12">get_filehandle <i class="arg">host</i></a></dt> |
||||||
|
<dd></dd> |
||||||
|
</dl> |
||||||
|
</div> |
||||||
|
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Namespace punk::sshrun::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::sshrun::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#ssh">ssh</a></p> |
||||||
|
</div> |
||||||
|
<div id="copyright" class="doctools_section"><h2><a name="copyright">Copyright</a></h2> |
||||||
|
<p>Copyright © 2009</p> |
||||||
|
</div> |
||||||
|
</div></body></html> |
Loading…
Reference in new issue