Julian Noble
7 months ago
105 changed files with 14653 additions and 3915 deletions
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,318 @@ |
|||||||
|
'\" |
||||||
|
'\" Generated from file '_module_argparsingtest-0\&.1\&.0\&.tm\&.man' by tcllib/doctools with format 'nroff' |
||||||
|
'\" Copyright (c) 2024 |
||||||
|
'\" |
||||||
|
.TH "shellspy_module_argparsingtest" 0 0\&.1\&.0 doc "-" |
||||||
|
.\" The -*- nroff -*- definitions below are for supplemental macros used |
||||||
|
.\" in Tcl/Tk manual entries. |
||||||
|
.\" |
||||||
|
.\" .AP type name in/out ?indent? |
||||||
|
.\" Start paragraph describing an argument to a library procedure. |
||||||
|
.\" type is type of argument (int, etc.), in/out is either "in", "out", |
||||||
|
.\" or "in/out" to describe whether procedure reads or modifies arg, |
||||||
|
.\" and indent is equivalent to second arg of .IP (shouldn't ever be |
||||||
|
.\" needed; use .AS below instead) |
||||||
|
.\" |
||||||
|
.\" .AS ?type? ?name? |
||||||
|
.\" Give maximum sizes of arguments for setting tab stops. Type and |
||||||
|
.\" name are examples of largest possible arguments that will be passed |
||||||
|
.\" to .AP later. If args are omitted, default tab stops are used. |
||||||
|
.\" |
||||||
|
.\" .BS |
||||||
|
.\" Start box enclosure. From here until next .BE, everything will be |
||||||
|
.\" enclosed in one large box. |
||||||
|
.\" |
||||||
|
.\" .BE |
||||||
|
.\" End of box enclosure. |
||||||
|
.\" |
||||||
|
.\" .CS |
||||||
|
.\" Begin code excerpt. |
||||||
|
.\" |
||||||
|
.\" .CE |
||||||
|
.\" End code excerpt. |
||||||
|
.\" |
||||||
|
.\" .VS ?version? ?br? |
||||||
|
.\" Begin vertical sidebar, for use in marking newly-changed parts |
||||||
|
.\" of man pages. The first argument is ignored and used for recording |
||||||
|
.\" the version when the .VS was added, so that the sidebars can be |
||||||
|
.\" found and removed when they reach a certain age. If another argument |
||||||
|
.\" is present, then a line break is forced before starting the sidebar. |
||||||
|
.\" |
||||||
|
.\" .VE |
||||||
|
.\" End of vertical sidebar. |
||||||
|
.\" |
||||||
|
.\" .DS |
||||||
|
.\" Begin an indented unfilled display. |
||||||
|
.\" |
||||||
|
.\" .DE |
||||||
|
.\" End of indented unfilled display. |
||||||
|
.\" |
||||||
|
.\" .SO ?manpage? |
||||||
|
.\" Start of list of standard options for a Tk widget. The manpage |
||||||
|
.\" argument defines where to look up the standard options; if |
||||||
|
.\" omitted, defaults to "options". The options follow on successive |
||||||
|
.\" lines, in three columns separated by tabs. |
||||||
|
.\" |
||||||
|
.\" .SE |
||||||
|
.\" End of list of standard options for a Tk widget. |
||||||
|
.\" |
||||||
|
.\" .OP cmdName dbName dbClass |
||||||
|
.\" Start of description of a specific option. cmdName gives the |
||||||
|
.\" option's name as specified in the class command, dbName gives |
||||||
|
.\" the option's name in the option database, and dbClass gives |
||||||
|
.\" the option's class in the option database. |
||||||
|
.\" |
||||||
|
.\" .UL arg1 arg2 |
||||||
|
.\" Print arg1 underlined, then print arg2 normally. |
||||||
|
.\" |
||||||
|
.\" .QW arg1 ?arg2? |
||||||
|
.\" Print arg1 in quotes, then arg2 normally (for trailing punctuation). |
||||||
|
.\" |
||||||
|
.\" .PQ arg1 ?arg2? |
||||||
|
.\" Print an open parenthesis, arg1 in quotes, then arg2 normally |
||||||
|
.\" (for trailing punctuation) and then a closing parenthesis. |
||||||
|
.\" |
||||||
|
.\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. |
||||||
|
.if t .wh -1.3i ^B |
||||||
|
.nr ^l \n(.l |
||||||
|
.ad b |
||||||
|
.\" # Start an argument description |
||||||
|
.de AP |
||||||
|
.ie !"\\$4"" .TP \\$4 |
||||||
|
.el \{\ |
||||||
|
. ie !"\\$2"" .TP \\n()Cu |
||||||
|
. el .TP 15 |
||||||
|
.\} |
||||||
|
.ta \\n()Au \\n()Bu |
||||||
|
.ie !"\\$3"" \{\ |
||||||
|
\&\\$1 \\fI\\$2\\fP (\\$3) |
||||||
|
.\".b |
||||||
|
.\} |
||||||
|
.el \{\ |
||||||
|
.br |
||||||
|
.ie !"\\$2"" \{\ |
||||||
|
\&\\$1 \\fI\\$2\\fP |
||||||
|
.\} |
||||||
|
.el \{\ |
||||||
|
\&\\fI\\$1\\fP |
||||||
|
.\} |
||||||
|
.\} |
||||||
|
.. |
||||||
|
.\" # define tabbing values for .AP |
||||||
|
.de AS |
||||||
|
.nr )A 10n |
||||||
|
.if !"\\$1"" .nr )A \\w'\\$1'u+3n |
||||||
|
.nr )B \\n()Au+15n |
||||||
|
.\" |
||||||
|
.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n |
||||||
|
.nr )C \\n()Bu+\\w'(in/out)'u+2n |
||||||
|
.. |
||||||
|
.AS Tcl_Interp Tcl_CreateInterp in/out |
||||||
|
.\" # BS - start boxed text |
||||||
|
.\" # ^y = starting y location |
||||||
|
.\" # ^b = 1 |
||||||
|
.de BS |
||||||
|
.br |
||||||
|
.mk ^y |
||||||
|
.nr ^b 1u |
||||||
|
.if n .nf |
||||||
|
.if n .ti 0 |
||||||
|
.if n \l'\\n(.lu\(ul' |
||||||
|
.if n .fi |
||||||
|
.. |
||||||
|
.\" # BE - end boxed text (draw box now) |
||||||
|
.de BE |
||||||
|
.nf |
||||||
|
.ti 0 |
||||||
|
.mk ^t |
||||||
|
.ie n \l'\\n(^lu\(ul' |
||||||
|
.el \{\ |
||||||
|
.\" Draw four-sided box normally, but don't draw top of |
||||||
|
.\" box if the box started on an earlier page. |
||||||
|
.ie !\\n(^b-1 \{\ |
||||||
|
\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' |
||||||
|
.\} |
||||||
|
.el \}\ |
||||||
|
\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' |
||||||
|
.\} |
||||||
|
.\} |
||||||
|
.fi |
||||||
|
.br |
||||||
|
.nr ^b 0 |
||||||
|
.. |
||||||
|
.\" # VS - start vertical sidebar |
||||||
|
.\" # ^Y = starting y location |
||||||
|
.\" # ^v = 1 (for troff; for nroff this doesn't matter) |
||||||
|
.de VS |
||||||
|
.if !"\\$2"" .br |
||||||
|
.mk ^Y |
||||||
|
.ie n 'mc \s12\(br\s0 |
||||||
|
.el .nr ^v 1u |
||||||
|
.. |
||||||
|
.\" # VE - end of vertical sidebar |
||||||
|
.de VE |
||||||
|
.ie n 'mc |
||||||
|
.el \{\ |
||||||
|
.ev 2 |
||||||
|
.nf |
||||||
|
.ti 0 |
||||||
|
.mk ^t |
||||||
|
\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' |
||||||
|
.sp -1 |
||||||
|
.fi |
||||||
|
.ev |
||||||
|
.\} |
||||||
|
.nr ^v 0 |
||||||
|
.. |
||||||
|
.\" # Special macro to handle page bottom: finish off current |
||||||
|
.\" # box/sidebar if in box/sidebar mode, then invoked standard |
||||||
|
.\" # page bottom macro. |
||||||
|
.de ^B |
||||||
|
.ev 2 |
||||||
|
'ti 0 |
||||||
|
'nf |
||||||
|
.mk ^t |
||||||
|
.if \\n(^b \{\ |
||||||
|
.\" Draw three-sided box if this is the box's first page, |
||||||
|
.\" draw two sides but no top otherwise. |
||||||
|
.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c |
||||||
|
.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c |
||||||
|
.\} |
||||||
|
.if \\n(^v \{\ |
||||||
|
.nr ^x \\n(^tu+1v-\\n(^Yu |
||||||
|
\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c |
||||||
|
.\} |
||||||
|
.bp |
||||||
|
'fi |
||||||
|
.ev |
||||||
|
.if \\n(^b \{\ |
||||||
|
.mk ^y |
||||||
|
.nr ^b 2 |
||||||
|
.\} |
||||||
|
.if \\n(^v \{\ |
||||||
|
.mk ^Y |
||||||
|
.\} |
||||||
|
.. |
||||||
|
.\" # DS - begin display |
||||||
|
.de DS |
||||||
|
.RS |
||||||
|
.nf |
||||||
|
.sp |
||||||
|
.. |
||||||
|
.\" # DE - end display |
||||||
|
.de DE |
||||||
|
.fi |
||||||
|
.RE |
||||||
|
.sp |
||||||
|
.. |
||||||
|
.\" # SO - start of list of standard options |
||||||
|
.de SO |
||||||
|
'ie '\\$1'' .ds So \\fBoptions\\fR |
||||||
|
'el .ds So \\fB\\$1\\fR |
||||||
|
.SH "STANDARD OPTIONS" |
||||||
|
.LP |
||||||
|
.nf |
||||||
|
.ta 5.5c 11c |
||||||
|
.ft B |
||||||
|
.. |
||||||
|
.\" # SE - end of list of standard options |
||||||
|
.de SE |
||||||
|
.fi |
||||||
|
.ft R |
||||||
|
.LP |
||||||
|
See the \\*(So manual entry for details on the standard options. |
||||||
|
.. |
||||||
|
.\" # OP - start of full description for a single option |
||||||
|
.de OP |
||||||
|
.LP |
||||||
|
.nf |
||||||
|
.ta 4c |
||||||
|
Command-Line Name: \\fB\\$1\\fR |
||||||
|
Database Name: \\fB\\$2\\fR |
||||||
|
Database Class: \\fB\\$3\\fR |
||||||
|
.fi |
||||||
|
.IP |
||||||
|
.. |
||||||
|
.\" # CS - begin code excerpt |
||||||
|
.de CS |
||||||
|
.RS |
||||||
|
.nf |
||||||
|
.ta .25i .5i .75i 1i |
||||||
|
.. |
||||||
|
.\" # CE - end code excerpt |
||||||
|
.de CE |
||||||
|
.fi |
||||||
|
.RE |
||||||
|
.. |
||||||
|
.\" # UL - underline word |
||||||
|
.de UL |
||||||
|
\\$1\l'|0\(ul'\\$2 |
||||||
|
.. |
||||||
|
.\" # QW - apply quotation marks to word |
||||||
|
.de QW |
||||||
|
.ie '\\*(lq'"' ``\\$1''\\$2 |
||||||
|
.\"" fix emacs highlighting |
||||||
|
.el \\*(lq\\$1\\*(rq\\$2 |
||||||
|
.. |
||||||
|
.\" # PQ - apply parens and quotation marks to word |
||||||
|
.de PQ |
||||||
|
.ie '\\*(lq'"' (``\\$1''\\$2)\\$3 |
||||||
|
.\"" fix emacs highlighting |
||||||
|
.el (\\*(lq\\$1\\*(rq\\$2)\\$3 |
||||||
|
.. |
||||||
|
.\" # QR - quoted range |
||||||
|
.de QR |
||||||
|
.ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3 |
||||||
|
.\"" fix emacs highlighting |
||||||
|
.el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3 |
||||||
|
.. |
||||||
|
.\" # MT - "empty" string |
||||||
|
.de MT |
||||||
|
.QW "" |
||||||
|
.. |
||||||
|
.BS |
||||||
|
.SH NAME |
||||||
|
shellspy_module_argparsingtest \- Module API |
||||||
|
.SH SYNOPSIS |
||||||
|
package require \fBargparsingtest \fR |
||||||
|
.sp |
||||||
|
.BE |
||||||
|
.SH DESCRIPTION |
||||||
|
.PP |
||||||
|
- |
||||||
|
.SH OVERVIEW |
||||||
|
.PP |
||||||
|
overview of argparsingtest |
||||||
|
.SS CONCEPTS |
||||||
|
.PP |
||||||
|
- |
||||||
|
.SS DEPENDENCIES |
||||||
|
.PP |
||||||
|
packages used by argparsingtest |
||||||
|
.IP \(bu |
||||||
|
\fBTcl 8\&.6\fR |
||||||
|
.PP |
||||||
|
.SH API |
||||||
|
.SS "NAMESPACE ARGPARSINGTEST::CLASS" |
||||||
|
.PP |
||||||
|
class definitions |
||||||
|
.PP |
||||||
|
.SS "NAMESPACE ARGPARSINGTEST" |
||||||
|
.PP |
||||||
|
Core API functions for argparsingtest |
||||||
|
.PP |
||||||
|
.SS "NAMESPACE ARGPARSINGTEST::LIB" |
||||||
|
.PP |
||||||
|
Secondary functions that are part of the API |
||||||
|
.PP |
||||||
|
.SH INTERNAL |
||||||
|
.SS "NAMESPACE ARGPARSINGTEST::SYSTEM" |
||||||
|
.PP |
||||||
|
Internal functions that are not part of the API |
||||||
|
.SH KEYWORDS |
||||||
|
module |
||||||
|
.SH COPYRIGHT |
||||||
|
.nf |
||||||
|
Copyright (c) 2024 |
||||||
|
|
||||||
|
.fi |
@ -0,0 +1,354 @@ |
|||||||
|
'\" |
||||||
|
'\" Generated from file '_module_overtype-1\&.6\&.3\&.tm\&.man' by tcllib/doctools with format 'nroff' |
||||||
|
'\" Copyright (c) 2024 |
||||||
|
'\" |
||||||
|
.TH "overtype_module_overtype" 0 1\&.6\&.3 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::renderspace\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::renderspace\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,318 @@ |
|||||||
|
'\" |
||||||
|
'\" Generated from file '_module_aliascore-0\&.1\&.0\&.tm\&.man' by tcllib/doctools with format 'nroff' |
||||||
|
'\" Copyright (c) 2024 |
||||||
|
'\" |
||||||
|
.TH "shellspy_module_punk::aliascore" 0 0\&.1\&.0 doc "-" |
||||||
|
.\" The -*- nroff -*- definitions below are for supplemental macros used |
||||||
|
.\" in Tcl/Tk manual entries. |
||||||
|
.\" |
||||||
|
.\" .AP type name in/out ?indent? |
||||||
|
.\" Start paragraph describing an argument to a library procedure. |
||||||
|
.\" type is type of argument (int, etc.), in/out is either "in", "out", |
||||||
|
.\" or "in/out" to describe whether procedure reads or modifies arg, |
||||||
|
.\" and indent is equivalent to second arg of .IP (shouldn't ever be |
||||||
|
.\" needed; use .AS below instead) |
||||||
|
.\" |
||||||
|
.\" .AS ?type? ?name? |
||||||
|
.\" Give maximum sizes of arguments for setting tab stops. Type and |
||||||
|
.\" name are examples of largest possible arguments that will be passed |
||||||
|
.\" to .AP later. If args are omitted, default tab stops are used. |
||||||
|
.\" |
||||||
|
.\" .BS |
||||||
|
.\" Start box enclosure. From here until next .BE, everything will be |
||||||
|
.\" enclosed in one large box. |
||||||
|
.\" |
||||||
|
.\" .BE |
||||||
|
.\" End of box enclosure. |
||||||
|
.\" |
||||||
|
.\" .CS |
||||||
|
.\" Begin code excerpt. |
||||||
|
.\" |
||||||
|
.\" .CE |
||||||
|
.\" End code excerpt. |
||||||
|
.\" |
||||||
|
.\" .VS ?version? ?br? |
||||||
|
.\" Begin vertical sidebar, for use in marking newly-changed parts |
||||||
|
.\" of man pages. The first argument is ignored and used for recording |
||||||
|
.\" the version when the .VS was added, so that the sidebars can be |
||||||
|
.\" found and removed when they reach a certain age. If another argument |
||||||
|
.\" is present, then a line break is forced before starting the sidebar. |
||||||
|
.\" |
||||||
|
.\" .VE |
||||||
|
.\" End of vertical sidebar. |
||||||
|
.\" |
||||||
|
.\" .DS |
||||||
|
.\" Begin an indented unfilled display. |
||||||
|
.\" |
||||||
|
.\" .DE |
||||||
|
.\" End of indented unfilled display. |
||||||
|
.\" |
||||||
|
.\" .SO ?manpage? |
||||||
|
.\" Start of list of standard options for a Tk widget. The manpage |
||||||
|
.\" argument defines where to look up the standard options; if |
||||||
|
.\" omitted, defaults to "options". The options follow on successive |
||||||
|
.\" lines, in three columns separated by tabs. |
||||||
|
.\" |
||||||
|
.\" .SE |
||||||
|
.\" End of list of standard options for a Tk widget. |
||||||
|
.\" |
||||||
|
.\" .OP cmdName dbName dbClass |
||||||
|
.\" Start of description of a specific option. cmdName gives the |
||||||
|
.\" option's name as specified in the class command, dbName gives |
||||||
|
.\" the option's name in the option database, and dbClass gives |
||||||
|
.\" the option's class in the option database. |
||||||
|
.\" |
||||||
|
.\" .UL arg1 arg2 |
||||||
|
.\" Print arg1 underlined, then print arg2 normally. |
||||||
|
.\" |
||||||
|
.\" .QW arg1 ?arg2? |
||||||
|
.\" Print arg1 in quotes, then arg2 normally (for trailing punctuation). |
||||||
|
.\" |
||||||
|
.\" .PQ arg1 ?arg2? |
||||||
|
.\" Print an open parenthesis, arg1 in quotes, then arg2 normally |
||||||
|
.\" (for trailing punctuation) and then a closing parenthesis. |
||||||
|
.\" |
||||||
|
.\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. |
||||||
|
.if t .wh -1.3i ^B |
||||||
|
.nr ^l \n(.l |
||||||
|
.ad b |
||||||
|
.\" # Start an argument description |
||||||
|
.de AP |
||||||
|
.ie !"\\$4"" .TP \\$4 |
||||||
|
.el \{\ |
||||||
|
. ie !"\\$2"" .TP \\n()Cu |
||||||
|
. el .TP 15 |
||||||
|
.\} |
||||||
|
.ta \\n()Au \\n()Bu |
||||||
|
.ie !"\\$3"" \{\ |
||||||
|
\&\\$1 \\fI\\$2\\fP (\\$3) |
||||||
|
.\".b |
||||||
|
.\} |
||||||
|
.el \{\ |
||||||
|
.br |
||||||
|
.ie !"\\$2"" \{\ |
||||||
|
\&\\$1 \\fI\\$2\\fP |
||||||
|
.\} |
||||||
|
.el \{\ |
||||||
|
\&\\fI\\$1\\fP |
||||||
|
.\} |
||||||
|
.\} |
||||||
|
.. |
||||||
|
.\" # define tabbing values for .AP |
||||||
|
.de AS |
||||||
|
.nr )A 10n |
||||||
|
.if !"\\$1"" .nr )A \\w'\\$1'u+3n |
||||||
|
.nr )B \\n()Au+15n |
||||||
|
.\" |
||||||
|
.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n |
||||||
|
.nr )C \\n()Bu+\\w'(in/out)'u+2n |
||||||
|
.. |
||||||
|
.AS Tcl_Interp Tcl_CreateInterp in/out |
||||||
|
.\" # BS - start boxed text |
||||||
|
.\" # ^y = starting y location |
||||||
|
.\" # ^b = 1 |
||||||
|
.de BS |
||||||
|
.br |
||||||
|
.mk ^y |
||||||
|
.nr ^b 1u |
||||||
|
.if n .nf |
||||||
|
.if n .ti 0 |
||||||
|
.if n \l'\\n(.lu\(ul' |
||||||
|
.if n .fi |
||||||
|
.. |
||||||
|
.\" # BE - end boxed text (draw box now) |
||||||
|
.de BE |
||||||
|
.nf |
||||||
|
.ti 0 |
||||||
|
.mk ^t |
||||||
|
.ie n \l'\\n(^lu\(ul' |
||||||
|
.el \{\ |
||||||
|
.\" Draw four-sided box normally, but don't draw top of |
||||||
|
.\" box if the box started on an earlier page. |
||||||
|
.ie !\\n(^b-1 \{\ |
||||||
|
\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' |
||||||
|
.\} |
||||||
|
.el \}\ |
||||||
|
\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' |
||||||
|
.\} |
||||||
|
.\} |
||||||
|
.fi |
||||||
|
.br |
||||||
|
.nr ^b 0 |
||||||
|
.. |
||||||
|
.\" # VS - start vertical sidebar |
||||||
|
.\" # ^Y = starting y location |
||||||
|
.\" # ^v = 1 (for troff; for nroff this doesn't matter) |
||||||
|
.de VS |
||||||
|
.if !"\\$2"" .br |
||||||
|
.mk ^Y |
||||||
|
.ie n 'mc \s12\(br\s0 |
||||||
|
.el .nr ^v 1u |
||||||
|
.. |
||||||
|
.\" # VE - end of vertical sidebar |
||||||
|
.de VE |
||||||
|
.ie n 'mc |
||||||
|
.el \{\ |
||||||
|
.ev 2 |
||||||
|
.nf |
||||||
|
.ti 0 |
||||||
|
.mk ^t |
||||||
|
\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' |
||||||
|
.sp -1 |
||||||
|
.fi |
||||||
|
.ev |
||||||
|
.\} |
||||||
|
.nr ^v 0 |
||||||
|
.. |
||||||
|
.\" # Special macro to handle page bottom: finish off current |
||||||
|
.\" # box/sidebar if in box/sidebar mode, then invoked standard |
||||||
|
.\" # page bottom macro. |
||||||
|
.de ^B |
||||||
|
.ev 2 |
||||||
|
'ti 0 |
||||||
|
'nf |
||||||
|
.mk ^t |
||||||
|
.if \\n(^b \{\ |
||||||
|
.\" Draw three-sided box if this is the box's first page, |
||||||
|
.\" draw two sides but no top otherwise. |
||||||
|
.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c |
||||||
|
.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c |
||||||
|
.\} |
||||||
|
.if \\n(^v \{\ |
||||||
|
.nr ^x \\n(^tu+1v-\\n(^Yu |
||||||
|
\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c |
||||||
|
.\} |
||||||
|
.bp |
||||||
|
'fi |
||||||
|
.ev |
||||||
|
.if \\n(^b \{\ |
||||||
|
.mk ^y |
||||||
|
.nr ^b 2 |
||||||
|
.\} |
||||||
|
.if \\n(^v \{\ |
||||||
|
.mk ^Y |
||||||
|
.\} |
||||||
|
.. |
||||||
|
.\" # DS - begin display |
||||||
|
.de DS |
||||||
|
.RS |
||||||
|
.nf |
||||||
|
.sp |
||||||
|
.. |
||||||
|
.\" # DE - end display |
||||||
|
.de DE |
||||||
|
.fi |
||||||
|
.RE |
||||||
|
.sp |
||||||
|
.. |
||||||
|
.\" # SO - start of list of standard options |
||||||
|
.de SO |
||||||
|
'ie '\\$1'' .ds So \\fBoptions\\fR |
||||||
|
'el .ds So \\fB\\$1\\fR |
||||||
|
.SH "STANDARD OPTIONS" |
||||||
|
.LP |
||||||
|
.nf |
||||||
|
.ta 5.5c 11c |
||||||
|
.ft B |
||||||
|
.. |
||||||
|
.\" # SE - end of list of standard options |
||||||
|
.de SE |
||||||
|
.fi |
||||||
|
.ft R |
||||||
|
.LP |
||||||
|
See the \\*(So manual entry for details on the standard options. |
||||||
|
.. |
||||||
|
.\" # OP - start of full description for a single option |
||||||
|
.de OP |
||||||
|
.LP |
||||||
|
.nf |
||||||
|
.ta 4c |
||||||
|
Command-Line Name: \\fB\\$1\\fR |
||||||
|
Database Name: \\fB\\$2\\fR |
||||||
|
Database Class: \\fB\\$3\\fR |
||||||
|
.fi |
||||||
|
.IP |
||||||
|
.. |
||||||
|
.\" # CS - begin code excerpt |
||||||
|
.de CS |
||||||
|
.RS |
||||||
|
.nf |
||||||
|
.ta .25i .5i .75i 1i |
||||||
|
.. |
||||||
|
.\" # CE - end code excerpt |
||||||
|
.de CE |
||||||
|
.fi |
||||||
|
.RE |
||||||
|
.. |
||||||
|
.\" # UL - underline word |
||||||
|
.de UL |
||||||
|
\\$1\l'|0\(ul'\\$2 |
||||||
|
.. |
||||||
|
.\" # QW - apply quotation marks to word |
||||||
|
.de QW |
||||||
|
.ie '\\*(lq'"' ``\\$1''\\$2 |
||||||
|
.\"" fix emacs highlighting |
||||||
|
.el \\*(lq\\$1\\*(rq\\$2 |
||||||
|
.. |
||||||
|
.\" # PQ - apply parens and quotation marks to word |
||||||
|
.de PQ |
||||||
|
.ie '\\*(lq'"' (``\\$1''\\$2)\\$3 |
||||||
|
.\"" fix emacs highlighting |
||||||
|
.el (\\*(lq\\$1\\*(rq\\$2)\\$3 |
||||||
|
.. |
||||||
|
.\" # QR - quoted range |
||||||
|
.de QR |
||||||
|
.ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3 |
||||||
|
.\"" fix emacs highlighting |
||||||
|
.el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3 |
||||||
|
.. |
||||||
|
.\" # MT - "empty" string |
||||||
|
.de MT |
||||||
|
.QW "" |
||||||
|
.. |
||||||
|
.BS |
||||||
|
.SH NAME |
||||||
|
shellspy_module_punk::aliascore \- Module API |
||||||
|
.SH SYNOPSIS |
||||||
|
package require \fBpunk::aliascore \fR |
||||||
|
.sp |
||||||
|
.BE |
||||||
|
.SH DESCRIPTION |
||||||
|
.PP |
||||||
|
- |
||||||
|
.SH OVERVIEW |
||||||
|
.PP |
||||||
|
overview of punk::aliascore |
||||||
|
.SS CONCEPTS |
||||||
|
.PP |
||||||
|
- |
||||||
|
.SS DEPENDENCIES |
||||||
|
.PP |
||||||
|
packages used by punk::aliascore |
||||||
|
.IP \(bu |
||||||
|
\fBTcl 8\&.6\fR |
||||||
|
.PP |
||||||
|
.SH API |
||||||
|
.SS "NAMESPACE PUNK::ALIASCORE::CLASS" |
||||||
|
.PP |
||||||
|
class definitions |
||||||
|
.PP |
||||||
|
.SS "NAMESPACE PUNK::ALIASCORE" |
||||||
|
.PP |
||||||
|
Core API functions for punk::aliascore |
||||||
|
.PP |
||||||
|
.SS "NAMESPACE PUNK::ALIASCORE::LIB" |
||||||
|
.PP |
||||||
|
Secondary functions that are part of the API |
||||||
|
.PP |
||||||
|
.SH INTERNAL |
||||||
|
.SS "NAMESPACE PUNK::ALIASCORE::SYSTEM" |
||||||
|
.PP |
||||||
|
Internal functions that are not part of the API |
||||||
|
.SH KEYWORDS |
||||||
|
module |
||||||
|
.SH COPYRIGHT |
||||||
|
.nf |
||||||
|
Copyright (c) 2024 |
||||||
|
|
||||||
|
.fi |
@ -0,0 +1,490 @@ |
|||||||
|
'\" |
||||||
|
'\" Generated from file '_module_island-0\&.1\&.0\&.tm\&.man' by tcllib/doctools with format 'nroff' |
||||||
|
'\" Copyright (c) 2024 |
||||||
|
'\" |
||||||
|
.TH "shellspy_module_punk::island" 0 0\&.1\&.0 doc "punk::island for safe interps" |
||||||
|
.\" 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::island \- filesystem islands for safe interps |
||||||
|
.SH SYNOPSIS |
||||||
|
package require \fBpunk::island \fR |
||||||
|
.sp |
||||||
|
\fBadd\fR \fIchild\fR \fIpath\fR |
||||||
|
.sp |
||||||
|
\fBreset\fR \fIchild\fR |
||||||
|
.sp |
||||||
|
\fBAllowed\fR \fIchild\fR \fIfname\fR |
||||||
|
.sp |
||||||
|
\fBFile\fR \fIchild\fR \fIcmd\fR \fIargs\fR |
||||||
|
.sp |
||||||
|
\fBOpen\fR \fIchild\fR \fIargs\fR |
||||||
|
.sp |
||||||
|
\fBExpose\fR \fIchild\fR \fIcmd\fR \fIargs\fR |
||||||
|
.sp |
||||||
|
\fBGlob\fR \fIchild\fR \fIargs\fR |
||||||
|
.sp |
||||||
|
\fBInit\fR \fIchild\fR |
||||||
|
.sp |
||||||
|
.BE |
||||||
|
.SH DESCRIPTION |
||||||
|
.PP |
||||||
|
Package to a allow a safe interpreter to access islands of the |
||||||
|
.PP |
||||||
|
filesystem only, i\&.e\&. restricted directory trees within the |
||||||
|
.PP |
||||||
|
filesystem\&. The package brings back file, open and glob to the child interp |
||||||
|
.PP |
||||||
|
interpreter, though in a restricted manner\&. |
||||||
|
.PP |
||||||
|
JN Warning: |
||||||
|
.PP |
||||||
|
This mechanism can have interactions with package loading from auto_path - needs review\&. |
||||||
|
.SH OVERVIEW |
||||||
|
.PP |
||||||
|
overview of punk::island |
||||||
|
.SS CONCEPTS |
||||||
|
.PP |
||||||
|
- |
||||||
|
.SS DEPENDENCIES |
||||||
|
.PP |
||||||
|
packages used by punk::island |
||||||
|
.IP \(bu |
||||||
|
\fBTcl 8\&.6\fR |
||||||
|
.PP |
||||||
|
.SH API |
||||||
|
.SS "NAMESPACE PUNK::ISLAND::CLASS" |
||||||
|
.PP |
||||||
|
class definitions |
||||||
|
.PP |
||||||
|
.SS "NAMESPACE PUNK::ISLAND::INTERPS" |
||||||
|
.PP |
||||||
|
hosts information for interpreters |
||||||
|
.PP |
||||||
|
.SS "NAMESPACE PUNK::ISLAND" |
||||||
|
.PP |
||||||
|
Core API functions for punk::island |
||||||
|
.TP |
||||||
|
\fBadd\fR \fIchild\fR \fIpath\fR |
||||||
|
.sp |
||||||
|
Add a path to the list of paths that are explicitely allowed for access |
||||||
|
.sp |
||||||
|
to a child interpreter\&. Access to any path that has not been explicitely |
||||||
|
.sp |
||||||
|
allowed will be denied\&. Paths that are added to the list of allowed |
||||||
|
.sp |
||||||
|
islands are always fully normalized\&. |
||||||
|
.sp |
||||||
|
Arguments: |
||||||
|
.RS |
||||||
|
.TP |
||||||
|
string \fIchild\fR |
||||||
|
Identifier of the child interpreter to control |
||||||
|
.RE |
||||||
|
.TP |
||||||
|
\fBreset\fR \fIchild\fR |
||||||
|
.sp |
||||||
|
Remove all access path allowance and arrange for the interpreter to be |
||||||
|
.sp |
||||||
|
able to return to the regular safe state\&. |
||||||
|
.sp |
||||||
|
Arguments: |
||||||
|
.RS |
||||||
|
.TP |
||||||
|
string \fIchild\fR |
||||||
|
Identifier of the child interpreter |
||||||
|
.RE |
||||||
|
.PP |
||||||
|
.SS "NAMESPACE PUNK::ISLAND::LIB" |
||||||
|
.PP |
||||||
|
Secondary functions that are part of the API |
||||||
|
.PP |
||||||
|
.SH INTERNAL |
||||||
|
.SS "NAMESPACE PUNK::ISLAND::SYSTEM" |
||||||
|
.PP |
||||||
|
Internal functions that are not part of the API |
||||||
|
.TP |
||||||
|
\fBAllowed\fR \fIchild\fR \fIfname\fR |
||||||
|
.sp |
||||||
|
Check that the file name passed as an argument is within the islands of |
||||||
|
.sp |
||||||
|
the filesystem that have been registered through the add command for a |
||||||
|
.sp |
||||||
|
given (safe) interpreter\&. The path is fully normalized before testing |
||||||
|
.sp |
||||||
|
against the islands, which themselves are fully normalized\&. |
||||||
|
.sp |
||||||
|
Arguments: |
||||||
|
.RS |
||||||
|
.TP |
||||||
|
string \fIchild\fR |
||||||
|
Identifier of the child interpreter |
||||||
|
.TP |
||||||
|
string \fIfname\fR |
||||||
|
(relative) path to the file to test |
||||||
|
.RE |
||||||
|
.TP |
||||||
|
\fBFile\fR \fIchild\fR \fIcmd\fR \fIargs\fR |
||||||
|
.sp |
||||||
|
Parses the options and arguments to the file command to discover which |
||||||
|
.sp |
||||||
|
paths it tries to access and only return the results of its execution |
||||||
|
.sp |
||||||
|
when these path are within the allowed islands of the filesystem\&. |
||||||
|
.sp |
||||||
|
Arguments: |
||||||
|
.RS |
||||||
|
.TP |
||||||
|
string \fIchild\fR |
||||||
|
Identifier of the child interpreter |
||||||
|
.TP |
||||||
|
string \fIcmd\fR |
||||||
|
Subcommand of the file command |
||||||
|
.TP |
||||||
|
string \fIargs\fR |
||||||
|
Arguments to the file subcommand |
||||||
|
.RE |
||||||
|
.TP |
||||||
|
\fBOpen\fR \fIchild\fR \fIargs\fR |
||||||
|
.sp |
||||||
|
Parses the options and arguments to the open command to discover which |
||||||
|
.sp |
||||||
|
paths it tries to access and only return the results of its execution |
||||||
|
.sp |
||||||
|
when these path are within the allowed islands of the filesystem\&. |
||||||
|
.sp |
||||||
|
Arguments: |
||||||
|
.RS |
||||||
|
.TP |
||||||
|
string \fIchild\fR |
||||||
|
Identifier of the child interpreter |
||||||
|
.TP |
||||||
|
string \fIargs\fR |
||||||
|
Arguments to the open subcommand |
||||||
|
.RE |
||||||
|
.TP |
||||||
|
\fBExpose\fR \fIchild\fR \fIcmd\fR \fIargs\fR |
||||||
|
.sp |
||||||
|
This procedure allows to callback a command that would typically have |
||||||
|
.sp |
||||||
|
been hidden from a child interpreter\&. It does not "interp expose" but |
||||||
|
.sp |
||||||
|
rather calls the hidden command, so we can easily revert back\&. |
||||||
|
.sp |
||||||
|
Arguments: |
||||||
|
.RS |
||||||
|
.TP |
||||||
|
string \fIchild\fR |
||||||
|
Identifier of the child interpreter |
||||||
|
.TP |
||||||
|
string \fIcmd\fR |
||||||
|
Hidden command to call |
||||||
|
.TP |
||||||
|
string \fIargs\fR |
||||||
|
Arguments to the command |
||||||
|
.RE |
||||||
|
.TP |
||||||
|
\fBGlob\fR \fIchild\fR \fIargs\fR |
||||||
|
.sp |
||||||
|
Parses the options and arguments to the glob command to discover which |
||||||
|
.sp |
||||||
|
paths it tries to access and only return the results of its execution |
||||||
|
.sp |
||||||
|
when these path are within the allowed islands of the filesystem\&. |
||||||
|
.sp |
||||||
|
Arguments: |
||||||
|
.RS |
||||||
|
.TP |
||||||
|
string \fIchild\fR |
||||||
|
Identifier of the child interpreter |
||||||
|
.TP |
||||||
|
string \fIargs\fR |
||||||
|
Arguments to the glob command |
||||||
|
.RE |
||||||
|
.TP |
||||||
|
\fBInit\fR \fIchild\fR |
||||||
|
.sp |
||||||
|
Initialise child interpreter so that it will be able to perform some |
||||||
|
.sp |
||||||
|
file operations, but only within some islands of the filesystem\&. |
||||||
|
.sp |
||||||
|
Arguments: |
||||||
|
.RS |
||||||
|
.TP |
||||||
|
string \fIchild\fR |
||||||
|
Identifier of the child interpreter |
||||||
|
.RE |
||||||
|
.PP |
||||||
|
.SH KEYWORDS |
||||||
|
filesystem, interp, module |
||||||
|
.SH COPYRIGHT |
||||||
|
.nf |
||||||
|
Copyright (c) 2024 |
||||||
|
|
||||||
|
.fi |
@ -0,0 +1,318 @@ |
|||||||
|
'\" |
||||||
|
'\" Generated from file '_module_codethread-0\&.1\&.0\&.tm\&.man' by tcllib/doctools with format 'nroff' |
||||||
|
'\" Copyright (c) 2024 |
||||||
|
'\" |
||||||
|
.TH "shellspy_module_punk::repl::codethread" 0 0\&.1\&.0 doc "-" |
||||||
|
.\" 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::repl::codethread \- Module API |
||||||
|
.SH SYNOPSIS |
||||||
|
package require \fBpunk::repl::codethread \fR |
||||||
|
.sp |
||||||
|
.BE |
||||||
|
.SH DESCRIPTION |
||||||
|
.PP |
||||||
|
- |
||||||
|
.SH OVERVIEW |
||||||
|
.PP |
||||||
|
overview of punk::repl::codethread |
||||||
|
.SS CONCEPTS |
||||||
|
.PP |
||||||
|
- |
||||||
|
.SS DEPENDENCIES |
||||||
|
.PP |
||||||
|
packages used by punk::repl::codethread |
||||||
|
.IP \(bu |
||||||
|
\fBTcl 8\&.6\fR |
||||||
|
.PP |
||||||
|
.SH API |
||||||
|
.SS "NAMESPACE PUNK::REPL::CODETHREAD::CLASS" |
||||||
|
.PP |
||||||
|
class definitions |
||||||
|
.PP |
||||||
|
.SS "NAMESPACE PUNK::REPL::CODETHREAD" |
||||||
|
.PP |
||||||
|
Core API functions for punk::repl::codethread |
||||||
|
.PP |
||||||
|
.SS "NAMESPACE PUNK::REPL::CODETHREAD::LIB" |
||||||
|
.PP |
||||||
|
Secondary functions that are part of the API |
||||||
|
.PP |
||||||
|
.SH INTERNAL |
||||||
|
.SS "NAMESPACE PUNK::REPL::CODETHREAD::SYSTEM" |
||||||
|
.PP |
||||||
|
Internal functions that are not part of the API |
||||||
|
.SH KEYWORDS |
||||||
|
module |
||||||
|
.SH COPYRIGHT |
||||||
|
.nf |
||||||
|
Copyright (c) 2024 |
||||||
|
|
||||||
|
.fi |
File diff suppressed because one or more lines are too long
@ -1 +1 @@ |
|||||||
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}}}} |
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/_module_argparsingtest-0.1.0.tm.md shellspy_module_argparsingtest {Module API}} {doc/files/_module_overtype-1.6.3.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/punk/_module_island-0.1.0.tm.md shellspy_module_punk::island {filesystem islands for safe interps}} {doc/files/punk/_module_aliascore-0.1.0.tm.md shellspy_module_punk::aliascore {Module API}} {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/repl/_module_codethread-0.1.0.tm.md shellspy_module_punk::repl::codethread {Module API}} {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
@ -0,0 +1,87 @@ |
|||||||
|
|
||||||
|
[//000000001]: # (shellspy\_module\_argparsingtest \- \-) |
||||||
|
[//000000002]: # (Generated from file '\_module\_argparsingtest\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown') |
||||||
|
[//000000003]: # (Copyright © 2024) |
||||||
|
[//000000004]: # (shellspy\_module\_argparsingtest\(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\_argparsingtest \- 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 argparsingtest::class](#subsection3) |
||||||
|
|
||||||
|
- [Namespace argparsingtest](#subsection4) |
||||||
|
|
||||||
|
- [Namespace argparsingtest::lib](#subsection5) |
||||||
|
|
||||||
|
- [Internal](#section4) |
||||||
|
|
||||||
|
- [Namespace argparsingtest::system](#subsection6) |
||||||
|
|
||||||
|
- [Keywords](#keywords) |
||||||
|
|
||||||
|
- [Copyright](#copyright) |
||||||
|
|
||||||
|
# <a name='synopsis'></a>SYNOPSIS |
||||||
|
|
||||||
|
package require argparsingtest |
||||||
|
|
||||||
|
# <a name='description'></a>DESCRIPTION |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
# <a name='section2'></a>Overview |
||||||
|
|
||||||
|
overview of argparsingtest |
||||||
|
|
||||||
|
## <a name='subsection1'></a>Concepts |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
## <a name='subsection2'></a>dependencies |
||||||
|
|
||||||
|
packages used by argparsingtest |
||||||
|
|
||||||
|
- __Tcl 8\.6__ |
||||||
|
|
||||||
|
# <a name='section3'></a>API |
||||||
|
|
||||||
|
## <a name='subsection3'></a>Namespace argparsingtest::class |
||||||
|
|
||||||
|
class definitions |
||||||
|
|
||||||
|
## <a name='subsection4'></a>Namespace argparsingtest |
||||||
|
|
||||||
|
## <a name='subsection5'></a>Namespace argparsingtest::lib |
||||||
|
|
||||||
|
# <a name='section4'></a>Internal |
||||||
|
|
||||||
|
## <a name='subsection6'></a>Namespace argparsingtest::system |
||||||
|
|
||||||
|
# <a name='keywords'></a>KEYWORDS |
||||||
|
|
||||||
|
[module](\.\./\.\./index\.md\#module) |
||||||
|
|
||||||
|
# <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\.3\.tm\.man' by tcllib/doctools with format 'markdown') |
||||||
|
[//000000003]: # (Copyright © 2024) |
||||||
|
[//000000004]: # (overtype\_module\_overtype\(0\) 1\.6\.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) |
||||||
|
|
||||||
|
- [Namespace overtype](#subsection3) |
||||||
|
|
||||||
|
- [Keywords](#keywords) |
||||||
|
|
||||||
|
- [Copyright](#copyright) |
||||||
|
|
||||||
|
# <a name='synopsis'></a>SYNOPSIS |
||||||
|
|
||||||
|
package require overtype |
||||||
|
|
||||||
|
[__overtype::renderspace__ *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::renderspace__ *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 |
@ -0,0 +1,87 @@ |
|||||||
|
|
||||||
|
[//000000001]: # (shellspy\_module\_punk::aliascore \- \-) |
||||||
|
[//000000002]: # (Generated from file '\_module\_aliascore\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown') |
||||||
|
[//000000003]: # (Copyright © 2024) |
||||||
|
[//000000004]: # (shellspy\_module\_punk::aliascore\(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::aliascore \- 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::aliascore::class](#subsection3) |
||||||
|
|
||||||
|
- [Namespace punk::aliascore](#subsection4) |
||||||
|
|
||||||
|
- [Namespace punk::aliascore::lib](#subsection5) |
||||||
|
|
||||||
|
- [Internal](#section4) |
||||||
|
|
||||||
|
- [Namespace punk::aliascore::system](#subsection6) |
||||||
|
|
||||||
|
- [Keywords](#keywords) |
||||||
|
|
||||||
|
- [Copyright](#copyright) |
||||||
|
|
||||||
|
# <a name='synopsis'></a>SYNOPSIS |
||||||
|
|
||||||
|
package require punk::aliascore |
||||||
|
|
||||||
|
# <a name='description'></a>DESCRIPTION |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
# <a name='section2'></a>Overview |
||||||
|
|
||||||
|
overview of punk::aliascore |
||||||
|
|
||||||
|
## <a name='subsection1'></a>Concepts |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
## <a name='subsection2'></a>dependencies |
||||||
|
|
||||||
|
packages used by punk::aliascore |
||||||
|
|
||||||
|
- __Tcl 8\.6__ |
||||||
|
|
||||||
|
# <a name='section3'></a>API |
||||||
|
|
||||||
|
## <a name='subsection3'></a>Namespace punk::aliascore::class |
||||||
|
|
||||||
|
class definitions |
||||||
|
|
||||||
|
## <a name='subsection4'></a>Namespace punk::aliascore |
||||||
|
|
||||||
|
## <a name='subsection5'></a>Namespace punk::aliascore::lib |
||||||
|
|
||||||
|
# <a name='section4'></a>Internal |
||||||
|
|
||||||
|
## <a name='subsection6'></a>Namespace punk::aliascore::system |
||||||
|
|
||||||
|
# <a name='keywords'></a>KEYWORDS |
||||||
|
|
||||||
|
[module](\.\./\.\./\.\./index\.md\#module) |
||||||
|
|
||||||
|
# <a name='copyright'></a>COPYRIGHT |
||||||
|
|
||||||
|
Copyright © 2024 |
@ -0,0 +1,254 @@ |
|||||||
|
|
||||||
|
[//000000001]: # (shellspy\_module\_punk::island \- punk::island for safe interps) |
||||||
|
[//000000002]: # (Generated from file '\_module\_island\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown') |
||||||
|
[//000000003]: # (Copyright © 2024) |
||||||
|
[//000000004]: # (shellspy\_module\_punk::island\(0\) 0\.1\.0 doc "punk::island for safe interps") |
||||||
|
|
||||||
|
<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::island \- filesystem islands for safe interps |
||||||
|
|
||||||
|
# <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::island::class](#subsection3) |
||||||
|
|
||||||
|
- [Namespace punk::island::interps](#subsection4) |
||||||
|
|
||||||
|
- [Namespace punk::island](#subsection5) |
||||||
|
|
||||||
|
- [Namespace punk::island::lib](#subsection6) |
||||||
|
|
||||||
|
- [Internal](#section4) |
||||||
|
|
||||||
|
- [Namespace punk::island::system](#subsection7) |
||||||
|
|
||||||
|
- [Keywords](#keywords) |
||||||
|
|
||||||
|
- [Copyright](#copyright) |
||||||
|
|
||||||
|
# <a name='synopsis'></a>SYNOPSIS |
||||||
|
|
||||||
|
package require punk::island |
||||||
|
|
||||||
|
[__add__ *child* *path*](#1) |
||||||
|
[__reset__ *child*](#2) |
||||||
|
[__Allowed__ *child* *fname*](#3) |
||||||
|
[__File__ *child* *cmd* *args*](#4) |
||||||
|
[__Open__ *child* *args*](#5) |
||||||
|
[__Expose__ *child* *cmd* *args*](#6) |
||||||
|
[__Glob__ *child* *args*](#7) |
||||||
|
[__Init__ *child*](#8) |
||||||
|
|
||||||
|
# <a name='description'></a>DESCRIPTION |
||||||
|
|
||||||
|
Package to a allow a safe interpreter to access islands of the |
||||||
|
|
||||||
|
filesystem only, i\.e\. restricted directory trees within the |
||||||
|
|
||||||
|
filesystem\. The package brings back file, open and glob to the child interp |
||||||
|
|
||||||
|
interpreter, though in a restricted manner\. |
||||||
|
|
||||||
|
JN Warning: |
||||||
|
|
||||||
|
This mechanism can have interactions with package loading from auto\_path \- needs |
||||||
|
review\. |
||||||
|
|
||||||
|
# <a name='section2'></a>Overview |
||||||
|
|
||||||
|
overview of punk::island |
||||||
|
|
||||||
|
## <a name='subsection1'></a>Concepts |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
## <a name='subsection2'></a>dependencies |
||||||
|
|
||||||
|
packages used by punk::island |
||||||
|
|
||||||
|
- __Tcl 8\.6__ |
||||||
|
|
||||||
|
# <a name='section3'></a>API |
||||||
|
|
||||||
|
## <a name='subsection3'></a>Namespace punk::island::class |
||||||
|
|
||||||
|
class definitions |
||||||
|
|
||||||
|
## <a name='subsection4'></a>Namespace punk::island::interps |
||||||
|
|
||||||
|
## <a name='subsection5'></a>Namespace punk::island |
||||||
|
|
||||||
|
- <a name='1'></a>__add__ *child* *path* |
||||||
|
|
||||||
|
Add a path to the list of paths that are explicitely allowed for access |
||||||
|
|
||||||
|
to a child interpreter\. Access to any path that has not been explicitely |
||||||
|
|
||||||
|
allowed will be denied\. Paths that are added to the list of allowed |
||||||
|
|
||||||
|
islands are always fully normalized\. |
||||||
|
|
||||||
|
Arguments: |
||||||
|
|
||||||
|
* string *child* |
||||||
|
|
||||||
|
Identifier of the child interpreter to control |
||||||
|
|
||||||
|
- <a name='2'></a>__reset__ *child* |
||||||
|
|
||||||
|
Remove all access path allowance and arrange for the interpreter to be |
||||||
|
|
||||||
|
able to return to the regular safe state\. |
||||||
|
|
||||||
|
Arguments: |
||||||
|
|
||||||
|
* string *child* |
||||||
|
|
||||||
|
Identifier of the child interpreter |
||||||
|
|
||||||
|
## <a name='subsection6'></a>Namespace punk::island::lib |
||||||
|
|
||||||
|
Secondary functions that are part of the API |
||||||
|
|
||||||
|
# <a name='section4'></a>Internal |
||||||
|
|
||||||
|
## <a name='subsection7'></a>Namespace punk::island::system |
||||||
|
|
||||||
|
- <a name='3'></a>__Allowed__ *child* *fname* |
||||||
|
|
||||||
|
Check that the file name passed as an argument is within the islands of |
||||||
|
|
||||||
|
the filesystem that have been registered through the add command for a |
||||||
|
|
||||||
|
given \(safe\) interpreter\. The path is fully normalized before testing |
||||||
|
|
||||||
|
against the islands, which themselves are fully normalized\. |
||||||
|
|
||||||
|
Arguments: |
||||||
|
|
||||||
|
* string *child* |
||||||
|
|
||||||
|
Identifier of the child interpreter |
||||||
|
|
||||||
|
* string *fname* |
||||||
|
|
||||||
|
\(relative\) path to the file to test |
||||||
|
|
||||||
|
- <a name='4'></a>__File__ *child* *cmd* *args* |
||||||
|
|
||||||
|
Parses the options and arguments to the file command to discover which |
||||||
|
|
||||||
|
paths it tries to access and only return the results of its execution |
||||||
|
|
||||||
|
when these path are within the allowed islands of the filesystem\. |
||||||
|
|
||||||
|
Arguments: |
||||||
|
|
||||||
|
* string *child* |
||||||
|
|
||||||
|
Identifier of the child interpreter |
||||||
|
|
||||||
|
* string *cmd* |
||||||
|
|
||||||
|
Subcommand of the file command |
||||||
|
|
||||||
|
* string *args* |
||||||
|
|
||||||
|
Arguments to the file subcommand |
||||||
|
|
||||||
|
- <a name='5'></a>__Open__ *child* *args* |
||||||
|
|
||||||
|
Parses the options and arguments to the open command to discover which |
||||||
|
|
||||||
|
paths it tries to access and only return the results of its execution |
||||||
|
|
||||||
|
when these path are within the allowed islands of the filesystem\. |
||||||
|
|
||||||
|
Arguments: |
||||||
|
|
||||||
|
* string *child* |
||||||
|
|
||||||
|
Identifier of the child interpreter |
||||||
|
|
||||||
|
* string *args* |
||||||
|
|
||||||
|
Arguments to the open subcommand |
||||||
|
|
||||||
|
- <a name='6'></a>__Expose__ *child* *cmd* *args* |
||||||
|
|
||||||
|
This procedure allows to callback a command that would typically have |
||||||
|
|
||||||
|
been hidden from a child interpreter\. It does not "interp expose" but |
||||||
|
|
||||||
|
rather calls the hidden command, so we can easily revert back\. |
||||||
|
|
||||||
|
Arguments: |
||||||
|
|
||||||
|
* string *child* |
||||||
|
|
||||||
|
Identifier of the child interpreter |
||||||
|
|
||||||
|
* string *cmd* |
||||||
|
|
||||||
|
Hidden command to call |
||||||
|
|
||||||
|
* string *args* |
||||||
|
|
||||||
|
Arguments to the command |
||||||
|
|
||||||
|
- <a name='7'></a>__Glob__ *child* *args* |
||||||
|
|
||||||
|
Parses the options and arguments to the glob command to discover which |
||||||
|
|
||||||
|
paths it tries to access and only return the results of its execution |
||||||
|
|
||||||
|
when these path are within the allowed islands of the filesystem\. |
||||||
|
|
||||||
|
Arguments: |
||||||
|
|
||||||
|
* string *child* |
||||||
|
|
||||||
|
Identifier of the child interpreter |
||||||
|
|
||||||
|
* string *args* |
||||||
|
|
||||||
|
Arguments to the glob command |
||||||
|
|
||||||
|
- <a name='8'></a>__Init__ *child* |
||||||
|
|
||||||
|
Initialise child interpreter so that it will be able to perform some |
||||||
|
|
||||||
|
file operations, but only within some islands of the filesystem\. |
||||||
|
|
||||||
|
Arguments: |
||||||
|
|
||||||
|
* string *child* |
||||||
|
|
||||||
|
Identifier of the child interpreter |
||||||
|
|
||||||
|
# <a name='keywords'></a>KEYWORDS |
||||||
|
|
||||||
|
[filesystem](\.\./\.\./\.\./index\.md\#filesystem), |
||||||
|
[interp](\.\./\.\./\.\./index\.md\#interp), [module](\.\./\.\./\.\./index\.md\#module) |
||||||
|
|
||||||
|
# <a name='copyright'></a>COPYRIGHT |
||||||
|
|
||||||
|
Copyright © 2024 |
@ -0,0 +1,87 @@ |
|||||||
|
|
||||||
|
[//000000001]: # (shellspy\_module\_punk::repl::codethread \- \-) |
||||||
|
[//000000002]: # (Generated from file '\_module\_codethread\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown') |
||||||
|
[//000000003]: # (Copyright © 2024) |
||||||
|
[//000000004]: # (shellspy\_module\_punk::repl::codethread\(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::repl::codethread \- 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::repl::codethread::class](#subsection3) |
||||||
|
|
||||||
|
- [Namespace punk::repl::codethread](#subsection4) |
||||||
|
|
||||||
|
- [Namespace punk::repl::codethread::lib](#subsection5) |
||||||
|
|
||||||
|
- [Internal](#section4) |
||||||
|
|
||||||
|
- [Namespace punk::repl::codethread::system](#subsection6) |
||||||
|
|
||||||
|
- [Keywords](#keywords) |
||||||
|
|
||||||
|
- [Copyright](#copyright) |
||||||
|
|
||||||
|
# <a name='synopsis'></a>SYNOPSIS |
||||||
|
|
||||||
|
package require punk::repl::codethread |
||||||
|
|
||||||
|
# <a name='description'></a>DESCRIPTION |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
# <a name='section2'></a>Overview |
||||||
|
|
||||||
|
overview of punk::repl::codethread |
||||||
|
|
||||||
|
## <a name='subsection1'></a>Concepts |
||||||
|
|
||||||
|
\- |
||||||
|
|
||||||
|
## <a name='subsection2'></a>dependencies |
||||||
|
|
||||||
|
packages used by punk::repl::codethread |
||||||
|
|
||||||
|
- __Tcl 8\.6__ |
||||||
|
|
||||||
|
# <a name='section3'></a>API |
||||||
|
|
||||||
|
## <a name='subsection3'></a>Namespace punk::repl::codethread::class |
||||||
|
|
||||||
|
class definitions |
||||||
|
|
||||||
|
## <a name='subsection4'></a>Namespace punk::repl::codethread |
||||||
|
|
||||||
|
## <a name='subsection5'></a>Namespace punk::repl::codethread::lib |
||||||
|
|
||||||
|
# <a name='section4'></a>Internal |
||||||
|
|
||||||
|
## <a name='subsection6'></a>Namespace punk::repl::codethread::system |
||||||
|
|
||||||
|
# <a name='keywords'></a>KEYWORDS |
||||||
|
|
||||||
|
[module](\.\./\.\./\.\./\.\./index\.md\#module) |
||||||
|
|
||||||
|
# <a name='copyright'></a>COPYRIGHT |
||||||
|
|
||||||
|
Copyright © 2024 |
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_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}}}} |
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/repl/_module_codethread-0.1.0.tm.html shellspy_module_punk::repl::codethread {Module API}} {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/_module_argparsingtest-0.1.0.tm.html shellspy_module_argparsingtest {Module API}} {doc/files/_module_overtype-1.6.3.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/punk/_module_island-0.1.0.tm.html shellspy_module_punk::island {filesystem islands for safe interps}} {doc/files/punk/_module_aliascore-0.1.0.tm.html shellspy_module_punk::aliascore {Module API}} {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,187 @@ |
|||||||
|
<!DOCTYPE html><html><head> |
||||||
|
<title>shellspy_module_argparsingtest - -</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_argparsingtest-0.1.0.tm.man' by tcllib/doctools with format 'html' |
||||||
|
--> |
||||||
|
<!-- Copyright &copy; 2024 |
||||||
|
--> |
||||||
|
<!-- shellspy_module_argparsingtest.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_argparsingtest(0) 0.1.0 doc "-"</h1> |
||||||
|
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2> |
||||||
|
<p>shellspy_module_argparsingtest - Module API</p> |
||||||
|
</div> |
||||||
|
<div id="toc" class="doctools_section"><h2><a name="toc">Table Of Contents</a></h2> |
||||||
|
<ul class="doctools_toc"> |
||||||
|
<li class="doctools_section"><a href="#toc">Table Of Contents</a></li> |
||||||
|
<li class="doctools_section"><a href="#synopsis">Synopsis</a></li> |
||||||
|
<li class="doctools_section"><a href="#section1">Description</a></li> |
||||||
|
<li class="doctools_section"><a href="#section2">Overview</a> |
||||||
|
<ul> |
||||||
|
<li class="doctools_subsection"><a href="#subsection1">Concepts</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection2">dependencies</a></li> |
||||||
|
</ul> |
||||||
|
</li> |
||||||
|
<li class="doctools_section"><a href="#section3">API</a> |
||||||
|
<ul> |
||||||
|
<li class="doctools_subsection"><a href="#subsection3">Namespace argparsingtest::class</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection4">Namespace argparsingtest</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection5">Namespace argparsingtest::lib</a></li> |
||||||
|
</ul> |
||||||
|
</li> |
||||||
|
<li class="doctools_section"><a href="#section4">Internal</a> |
||||||
|
<ul> |
||||||
|
<li class="doctools_subsection"><a href="#subsection6">Namespace argparsingtest::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">argparsingtest</b></li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2> |
||||||
|
<p>-</p> |
||||||
|
</div> |
||||||
|
<div id="section2" class="doctools_section"><h2><a name="section2">Overview</a></h2> |
||||||
|
<p>overview of argparsingtest</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 argparsingtest</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 argparsingtest::class</a></h3> |
||||||
|
<p>class definitions</p> |
||||||
|
<ol class="doctools_enumerated"> |
||||||
|
</ol> |
||||||
|
</div> |
||||||
|
<div id="subsection4" class="doctools_subsection"><h3><a name="subsection4">Namespace argparsingtest</a></h3> |
||||||
|
<p>Core API functions for argparsingtest</p> |
||||||
|
<dl class="doctools_definitions"> |
||||||
|
</dl> |
||||||
|
</div> |
||||||
|
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Namespace argparsingtest::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 argparsingtest::system</a></h3> |
||||||
|
<p>Internal functions that are not part of the API</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="keywords" class="doctools_section"><h2><a name="keywords">Keywords</a></h2> |
||||||
|
<p><a href="../../index.html#module">module</a></p> |
||||||
|
</div> |
||||||
|
<div id="copyright" class="doctools_section"><h2><a name="copyright">Copyright</a></h2> |
||||||
|
<p>Copyright © 2024</p> |
||||||
|
</div> |
||||||
|
</div></body></html> |
@ -0,0 +1,191 @@ |
|||||||
|
<!DOCTYPE html><html><head> |
||||||
|
<title>overtype_module_overtype - overtype text layout</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_overtype-1.6.3.tm.man' by tcllib/doctools with format 'html' |
||||||
|
--> |
||||||
|
<!-- Copyright &copy; 2024 |
||||||
|
--> |
||||||
|
<!-- overtype_module_overtype.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">overtype_module_overtype(0) 1.6.3 doc "overtype text layout"</h1> |
||||||
|
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2> |
||||||
|
<p>overtype_module_overtype - overtype text layout - ansi aware</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 overtype</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">overtype</b></li> |
||||||
|
</ul> |
||||||
|
<ul class="doctools_syntax"> |
||||||
|
<li><a href="#1"><b class="function">overtype::renderspace</b> <i class="arg">args</i></a></li> |
||||||
|
<li><a href="#2"><b class="function">overtype::renderline</b> <i class="arg">args</i></a></li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2> |
||||||
|
<p>-</p> |
||||||
|
</div> |
||||||
|
<div id="section2" class="doctools_section"><h2><a name="section2">Overview</a></h2> |
||||||
|
<p>overview of overtype</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 overtype</p> |
||||||
|
<ul class="doctools_itemized"> |
||||||
|
<li><p><b class="package">Tcl 8.6</b></p></li> |
||||||
|
<li><p><b class="package">textutil</b></p></li> |
||||||
|
<li><p><b class="package">punk::ansi</b></p> |
||||||
|
<p>- required to detect, split, strip and calculate lengths of text possibly containing ansi codes</p></li> |
||||||
|
<li><p><b class="package">punk::char</b></p> |
||||||
|
<p>- box drawing - and also unicode character width determination for proper layout of text with double-column-width chars</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 overtype</a></h3> |
||||||
|
<p>Core API functions for overtype</p> |
||||||
|
<dl class="doctools_definitions"> |
||||||
|
<dt><a name="1"><b class="function">overtype::renderspace</b> <i class="arg">args</i></a></dt> |
||||||
|
<dd><p>usage: ?-transparent [0|1]? ?-overflow [1|0]? ?-ellipsis [1|0]? ?-ellipsistext ...? undertext overtext</p></dd> |
||||||
|
<dt><a name="2"><b class="function">overtype::renderline</b> <i class="arg">args</i></a></dt> |
||||||
|
<dd><p>renderline is the core engine for overtype string processing (frames & textblocks), and the raw mode commandline repl for the Tcl Punk Shell</p> |
||||||
|
<p>It is also a central part of an ansi (micro) virtual terminal-emulator of sorts</p> |
||||||
|
<p>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</p> |
||||||
|
<p>Renderline helps maintain ANSI text styling reset/replay codes so that the styling of one block doesn't affect another.</p> |
||||||
|
<p>Calling on the punk::ansi library - it can coalesce codes to keep the size down.</p> |
||||||
|
<p>It is a giant mess of doing exactly what common wisdom says not to do... lots at once.</p> |
||||||
|
<p>renderline is part of the Unicode and ANSI aware Overtype system which 'renders' a block of text onto a static underlay</p> |
||||||
|
<p>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.</p> |
||||||
|
<p>The overlay couuld be similar - in which case it may often be used to overwrite a column or section of the underlay.</p> |
||||||
|
<p>The overlay could however be a sequence of ANSI-laden text that jumps all over the place.</p> |
||||||
|
<p>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.</p> |
||||||
|
<p>By suppyling the -info 1 option - it can return various fields indicating the state of the render.</p> |
||||||
|
<p>The main 3 are the result, overflow_right, and unapplied.</p> |
||||||
|
<p>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.</p></dd> |
||||||
|
</dl> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="keywords" class="doctools_section"><h2><a name="keywords">Keywords</a></h2> |
||||||
|
<p><a href="../../index.html#ansi">ansi</a>, <a href="../../index.html#module">module</a>, <a href="../../index.html#text">text</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,187 @@ |
|||||||
|
<!DOCTYPE html><html><head> |
||||||
|
<title>shellspy_module_punk::aliascore - -</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_aliascore-0.1.0.tm.man' by tcllib/doctools with format 'html' |
||||||
|
--> |
||||||
|
<!-- Copyright &copy; 2024 |
||||||
|
--> |
||||||
|
<!-- shellspy_module_punk::aliascore.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::aliascore(0) 0.1.0 doc "-"</h1> |
||||||
|
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2> |
||||||
|
<p>shellspy_module_punk::aliascore - Module API</p> |
||||||
|
</div> |
||||||
|
<div id="toc" class="doctools_section"><h2><a name="toc">Table Of Contents</a></h2> |
||||||
|
<ul class="doctools_toc"> |
||||||
|
<li class="doctools_section"><a href="#toc">Table Of Contents</a></li> |
||||||
|
<li class="doctools_section"><a href="#synopsis">Synopsis</a></li> |
||||||
|
<li class="doctools_section"><a href="#section1">Description</a></li> |
||||||
|
<li class="doctools_section"><a href="#section2">Overview</a> |
||||||
|
<ul> |
||||||
|
<li class="doctools_subsection"><a href="#subsection1">Concepts</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection2">dependencies</a></li> |
||||||
|
</ul> |
||||||
|
</li> |
||||||
|
<li class="doctools_section"><a href="#section3">API</a> |
||||||
|
<ul> |
||||||
|
<li class="doctools_subsection"><a href="#subsection3">Namespace punk::aliascore::class</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection4">Namespace punk::aliascore</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection5">Namespace punk::aliascore::lib</a></li> |
||||||
|
</ul> |
||||||
|
</li> |
||||||
|
<li class="doctools_section"><a href="#section4">Internal</a> |
||||||
|
<ul> |
||||||
|
<li class="doctools_subsection"><a href="#subsection6">Namespace punk::aliascore::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::aliascore</b></li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2> |
||||||
|
<p>-</p> |
||||||
|
</div> |
||||||
|
<div id="section2" class="doctools_section"><h2><a name="section2">Overview</a></h2> |
||||||
|
<p>overview of punk::aliascore</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::aliascore</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::aliascore::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::aliascore</a></h3> |
||||||
|
<p>Core API functions for punk::aliascore</p> |
||||||
|
<dl class="doctools_definitions"> |
||||||
|
</dl> |
||||||
|
</div> |
||||||
|
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Namespace punk::aliascore::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::aliascore::system</a></h3> |
||||||
|
<p>Internal functions that are not part of the API</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="keywords" class="doctools_section"><h2><a name="keywords">Keywords</a></h2> |
||||||
|
<p><a href="../../../index.html#module">module</a></p> |
||||||
|
</div> |
||||||
|
<div id="copyright" class="doctools_section"><h2><a name="copyright">Copyright</a></h2> |
||||||
|
<p>Copyright © 2024</p> |
||||||
|
</div> |
||||||
|
</div></body></html> |
@ -0,0 +1,304 @@ |
|||||||
|
<!DOCTYPE html><html><head> |
||||||
|
<title>shellspy_module_punk::island - punk::island for safe interps</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_island-0.1.0.tm.man' by tcllib/doctools with format 'html' |
||||||
|
--> |
||||||
|
<!-- Copyright &copy; 2024 |
||||||
|
--> |
||||||
|
<!-- shellspy_module_punk::island.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::island(0) 0.1.0 doc "punk::island for safe interps"</h1> |
||||||
|
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2> |
||||||
|
<p>shellspy_module_punk::island - filesystem islands for safe interps</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::island::class</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection4">Namespace punk::island::interps</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection5">Namespace punk::island</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection6">Namespace punk::island::lib</a></li> |
||||||
|
</ul> |
||||||
|
</li> |
||||||
|
<li class="doctools_section"><a href="#section4">Internal</a> |
||||||
|
<ul> |
||||||
|
<li class="doctools_subsection"><a href="#subsection7">Namespace punk::island::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::island</b></li> |
||||||
|
</ul> |
||||||
|
<ul class="doctools_syntax"> |
||||||
|
<li><a href="#1"><b class="function">add</b> <i class="arg">child</i> <i class="arg">path</i></a></li> |
||||||
|
<li><a href="#2"><b class="function">reset</b> <i class="arg">child</i></a></li> |
||||||
|
<li><a href="#3"><b class="function">Allowed</b> <i class="arg">child</i> <i class="arg">fname</i></a></li> |
||||||
|
<li><a href="#4"><b class="function">File</b> <i class="arg">child</i> <i class="arg">cmd</i> <i class="arg">args</i></a></li> |
||||||
|
<li><a href="#5"><b class="function">Open</b> <i class="arg">child</i> <i class="arg">args</i></a></li> |
||||||
|
<li><a href="#6"><b class="function">Expose</b> <i class="arg">child</i> <i class="arg">cmd</i> <i class="arg">args</i></a></li> |
||||||
|
<li><a href="#7"><b class="function">Glob</b> <i class="arg">child</i> <i class="arg">args</i></a></li> |
||||||
|
<li><a href="#8"><b class="function">Init</b> <i class="arg">child</i></a></li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2> |
||||||
|
<p>Package to a allow a safe interpreter to access islands of the</p> |
||||||
|
<p>filesystem only, i.e. restricted directory trees within the</p> |
||||||
|
<p>filesystem. The package brings back file, open and glob to the child interp</p> |
||||||
|
<p>interpreter, though in a restricted manner.</p> |
||||||
|
<p>JN Warning:</p> |
||||||
|
<p>This mechanism can have interactions with package loading from auto_path - needs review.</p> |
||||||
|
</div> |
||||||
|
<div id="section2" class="doctools_section"><h2><a name="section2">Overview</a></h2> |
||||||
|
<p>overview of punk::island</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::island</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::island::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::island::interps</a></h3> |
||||||
|
<p>hosts information for interpreters</p> |
||||||
|
<dl class="doctools_definitions"> |
||||||
|
</dl> |
||||||
|
</div> |
||||||
|
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Namespace punk::island</a></h3> |
||||||
|
<p>Core API functions for punk::island</p> |
||||||
|
<dl class="doctools_definitions"> |
||||||
|
<dt><a name="1"><b class="function">add</b> <i class="arg">child</i> <i class="arg">path</i></a></dt> |
||||||
|
<dd><p>Add a path to the list of paths that are explicitely allowed for access</p> |
||||||
|
<p>to a child interpreter. Access to any path that has not been explicitely</p> |
||||||
|
<p>allowed will be denied. Paths that are added to the list of allowed</p> |
||||||
|
<p>islands are always fully normalized.</p> |
||||||
|
<p>Arguments:</p> |
||||||
|
<dl class="doctools_arguments"> |
||||||
|
|
||||||
|
<dt>string <i class="arg">child</i></dt> |
||||||
|
<dd><p>Identifier of the child interpreter to control</p></dd> |
||||||
|
</dl></dd> |
||||||
|
<dt><a name="2"><b class="function">reset</b> <i class="arg">child</i></a></dt> |
||||||
|
<dd><p>Remove all access path allowance and arrange for the interpreter to be</p> |
||||||
|
<p>able to return to the regular safe state.</p> |
||||||
|
<p>Arguments:</p> |
||||||
|
<dl class="doctools_arguments"> |
||||||
|
|
||||||
|
<dt>string <i class="arg">child</i></dt> |
||||||
|
<dd><p>Identifier of the child interpreter</p></dd> |
||||||
|
</dl></dd> |
||||||
|
</dl> |
||||||
|
</div> |
||||||
|
<div id="subsection6" class="doctools_subsection"><h3><a name="subsection6">Namespace punk::island::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="subsection7" class="doctools_subsection"><h3><a name="subsection7">Namespace punk::island::system</a></h3> |
||||||
|
<p>Internal functions that are not part of the API</p> |
||||||
|
<dl class="doctools_definitions"> |
||||||
|
<dt><a name="3"><b class="function">Allowed</b> <i class="arg">child</i> <i class="arg">fname</i></a></dt> |
||||||
|
<dd><p>Check that the file name passed as an argument is within the islands of</p> |
||||||
|
<p>the filesystem that have been registered through the add command for a</p> |
||||||
|
<p>given (safe) interpreter. The path is fully normalized before testing</p> |
||||||
|
<p>against the islands, which themselves are fully normalized.</p> |
||||||
|
<p>Arguments:</p> |
||||||
|
<dl class="doctools_arguments"> |
||||||
|
|
||||||
|
<dt>string <i class="arg">child</i></dt> |
||||||
|
<dd><p>Identifier of the child interpreter</p></dd> |
||||||
|
<dt>string <i class="arg">fname</i></dt> |
||||||
|
<dd><p>(relative) path to the file to test</p></dd> |
||||||
|
</dl></dd> |
||||||
|
<dt><a name="4"><b class="function">File</b> <i class="arg">child</i> <i class="arg">cmd</i> <i class="arg">args</i></a></dt> |
||||||
|
<dd><p>Parses the options and arguments to the file command to discover which</p> |
||||||
|
<p>paths it tries to access and only return the results of its execution</p> |
||||||
|
<p>when these path are within the allowed islands of the filesystem.</p> |
||||||
|
<p>Arguments:</p> |
||||||
|
<dl class="doctools_arguments"> |
||||||
|
|
||||||
|
<dt>string <i class="arg">child</i></dt> |
||||||
|
<dd><p>Identifier of the child interpreter</p></dd> |
||||||
|
<dt>string <i class="arg">cmd</i></dt> |
||||||
|
<dd><p>Subcommand of the file command</p></dd> |
||||||
|
<dt>string <i class="arg">args</i></dt> |
||||||
|
<dd><p>Arguments to the file subcommand</p></dd> |
||||||
|
</dl></dd> |
||||||
|
<dt><a name="5"><b class="function">Open</b> <i class="arg">child</i> <i class="arg">args</i></a></dt> |
||||||
|
<dd><p>Parses the options and arguments to the open command to discover which</p> |
||||||
|
<p>paths it tries to access and only return the results of its execution</p> |
||||||
|
<p>when these path are within the allowed islands of the filesystem.</p> |
||||||
|
<p>Arguments:</p> |
||||||
|
<dl class="doctools_arguments"> |
||||||
|
|
||||||
|
<dt>string <i class="arg">child</i></dt> |
||||||
|
<dd><p>Identifier of the child interpreter</p></dd> |
||||||
|
<dt>string <i class="arg">args</i></dt> |
||||||
|
<dd><p>Arguments to the open subcommand</p></dd> |
||||||
|
</dl></dd> |
||||||
|
<dt><a name="6"><b class="function">Expose</b> <i class="arg">child</i> <i class="arg">cmd</i> <i class="arg">args</i></a></dt> |
||||||
|
<dd><p>This procedure allows to callback a command that would typically have</p> |
||||||
|
<p>been hidden from a child interpreter. It does not "interp expose" but</p> |
||||||
|
<p>rather calls the hidden command, so we can easily revert back.</p> |
||||||
|
<p>Arguments:</p> |
||||||
|
<dl class="doctools_arguments"> |
||||||
|
|
||||||
|
<dt>string <i class="arg">child</i></dt> |
||||||
|
<dd><p>Identifier of the child interpreter</p></dd> |
||||||
|
<dt>string <i class="arg">cmd</i></dt> |
||||||
|
<dd><p>Hidden command to call</p></dd> |
||||||
|
<dt>string <i class="arg">args</i></dt> |
||||||
|
<dd><p>Arguments to the command</p></dd> |
||||||
|
</dl></dd> |
||||||
|
<dt><a name="7"><b class="function">Glob</b> <i class="arg">child</i> <i class="arg">args</i></a></dt> |
||||||
|
<dd><p>Parses the options and arguments to the glob command to discover which</p> |
||||||
|
<p>paths it tries to access and only return the results of its execution</p> |
||||||
|
<p>when these path are within the allowed islands of the filesystem.</p> |
||||||
|
<p>Arguments:</p> |
||||||
|
<dl class="doctools_arguments"> |
||||||
|
|
||||||
|
<dt>string <i class="arg">child</i></dt> |
||||||
|
<dd><p>Identifier of the child interpreter</p></dd> |
||||||
|
<dt>string <i class="arg">args</i></dt> |
||||||
|
<dd><p>Arguments to the glob command</p></dd> |
||||||
|
</dl></dd> |
||||||
|
<dt><a name="8"><b class="function">Init</b> <i class="arg">child</i></a></dt> |
||||||
|
<dd><p>Initialise child interpreter so that it will be able to perform some</p> |
||||||
|
<p>file operations, but only within some islands of the filesystem.</p> |
||||||
|
<p>Arguments:</p> |
||||||
|
<dl class="doctools_arguments"> |
||||||
|
|
||||||
|
<dt>string <i class="arg">child</i></dt> |
||||||
|
<dd><p>Identifier of the child interpreter</p></dd> |
||||||
|
</dl></dd> |
||||||
|
</dl> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="keywords" class="doctools_section"><h2><a name="keywords">Keywords</a></h2> |
||||||
|
<p><a href="../../../index.html#filesystem">filesystem</a>, <a href="../../../index.html#interp">interp</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,187 @@ |
|||||||
|
<!DOCTYPE html><html><head> |
||||||
|
<title>shellspy_module_punk::repl::codethread - -</title> |
||||||
|
<style type="text/css"><!-- |
||||||
|
HTML { |
||||||
|
background: #FFFFFF; |
||||||
|
color: black; |
||||||
|
} |
||||||
|
BODY { |
||||||
|
background: #FFFFFF; |
||||||
|
color: black; |
||||||
|
} |
||||||
|
DIV.doctools { |
||||||
|
margin-left: 10%; |
||||||
|
margin-right: 10%; |
||||||
|
} |
||||||
|
DIV.doctools H1,DIV.doctools H2 { |
||||||
|
margin-left: -5%; |
||||||
|
} |
||||||
|
H1, H2, H3, H4 { |
||||||
|
margin-top: 1em; |
||||||
|
font-family: sans-serif; |
||||||
|
font-size: large; |
||||||
|
color: #005A9C; |
||||||
|
background: transparent; |
||||||
|
text-align: left; |
||||||
|
} |
||||||
|
H1.doctools_title { |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
UL,OL { |
||||||
|
margin-right: 0em; |
||||||
|
margin-top: 3pt; |
||||||
|
margin-bottom: 3pt; |
||||||
|
} |
||||||
|
UL LI { |
||||||
|
list-style: disc; |
||||||
|
} |
||||||
|
OL LI { |
||||||
|
list-style: decimal; |
||||||
|
} |
||||||
|
DT { |
||||||
|
padding-top: 1ex; |
||||||
|
} |
||||||
|
UL.doctools_toc,UL.doctools_toc UL, UL.doctools_toc UL UL { |
||||||
|
font: normal 12pt/14pt sans-serif; |
||||||
|
list-style: none; |
||||||
|
} |
||||||
|
LI.doctools_section, LI.doctools_subsection { |
||||||
|
list-style: none; |
||||||
|
margin-left: 0em; |
||||||
|
text-indent: 0em; |
||||||
|
padding: 0em; |
||||||
|
} |
||||||
|
PRE { |
||||||
|
display: block; |
||||||
|
font-family: monospace; |
||||||
|
white-space: pre; |
||||||
|
margin: 0%; |
||||||
|
padding-top: 0.5ex; |
||||||
|
padding-bottom: 0.5ex; |
||||||
|
padding-left: 1ex; |
||||||
|
padding-right: 1ex; |
||||||
|
width: 100%; |
||||||
|
} |
||||||
|
PRE.doctools_example { |
||||||
|
color: black; |
||||||
|
background: #f5dcb3; |
||||||
|
border: 1px solid black; |
||||||
|
} |
||||||
|
UL.doctools_requirements LI, UL.doctools_syntax LI { |
||||||
|
list-style: none; |
||||||
|
margin-left: 0em; |
||||||
|
text-indent: 0em; |
||||||
|
padding: 0em; |
||||||
|
} |
||||||
|
DIV.doctools_synopsis { |
||||||
|
color: black; |
||||||
|
background: #80ffff; |
||||||
|
border: 1px solid black; |
||||||
|
font-family: serif; |
||||||
|
margin-top: 1em; |
||||||
|
margin-bottom: 1em; |
||||||
|
} |
||||||
|
UL.doctools_syntax { |
||||||
|
margin-top: 1em; |
||||||
|
border-top: 1px solid black; |
||||||
|
} |
||||||
|
UL.doctools_requirements { |
||||||
|
margin-bottom: 1em; |
||||||
|
border-bottom: 1px solid black; |
||||||
|
} |
||||||
|
--></style> |
||||||
|
</head> |
||||||
|
<!-- Generated from file '_module_codethread-0.1.0.tm.man' by tcllib/doctools with format 'html' |
||||||
|
--> |
||||||
|
<!-- Copyright &copy; 2024 |
||||||
|
--> |
||||||
|
<!-- shellspy_module_punk::repl::codethread.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::repl::codethread(0) 0.1.0 doc "-"</h1> |
||||||
|
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2> |
||||||
|
<p>shellspy_module_punk::repl::codethread - Module API</p> |
||||||
|
</div> |
||||||
|
<div id="toc" class="doctools_section"><h2><a name="toc">Table Of Contents</a></h2> |
||||||
|
<ul class="doctools_toc"> |
||||||
|
<li class="doctools_section"><a href="#toc">Table Of Contents</a></li> |
||||||
|
<li class="doctools_section"><a href="#synopsis">Synopsis</a></li> |
||||||
|
<li class="doctools_section"><a href="#section1">Description</a></li> |
||||||
|
<li class="doctools_section"><a href="#section2">Overview</a> |
||||||
|
<ul> |
||||||
|
<li class="doctools_subsection"><a href="#subsection1">Concepts</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection2">dependencies</a></li> |
||||||
|
</ul> |
||||||
|
</li> |
||||||
|
<li class="doctools_section"><a href="#section3">API</a> |
||||||
|
<ul> |
||||||
|
<li class="doctools_subsection"><a href="#subsection3">Namespace punk::repl::codethread::class</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection4">Namespace punk::repl::codethread</a></li> |
||||||
|
<li class="doctools_subsection"><a href="#subsection5">Namespace punk::repl::codethread::lib</a></li> |
||||||
|
</ul> |
||||||
|
</li> |
||||||
|
<li class="doctools_section"><a href="#section4">Internal</a> |
||||||
|
<ul> |
||||||
|
<li class="doctools_subsection"><a href="#subsection6">Namespace punk::repl::codethread::system</a></li> |
||||||
|
</ul> |
||||||
|
</li> |
||||||
|
<li class="doctools_section"><a href="#keywords">Keywords</a></li> |
||||||
|
<li class="doctools_section"><a href="#copyright">Copyright</a></li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
<div id="synopsis" class="doctools_section"><h2><a name="synopsis">Synopsis</a></h2> |
||||||
|
<div class="doctools_synopsis"> |
||||||
|
<ul class="doctools_requirements"> |
||||||
|
<li>package require <b class="pkgname">punk::repl::codethread</b></li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2> |
||||||
|
<p>-</p> |
||||||
|
</div> |
||||||
|
<div id="section2" class="doctools_section"><h2><a name="section2">Overview</a></h2> |
||||||
|
<p>overview of punk::repl::codethread</p> |
||||||
|
<div id="subsection1" class="doctools_subsection"><h3><a name="subsection1">Concepts</a></h3> |
||||||
|
<p>-</p> |
||||||
|
</div> |
||||||
|
<div id="subsection2" class="doctools_subsection"><h3><a name="subsection2">dependencies</a></h3> |
||||||
|
<p>packages used by punk::repl::codethread</p> |
||||||
|
<ul class="doctools_itemized"> |
||||||
|
<li><p><b class="package">Tcl 8.6</b></p></li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="section3" class="doctools_section"><h2><a name="section3">API</a></h2> |
||||||
|
<div id="subsection3" class="doctools_subsection"><h3><a name="subsection3">Namespace punk::repl::codethread::class</a></h3> |
||||||
|
<p>class definitions</p> |
||||||
|
<ol class="doctools_enumerated"> |
||||||
|
</ol> |
||||||
|
</div> |
||||||
|
<div id="subsection4" class="doctools_subsection"><h3><a name="subsection4">Namespace punk::repl::codethread</a></h3> |
||||||
|
<p>Core API functions for punk::repl::codethread</p> |
||||||
|
<dl class="doctools_definitions"> |
||||||
|
</dl> |
||||||
|
</div> |
||||||
|
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Namespace punk::repl::codethread::lib</a></h3> |
||||||
|
<p>Secondary functions that are part of the API</p> |
||||||
|
<dl class="doctools_definitions"> |
||||||
|
</dl> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="section4" class="doctools_section"><h2><a name="section4">Internal</a></h2> |
||||||
|
<div id="subsection6" class="doctools_subsection"><h3><a name="subsection6">Namespace punk::repl::codethread::system</a></h3> |
||||||
|
<p>Internal functions that are not part of the API</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="keywords" class="doctools_section"><h2><a name="keywords">Keywords</a></h2> |
||||||
|
<p><a href="../../../../index.html#module">module</a></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,468 @@ |
|||||||
|
# -*- tcl -*- |
||||||
|
# Maintenance Instruction: leave the 999999.xxx.x as is and use punkshell 'pmix make' or bin/punkmake to update from <pkg>-buildversion.txt |
||||||
|
# module template: shellspy/src/decktemplates/vendor/punk/modules/template_module-0.0.2.tm |
||||||
|
# |
||||||
|
# Please consider using a BSD or MIT style license for greatest compatibility with the Tcl ecosystem. |
||||||
|
# Code using preferred Tcl licenses can be eligible for inclusion in Tcllib, Tklib and the punk package repository. |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# (C) 2024 |
||||||
|
# |
||||||
|
# @@ Meta Begin |
||||||
|
# Application argparsingtest 999999.0a1.0 |
||||||
|
# Meta platform tcl |
||||||
|
# Meta license <unspecified> |
||||||
|
# @@ Meta End |
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# doctools header |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
#*** !doctools |
||||||
|
#[manpage_begin shellspy_module_argparsingtest 0 999999.0a1.0] |
||||||
|
#[copyright "2024"] |
||||||
|
#[titledesc {Module API}] [comment {-- Name section and table of contents description --}] |
||||||
|
#[moddesc {-}] [comment {-- Description at end of page heading --}] |
||||||
|
#[require argparsingtest] |
||||||
|
#[keywords module] |
||||||
|
#[description] |
||||||
|
#[para] - |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[section Overview] |
||||||
|
#[para] overview of argparsingtest |
||||||
|
#[subsection Concepts] |
||||||
|
#[para] - |
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
## Requirements |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[subsection dependencies] |
||||||
|
#[para] packages used by argparsingtest |
||||||
|
#[list_begin itemized] |
||||||
|
|
||||||
|
package require Tcl 8.6- |
||||||
|
#*** !doctools |
||||||
|
#[item] [package {Tcl 8.6}] |
||||||
|
|
||||||
|
# #package require frobz |
||||||
|
# #*** !doctools |
||||||
|
# #[item] [package {frobz}] |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[section API] |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# oo::class namespace |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
namespace eval argparsingtest::class { |
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace argparsingtest::class}] |
||||||
|
#[para] class definitions |
||||||
|
if {[info commands [namespace current]::interface_sample1] eq ""} { |
||||||
|
#*** !doctools |
||||||
|
#[list_begin enumerated] |
||||||
|
|
||||||
|
# oo::class create interface_sample1 { |
||||||
|
# #*** !doctools |
||||||
|
# #[enum] CLASS [class interface_sample1] |
||||||
|
# #[list_begin definitions] |
||||||
|
|
||||||
|
# method test {arg1} { |
||||||
|
# #*** !doctools |
||||||
|
# #[call class::interface_sample1 [method test] [arg arg1]] |
||||||
|
# #[para] test method |
||||||
|
# puts "test: $arg1" |
||||||
|
# } |
||||||
|
|
||||||
|
# #*** !doctools |
||||||
|
# #[list_end] [comment {-- end definitions interface_sample1}] |
||||||
|
# } |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] [comment {--- end class enumeration ---}] |
||||||
|
} |
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# Base namespace |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
namespace eval argparsingtest { |
||||||
|
namespace export {[a-z]*} ;# Convention: export all lowercase |
||||||
|
#variable xyz |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace argparsingtest}] |
||||||
|
#[para] Core API functions for argparsingtest |
||||||
|
#[list_begin definitions] |
||||||
|
|
||||||
|
proc test1_switchmerge {args} { |
||||||
|
set defaults [dict create\ |
||||||
|
-return string\ |
||||||
|
-frametype \uFFEF\ |
||||||
|
-show_edge \uFFEF\ |
||||||
|
-show_seps \uFFEF\ |
||||||
|
-x a\ |
||||||
|
-y b\ |
||||||
|
-z c\ |
||||||
|
-1 1\ |
||||||
|
-2 2\ |
||||||
|
-3 3\ |
||||||
|
] |
||||||
|
foreach {k v} $args { |
||||||
|
switch -- $k { |
||||||
|
-return - -show_edge - -show_seps - -frametype - -x - -y - -z - -1 - -2 - -3 {} |
||||||
|
default { |
||||||
|
error "unrecognised option '$k'. Known options [dict keys $defaults]" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
set opts [dict merge $defaults $args] |
||||||
|
} |
||||||
|
#if we need to loop to test arg validity anyway - then dict set as we go is slightly faster than a dict merge at the end |
||||||
|
proc test1_switch {args} { |
||||||
|
set opts [dict create\ |
||||||
|
-return string\ |
||||||
|
-frametype \uFFEF\ |
||||||
|
-show_edge \uFFEF\ |
||||||
|
-show_seps \uFFEF\ |
||||||
|
-x a\ |
||||||
|
-y b\ |
||||||
|
-z c\ |
||||||
|
-1 1\ |
||||||
|
-2 2\ |
||||||
|
-3 3\ |
||||||
|
] |
||||||
|
foreach {k v} $args { |
||||||
|
switch -- $k { |
||||||
|
-return - -show_edge - -show_seps - -frametype - -x - -y - -z - -1 - -2 - -3 { |
||||||
|
dict set opts $k $v |
||||||
|
} |
||||||
|
default { |
||||||
|
error "unrecognised option '$k'. Known options [dict keys $opts]" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
return $opts |
||||||
|
} |
||||||
|
proc test1_switch2 {args} { |
||||||
|
set opts [dict create\ |
||||||
|
-return string\ |
||||||
|
-frametype \uFFEF\ |
||||||
|
-show_edge \uFFEF\ |
||||||
|
-show_seps \uFFEF\ |
||||||
|
-x a\ |
||||||
|
-y b\ |
||||||
|
-z c\ |
||||||
|
-1 1\ |
||||||
|
-2 2\ |
||||||
|
-3 3\ |
||||||
|
] |
||||||
|
set switches [lmap v [dict keys $opts] {list $v -}] |
||||||
|
set switches [concat {*}$switches] |
||||||
|
set switches [lrange $switches 0 end-1] |
||||||
|
foreach {k v} $args { |
||||||
|
switch -- $k\ |
||||||
|
{*}$switches { |
||||||
|
dict set opts $k $v |
||||||
|
}\ |
||||||
|
default { |
||||||
|
error "unrecognised option '$k'. Known options [dict keys $opts]" |
||||||
|
} |
||||||
|
} |
||||||
|
return $opts |
||||||
|
} |
||||||
|
proc test1_prefix {args} { |
||||||
|
set opts [dict create\ |
||||||
|
-return string\ |
||||||
|
-frametype \uFFEF\ |
||||||
|
-show_edge \uFFEF\ |
||||||
|
-show_seps \uFFEF\ |
||||||
|
-x a\ |
||||||
|
-y b\ |
||||||
|
-z c\ |
||||||
|
-1 1\ |
||||||
|
-2 2\ |
||||||
|
-3 3\ |
||||||
|
] |
||||||
|
foreach {k v} $args { |
||||||
|
dict set opts [tcl::prefix::match -message "test1_prefix option $k" {-return -frametype -show_edge -show_seps -x -y -z -1 -2 -3} $k] $v |
||||||
|
} |
||||||
|
return $opts |
||||||
|
} |
||||||
|
proc test1_prefix2 {args} { |
||||||
|
set opts [dict create\ |
||||||
|
-return string\ |
||||||
|
-frametype \uFFEF\ |
||||||
|
-show_edge \uFFEF\ |
||||||
|
-show_seps \uFFEF\ |
||||||
|
-x a\ |
||||||
|
-y b\ |
||||||
|
-z c\ |
||||||
|
-1 1\ |
||||||
|
-2 2\ |
||||||
|
-3 3\ |
||||||
|
] |
||||||
|
if {[llength $args]} { |
||||||
|
set knownflags [dict keys $opts] |
||||||
|
} |
||||||
|
foreach {k v} $args { |
||||||
|
dict set opts [tcl::prefix::match -message "test1_prefix2 option $k" $knownflags $k] $v |
||||||
|
} |
||||||
|
return $opts |
||||||
|
} |
||||||
|
|
||||||
|
#punk::args is slower than argp - but comparable, and argp doesn't support solo flags |
||||||
|
proc test1_punkargs {args} { |
||||||
|
set argd [punk::args::get_dict { |
||||||
|
*proc -name argtest4 -description "test of punk::args::get_dict comparative performance" |
||||||
|
*opts -anyopts 0 |
||||||
|
-return -default string -type string |
||||||
|
-frametype -default \uFFEF -type string |
||||||
|
-show_edge -default \uFFEF -type string |
||||||
|
-show_seps -default \uFFEF -type string |
||||||
|
-join -type none -multiple 1 |
||||||
|
-x -default a -type string |
||||||
|
-y -default b -type string |
||||||
|
-z -default c -type string |
||||||
|
-1 -default 1 -type boolean |
||||||
|
-2 -default 2 -type integer |
||||||
|
-3 -default 3 -type integer |
||||||
|
*values |
||||||
|
} $args] |
||||||
|
return [dict get $argd opts] |
||||||
|
} |
||||||
|
proc test1_punkargs_validate_without_ansi {args} { |
||||||
|
set argd [punk::args::get_dict { |
||||||
|
*proc -name argtest4 -description "test of punk::args::get_dict comparative performance" |
||||||
|
*opts -anyopts 0 |
||||||
|
-return -default string -type string |
||||||
|
-frametype -default \uFFEF -type string |
||||||
|
-show_edge -default \uFFEF -type string |
||||||
|
-show_seps -default \uFFEF -type string |
||||||
|
-join -type none -multiple 1 |
||||||
|
-x -default a -type string |
||||||
|
-y -default b -type string |
||||||
|
-z -default c -type string |
||||||
|
-1 -default 1 -type boolean -validate_without_ansi true |
||||||
|
-2 -default 2 -type integer -validate_without_ansi true |
||||||
|
-3 -default 3 -type integer -validate_without_ansi true |
||||||
|
*values |
||||||
|
} $args] |
||||||
|
return [dict get $argd opts] |
||||||
|
} |
||||||
|
|
||||||
|
package require opt |
||||||
|
variable optlist |
||||||
|
tcl::OptProc test1_opt { |
||||||
|
{-return string "return type"} |
||||||
|
{-frametype \uFFEF "type of frame"} |
||||||
|
{-show_edge \uFFEF "show table outer borders"} |
||||||
|
{-show_seps \uFFEF "show separators"} |
||||||
|
{-join "solo option"} |
||||||
|
{-x a "x val"} |
||||||
|
{-y b "y val"} |
||||||
|
{-z c "z val"} |
||||||
|
{-1 1 "1val"} |
||||||
|
{-2 -int 2 "2val"} |
||||||
|
{-3 -int 3 "3val"} |
||||||
|
} { |
||||||
|
set opts [dict create] |
||||||
|
foreach v [info locals] { |
||||||
|
dict set opts $v [set $v] |
||||||
|
} |
||||||
|
return $opts |
||||||
|
} |
||||||
|
|
||||||
|
package require cmdline |
||||||
|
#cmdline::getoptions is much faster than typedGetoptions |
||||||
|
proc test1_cmdline_untyped {args} { |
||||||
|
set cmdlineopts_untyped { |
||||||
|
{return.arg "string" "return val"} |
||||||
|
{frametype.arg \uFFEF "frame type"} |
||||||
|
{show_edge.arg \uFFEF "show table borders"} |
||||||
|
{show_seps.arg \uFFEF "show table seps"} |
||||||
|
{join "join the things"} |
||||||
|
{x.arg a "arg x"} |
||||||
|
{y.arg b "arg y"} |
||||||
|
{z.arg c "arg z"} |
||||||
|
{1.arg 1 "arg 1"} |
||||||
|
{2.arg 2 "arg 2"} |
||||||
|
{3.arg 3 "arg 3"} |
||||||
|
} |
||||||
|
|
||||||
|
set usage "usage etc" |
||||||
|
return [::cmdline::getoptions args $cmdlineopts_untyped $usage] |
||||||
|
} |
||||||
|
proc test1_cmdline_typed {args} { |
||||||
|
set cmdlineopts_typed { |
||||||
|
{return.arg "string" "return val"} |
||||||
|
{frametype.arg \uFFEF "frame type"} |
||||||
|
{show_edge.arg \uFFEF "show table borders"} |
||||||
|
{show_seps.arg \uFFEF "show table seps"} |
||||||
|
{join "join the things"} |
||||||
|
{x.arg a "arg x"} |
||||||
|
{y.arg b "arg y"} |
||||||
|
{z.arg c "arg z"} |
||||||
|
{1.boolean 1 "arg 1"} |
||||||
|
{2.integer 2 "arg 2"} |
||||||
|
{3.integer 3 "arg 3"} |
||||||
|
} |
||||||
|
|
||||||
|
set usage "usage etc" |
||||||
|
return [::cmdline::typedGetoptions args $cmdlineopts_typed $usage] |
||||||
|
} |
||||||
|
|
||||||
|
catch { |
||||||
|
package require argp |
||||||
|
argp::registerArgs test1_argp { |
||||||
|
{ -return string "string" } |
||||||
|
{ -frametype string \uFFEF } |
||||||
|
{ -show_edge string \uFFEF } |
||||||
|
{ -show_seps string \uFFEF } |
||||||
|
{ -x string a } |
||||||
|
{ -y string b } |
||||||
|
{ -z string c } |
||||||
|
{ -1 boolean 1 } |
||||||
|
{ -2 integer 2 } |
||||||
|
{ -3 integer 3 } |
||||||
|
} |
||||||
|
} |
||||||
|
proc test1_argp {args} { |
||||||
|
argp::parseArgs opts |
||||||
|
return [array get opts] |
||||||
|
} |
||||||
|
|
||||||
|
package require tepam |
||||||
|
tepam::procedure {test1_tepam} { |
||||||
|
-args { |
||||||
|
{-return -type string -default string} |
||||||
|
{-frametype -type string -default \uFFEF} |
||||||
|
{-show_edge -type string -default \uFFEF} |
||||||
|
{-show_seps -type string -default \uFFEF} |
||||||
|
{-join -type none -multiple} |
||||||
|
{-x -type string -default a} |
||||||
|
{-y -type string -default b} |
||||||
|
{-z -type string -default c} |
||||||
|
{-1 -type boolean -default 1} |
||||||
|
{-2 -type integer -default 2} |
||||||
|
{-3 -type integer -default 3} |
||||||
|
} |
||||||
|
} { |
||||||
|
return [dict create return $return frametype $frametype show_edge $show_edge show_seps $show_seps x $x y $y z $z 1 $1 2 $2 3 $3 join $join] |
||||||
|
} |
||||||
|
|
||||||
|
#multiline values use first line of each record to determine amount of indent to trim |
||||||
|
proc test_multiline {args} { |
||||||
|
set t3 [textblock::frame t3] |
||||||
|
set argd [punk::args::get_dict [subst { |
||||||
|
-template1 -default { |
||||||
|
****** |
||||||
|
* t1 * |
||||||
|
****** |
||||||
|
} |
||||||
|
-template2 -default { ------ |
||||||
|
****** |
||||||
|
* t2 * |
||||||
|
******} |
||||||
|
-template3 -default {$t3} |
||||||
|
#substituted or literal values with newlines - no autoindent applied - caller will have to pad appropriately |
||||||
|
-template3b -default { |
||||||
|
$t3 |
||||||
|
----------------- |
||||||
|
$t3 |
||||||
|
abc\ndef |
||||||
|
} |
||||||
|
-template4 -default "****** |
||||||
|
* t4 * |
||||||
|
******" |
||||||
|
-template5 -default " |
||||||
|
|
||||||
|
|
||||||
|
" |
||||||
|
-flag -default 0 -type boolean |
||||||
|
}] $args] |
||||||
|
return $argd |
||||||
|
} |
||||||
|
|
||||||
|
#proc sample1 {p1 n args} { |
||||||
|
# #*** !doctools |
||||||
|
# #[call [fun sample1] [arg p1] [arg n] [opt {option value...}]] |
||||||
|
# #[para]Description of sample1 |
||||||
|
# #[para] Arguments: |
||||||
|
# # [list_begin arguments] |
||||||
|
# # [arg_def tring p1] A description of string argument p1. |
||||||
|
# # [arg_def integer n] A description of integer argument n. |
||||||
|
# # [list_end] |
||||||
|
# return "ok" |
||||||
|
#} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] [comment {--- end definitions namespace argparsingtest ---}] |
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# Secondary API namespace |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
namespace eval argparsingtest::lib { |
||||||
|
namespace export {[a-z]*} ;# Convention: export all lowercase |
||||||
|
namespace path [namespace parent] |
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace argparsingtest::lib}] |
||||||
|
#[para] Secondary functions that are part of the API |
||||||
|
#[list_begin definitions] |
||||||
|
|
||||||
|
#proc utility1 {p1 args} { |
||||||
|
# #*** !doctools |
||||||
|
# #[call lib::[fun utility1] [arg p1] [opt {?option value...?}]] |
||||||
|
# #[para]Description of utility1 |
||||||
|
# return 1 |
||||||
|
#} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] [comment {--- end definitions namespace argparsingtest::lib ---}] |
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
#*** !doctools |
||||||
|
#[section Internal] |
||||||
|
namespace eval argparsingtest::system { |
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace argparsingtest::system}] |
||||||
|
#[para] Internal functions that are not part of the API |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
## Ready |
||||||
|
package provide argparsingtest [namespace eval argparsingtest { |
||||||
|
variable pkg argparsingtest |
||||||
|
variable version |
||||||
|
set version 999999.0a1.0 |
||||||
|
}] |
||||||
|
return |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[manpage_end] |
||||||
|
|
@ -0,0 +1,3 @@ |
|||||||
|
0.1.0 |
||||||
|
#First line must be a semantic version number |
||||||
|
#all other lines are ignored. |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,221 @@ |
|||||||
|
# -*- tcl -*- |
||||||
|
# Maintenance Instruction: leave the 999999.xxx.x as is and use punkshell 'pmix make' or bin/punkmake to update from <pkg>-buildversion.txt |
||||||
|
# module template: shellspy/src/decktemplates/vendor/punk/modules/template_module-0.0.2.tm |
||||||
|
# |
||||||
|
# Please consider using a BSD or MIT style license for greatest compatibility with the Tcl ecosystem. |
||||||
|
# Code using preferred Tcl licenses can be eligible for inclusion in Tcllib, Tklib and the punk package repository. |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# (C) 2024 |
||||||
|
# |
||||||
|
# @@ Meta Begin |
||||||
|
# Application punk::aliascore 999999.0a1.0 |
||||||
|
# Meta platform tcl |
||||||
|
# Meta license <unspecified> |
||||||
|
# @@ Meta End |
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# doctools header |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
#*** !doctools |
||||||
|
#[manpage_begin shellspy_module_punk::aliascore 0 999999.0a1.0] |
||||||
|
#[copyright "2024"] |
||||||
|
#[titledesc {Module API}] [comment {-- Name section and table of contents description --}] |
||||||
|
#[moddesc {-}] [comment {-- Description at end of page heading --}] |
||||||
|
#[require punk::aliascore] |
||||||
|
#[keywords module] |
||||||
|
#[description] |
||||||
|
#[para] - |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[section Overview] |
||||||
|
#[para] overview of punk::aliascore |
||||||
|
#[subsection Concepts] |
||||||
|
#[para] - |
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
## Requirements |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[subsection dependencies] |
||||||
|
#[para] packages used by punk::aliascore |
||||||
|
#[list_begin itemized] |
||||||
|
|
||||||
|
package require Tcl 8.6- |
||||||
|
#*** !doctools |
||||||
|
#[item] [package {Tcl 8.6}] |
||||||
|
|
||||||
|
# #package require frobz |
||||||
|
# #*** !doctools |
||||||
|
# #[item] [package {frobz}] |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[section API] |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# oo::class namespace |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
namespace eval punk::aliascore::class { |
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace punk::aliascore::class}] |
||||||
|
#[para] class definitions |
||||||
|
if {[info commands [namespace current]::interface_sample1] eq ""} { |
||||||
|
#*** !doctools |
||||||
|
#[list_begin enumerated] |
||||||
|
|
||||||
|
# oo::class create interface_sample1 { |
||||||
|
# #*** !doctools |
||||||
|
# #[enum] CLASS [class interface_sample1] |
||||||
|
# #[list_begin definitions] |
||||||
|
|
||||||
|
# method test {arg1} { |
||||||
|
# #*** !doctools |
||||||
|
# #[call class::interface_sample1 [method test] [arg arg1]] |
||||||
|
# #[para] test method |
||||||
|
# puts "test: $arg1" |
||||||
|
# } |
||||||
|
|
||||||
|
# #*** !doctools |
||||||
|
# #[list_end] [comment {-- end definitions interface_sample1}] |
||||||
|
# } |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] [comment {--- end class enumeration ---}] |
||||||
|
} |
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# Base namespace |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
namespace eval punk::aliascore { |
||||||
|
namespace export {[a-z]*} ;# Convention: export all lowercase |
||||||
|
variable aliases |
||||||
|
set aliases [dict create\ |
||||||
|
list_as_lines punk::lib::list_as_lines\ |
||||||
|
lines_as_list punk::lib::lines_as_list\ |
||||||
|
linelist punk::lib::linelist\ |
||||||
|
linesort punk::lib::linesort\ |
||||||
|
ansistrip punk::ansi::stripansi\ |
||||||
|
] |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace punk::aliascore}] |
||||||
|
#[para] Core API functions for punk::aliascore |
||||||
|
#[list_begin definitions] |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#proc sample1 {p1 n args} { |
||||||
|
# #*** !doctools |
||||||
|
# #[call [fun sample1] [arg p1] [arg n] [opt {option value...}]] |
||||||
|
# #[para]Description of sample1 |
||||||
|
# #[para] Arguments: |
||||||
|
# # [list_begin arguments] |
||||||
|
# # [arg_def tring p1] A description of string argument p1. |
||||||
|
# # [arg_def integer n] A description of integer argument n. |
||||||
|
# # [list_end] |
||||||
|
# return "ok" |
||||||
|
#} |
||||||
|
|
||||||
|
#todo - options as to whether we should raise an error if collisions found, undo aliases etc? |
||||||
|
proc init {args} { |
||||||
|
set defaults {-force 0} |
||||||
|
set opts [dict merge $defaults $args] |
||||||
|
set opt_force [dict get $opts -force] |
||||||
|
|
||||||
|
variable aliases |
||||||
|
if {!$opt_force} { |
||||||
|
set existing [list] |
||||||
|
set conflicts [list] |
||||||
|
foreach {a cmd} $aliases { |
||||||
|
if {[info commands ::$a] ne ""} { |
||||||
|
lappend existing $a |
||||||
|
set existing_target [interp alias "" $a] |
||||||
|
if {$existing_target ne $cmd} { |
||||||
|
#command exists in global ns but is either an alias to something else, or some other type of command |
||||||
|
lappend conflicts $a |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
if {[llength $conflicts]} { |
||||||
|
error "punk::aliascore::init declined to create any aliases because -force == 0 and conflicts found:$conflicts" |
||||||
|
} |
||||||
|
} |
||||||
|
dict for {a cmd} $aliases { |
||||||
|
interp alias {} $a {} {*}$cmd |
||||||
|
} |
||||||
|
return [dict keys $aliases] |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] [comment {--- end definitions namespace punk::aliascore ---}] |
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
#interp alias {} list_as_lines {} punk::lib::list_as_lines |
||||||
|
#interp alias {} lines_as_list {} punk::lib::lines_as_list |
||||||
|
#interp alias {} ansistrip {} punk::ansi::stripansi ;#review |
||||||
|
#interp alias {} linelist {} punk::lib::linelist ;#critical for = assignment features |
||||||
|
#interp alias {} linesort {} punk::lib::linesort |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# Secondary API namespace |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
namespace eval punk::aliascore::lib { |
||||||
|
namespace export {[a-z]*} ;# Convention: export all lowercase |
||||||
|
namespace path [namespace parent] |
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace punk::aliascore::lib}] |
||||||
|
#[para] Secondary functions that are part of the API |
||||||
|
#[list_begin definitions] |
||||||
|
|
||||||
|
#proc utility1 {p1 args} { |
||||||
|
# #*** !doctools |
||||||
|
# #[call lib::[fun utility1] [arg p1] [opt {?option value...?}]] |
||||||
|
# #[para]Description of utility1 |
||||||
|
# return 1 |
||||||
|
#} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] [comment {--- end definitions namespace punk::aliascore::lib ---}] |
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
#*** !doctools |
||||||
|
#[section Internal] |
||||||
|
namespace eval punk::aliascore::system { |
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace punk::aliascore::system}] |
||||||
|
#[para] Internal functions that are not part of the API |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
## Ready |
||||||
|
package provide punk::aliascore [namespace eval punk::aliascore { |
||||||
|
variable pkg punk::aliascore |
||||||
|
variable version |
||||||
|
set version 999999.0a1.0 |
||||||
|
}] |
||||||
|
return |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[manpage_end] |
||||||
|
|
@ -0,0 +1,3 @@ |
|||||||
|
0.1.0 |
||||||
|
#First line must be a semantic version number |
||||||
|
#all other lines are ignored. |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,561 @@ |
|||||||
|
# -*- tcl -*- |
||||||
|
# Maintenance Instruction: leave the 999999.xxx.x as is and use punkshell 'pmix make' or bin/punkmake to update from <pkg>-buildversion.txt |
||||||
|
# module template: shellspy/src/decktemplates/vendor/punk/modules/template_module-0.0.2.tm |
||||||
|
# |
||||||
|
# Please consider using a BSD or MIT style license for greatest compatibility with the Tcl ecosystem. |
||||||
|
# Code using preferred Tcl licenses can be eligible for inclusion in Tcllib, Tklib and the punk package repository. |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# (C) 2024 |
||||||
|
# |
||||||
|
# @@ Meta Begin |
||||||
|
# Application punk::island 999999.0a1.0 |
||||||
|
# Meta platform tcl |
||||||
|
# Meta license <unspecified> |
||||||
|
# @@ Meta End |
||||||
|
|
||||||
|
#This version of island has been namespaced as the package punk::island as it may need to diverge in functionality for the purposes of use in the punk::repl system. |
||||||
|
#see: https://wiki.tcl-lang.org/page/island |
||||||
|
################## |
||||||
|
## Module Name -- island.tcl |
||||||
|
## Original Author -- Emmanuel Frecon - efrecon@gmail.com |
||||||
|
## Description: |
||||||
|
## |
||||||
|
## Package to a allow a safe interpreter to access islands of the |
||||||
|
## filesystem only, i.e. restricted directory trees within the |
||||||
|
## filesystem. The package brings back file, open and glob to the slave |
||||||
|
## interpreter, though in a restricted manner. |
||||||
|
## |
||||||
|
################## |
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# doctools header |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
#*** !doctools |
||||||
|
#[manpage_begin shellspy_module_punk::island 0 999999.0a1.0] |
||||||
|
#[copyright "2024"] |
||||||
|
#[titledesc {filesystem islands for safe interps}] [comment {-- Name section and table of contents description --}] |
||||||
|
#[moddesc {punk::island for safe interps}] [comment {-- Description at end of page heading --}] |
||||||
|
#[require punk::island] |
||||||
|
#[keywords module interp filesystem] |
||||||
|
#[description] |
||||||
|
#[para] Package to a allow a safe interpreter to access islands of the |
||||||
|
#[para] filesystem only, i.e. restricted directory trees within the |
||||||
|
#[para] filesystem. The package brings back file, open and glob to the child interp |
||||||
|
#[para] interpreter, though in a restricted manner. |
||||||
|
#[para] JN Warning: |
||||||
|
#[para] This mechanism can have interactions with package loading from auto_path - needs review. |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[section Overview] |
||||||
|
#[para] overview of punk::island |
||||||
|
#[subsection Concepts] |
||||||
|
#[para] - |
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
## Requirements |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[subsection dependencies] |
||||||
|
#[para] packages used by punk::island |
||||||
|
#[list_begin itemized] |
||||||
|
|
||||||
|
package require Tcl 8.6- |
||||||
|
#*** !doctools |
||||||
|
#[item] [package {Tcl 8.6}] |
||||||
|
|
||||||
|
# #package require frobz |
||||||
|
# #*** !doctools |
||||||
|
# #[item] [package {frobz}] |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[section API] |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# oo::class namespace |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
namespace eval punk::island::class { |
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace punk::island::class}] |
||||||
|
#[para] class definitions |
||||||
|
if {[info commands [namespace current]::interface_sample1] eq ""} { |
||||||
|
#*** !doctools |
||||||
|
#[list_begin enumerated] |
||||||
|
|
||||||
|
# oo::class create interface_sample1 { |
||||||
|
# #*** !doctools |
||||||
|
# #[enum] CLASS [class interface_sample1] |
||||||
|
# #[list_begin definitions] |
||||||
|
|
||||||
|
# method test {arg1} { |
||||||
|
# #*** !doctools |
||||||
|
# #[call class::interface_sample1 [method test] [arg arg1]] |
||||||
|
# #[para] test method |
||||||
|
# puts "test: $arg1" |
||||||
|
# } |
||||||
|
|
||||||
|
# #*** !doctools |
||||||
|
# #[list_end] [comment {-- end definitions interface_sample1}] |
||||||
|
# } |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] [comment {--- end class enumeration ---}] |
||||||
|
} |
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# Will host information for interpreters |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
namespace eval punk::island::interps { |
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace punk::island::interps}] |
||||||
|
#[para] hosts information for interpreters |
||||||
|
#[list_begin definitions] |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] [comment {--- end definitions namespace punk::island::interps ---}] |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# Base namespace |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
namespace eval punk::island { |
||||||
|
namespace export {[a-z]*}; # Convention: export all lowercase |
||||||
|
namespace ensemble create |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace punk::island}] |
||||||
|
#[para] Core API functions for punk::island |
||||||
|
#[list_begin definitions] |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#proc sample1 {p1 n args} { |
||||||
|
# #*** !doctools |
||||||
|
# #[call [fun sample1] [arg p1] [arg n] [opt {option value...}]] |
||||||
|
# #[para]Description of sample1 |
||||||
|
# #[para] Arguments: |
||||||
|
# # [list_begin arguments] |
||||||
|
# # [arg_def string p1] A description of string argument p1. |
||||||
|
# # [arg_def integer n] A description of integer argument n. |
||||||
|
# # [list_end] |
||||||
|
# return "ok" |
||||||
|
#} |
||||||
|
|
||||||
|
proc add { child path } { |
||||||
|
#*** !doctools |
||||||
|
#[call [fun add] [arg child] [arg path]] |
||||||
|
#[para] Add a path to the list of paths that are explicitely allowed for access |
||||||
|
#[para] to a child interpreter. Access to any path that has not been explicitely |
||||||
|
#[para] allowed will be denied. Paths that are added to the list of allowed |
||||||
|
#[para] islands are always fully normalized. |
||||||
|
#[para] Arguments: |
||||||
|
# [list_begin arguments] |
||||||
|
# [arg_def string child] Identifier of the child interpreter to control |
||||||
|
# [list_end] |
||||||
|
set vname [namespace current]::interps::[string map {: _} $child] |
||||||
|
if { ![info exists $vname]} { |
||||||
|
system::Init $child |
||||||
|
} |
||||||
|
upvar \#0 $vname paths |
||||||
|
lappend paths [::file dirname [::file normalize $path/___]] |
||||||
|
} |
||||||
|
|
||||||
|
proc reset { child } { |
||||||
|
#*** !doctools |
||||||
|
#[call [fun reset] [arg child]] |
||||||
|
#[para] Remove all access path allowance and arrange for the interpreter to be |
||||||
|
#[para] able to return to the regular safe state. |
||||||
|
#[para] Arguments: |
||||||
|
# [list_begin arguments] |
||||||
|
# [arg_def string child] Identifier of the child interpreter |
||||||
|
# [list_end] |
||||||
|
set vname [namespace current]::interps::[string map {: _} $child] |
||||||
|
if { [info exists $vname] } { |
||||||
|
$child alias file {} |
||||||
|
$child alias open {} |
||||||
|
$child alias glob {} |
||||||
|
$child alias fconfigure {} |
||||||
|
unset $vname |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
######################## |
||||||
|
## |
||||||
|
## Procedures below are internal to the implementation. |
||||||
|
## |
||||||
|
######################## |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] [comment {--- end definitions namespace punk::island ---}] |
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# Secondary API namespace |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
namespace eval punk::island::lib { |
||||||
|
namespace export * |
||||||
|
namespace path [namespace parent] |
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace punk::island::lib}] |
||||||
|
#[para] Secondary functions that are part of the API |
||||||
|
#[list_begin definitions] |
||||||
|
|
||||||
|
#proc utility1 {p1 args} { |
||||||
|
# #*** !doctools |
||||||
|
# #[call lib::[fun utility1] [arg p1] [opt {?option value...?}]] |
||||||
|
# #[para]Description of utility1 |
||||||
|
# return 1 |
||||||
|
#} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] [comment {--- end definitions namespace punk::island::lib ---}] |
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
#*** !doctools |
||||||
|
#[section Internal] |
||||||
|
namespace eval punk::island::system { |
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace punk::island::system}] |
||||||
|
#[para] Internal functions that are not part of the API |
||||||
|
#[list_begin definitions] |
||||||
|
|
||||||
|
proc Allowed { child fname } { |
||||||
|
#*** !doctools |
||||||
|
#[call [fun Allowed] [arg child] [arg fname]] |
||||||
|
#[para] Check that the file name passed as an argument is within the islands of |
||||||
|
#[para] the filesystem that have been registered through the add command for a |
||||||
|
#[para] given (safe) interpreter. The path is fully normalized before testing |
||||||
|
#[para] against the islands, which themselves are fully normalized. |
||||||
|
#[para] Arguments: |
||||||
|
# [list_begin arguments] |
||||||
|
# [arg_def string child] Identifier of the child interpreter |
||||||
|
# [arg_def string fname] (relative) path to the file to test |
||||||
|
# [list_end] |
||||||
|
set vname ::punk::island::interps::[string map {: _} $child] |
||||||
|
upvar \#0 $vname paths |
||||||
|
|
||||||
|
set abs_fname [::file dirname [::file normalize $fname/___]] |
||||||
|
foreach path $paths { |
||||||
|
if { [string first $path $abs_fname] == 0 } { |
||||||
|
return 1 |
||||||
|
} |
||||||
|
} |
||||||
|
return 0 |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
proc File { child cmd args } { |
||||||
|
#*** !doctools |
||||||
|
#[call [fun File] [arg child] [arg cmd] [arg args]] |
||||||
|
#[para] Parses the options and arguments to the file command to discover which |
||||||
|
#[para] paths it tries to access and only return the results of its execution |
||||||
|
#[para] when these path are within the allowed islands of the filesystem. |
||||||
|
#[para] Arguments: |
||||||
|
# [list_begin arguments] |
||||||
|
# [arg_def string child] Identifier of the child interpreter |
||||||
|
# [arg_def string cmd] Subcommand of the file command |
||||||
|
# [arg_def string args] Arguments to the file subcommand |
||||||
|
# [list_end] |
||||||
|
|
||||||
|
switch $cmd { |
||||||
|
atime - |
||||||
|
attributes - |
||||||
|
executable - |
||||||
|
exists - |
||||||
|
isdirectory - |
||||||
|
isfile - |
||||||
|
lstat - |
||||||
|
mtime - |
||||||
|
normalize - |
||||||
|
owned - |
||||||
|
readable - |
||||||
|
readlink - |
||||||
|
size - |
||||||
|
stat - |
||||||
|
system - |
||||||
|
type - |
||||||
|
writable { |
||||||
|
set fname [lindex $args 0] |
||||||
|
if { [Allowed $child $fname] } { |
||||||
|
return [uplevel [linsert $args 0 ::file $cmd]] |
||||||
|
# file is highly restrictive in child interpreters, so we can't do the following. |
||||||
|
return [uplevel [linsert $args 0 $child invokehidden ::file $cmd]] |
||||||
|
} else { |
||||||
|
#return -code error "Access to $fname denied." |
||||||
|
return [uplevel [linsert $args 0 $child invokehidden ::file $cmd]] |
||||||
|
#return [uplevel [list $child invokehidden tcl:file:$cmd {*}$args]] |
||||||
|
} |
||||||
|
} |
||||||
|
channels - |
||||||
|
dirname - |
||||||
|
extension - |
||||||
|
join - |
||||||
|
nativename - |
||||||
|
pathtype - |
||||||
|
rootname - |
||||||
|
separator - |
||||||
|
split - |
||||||
|
tail - |
||||||
|
volumes { |
||||||
|
return [uplevel [list ::file $cmd {*}$args]] |
||||||
|
# file is highly restrictive in child interpreters, so we can't do the following. |
||||||
|
# (result would be error: invalid hidden command name "file") |
||||||
|
return [uplevel [linsert $args 0 $child invokehidden file $cmd]] |
||||||
|
} |
||||||
|
copy - |
||||||
|
delete - |
||||||
|
rename - |
||||||
|
link { |
||||||
|
set idx [lsearch $args "--"] |
||||||
|
if { $idx >= 0 } { |
||||||
|
set paths [lrange $args [expr {$idx+1}] end] |
||||||
|
} else { |
||||||
|
if { [string index [lindex $args 0] 0] eq "-" } { |
||||||
|
set paths [lrange $args 1 end] |
||||||
|
} else { |
||||||
|
set paths $args |
||||||
|
} |
||||||
|
} |
||||||
|
foreach path $paths { |
||||||
|
if { ![Allowed $child $path] } { |
||||||
|
return -code error "Access to $path denied." |
||||||
|
} |
||||||
|
} |
||||||
|
return [uplevel [linsert $args 0 ::file $cmd]] |
||||||
|
# file is highly restrictive in child interpreters, so we can't do the following. |
||||||
|
return [uplevel [linsert $args 0 $child invokehidden file $cmd]] |
||||||
|
} |
||||||
|
mkdir { |
||||||
|
foreach path $args { |
||||||
|
if { ![Allowed $child $path] } { |
||||||
|
return -code error "Access to $path denied." |
||||||
|
} |
||||||
|
} |
||||||
|
return [uplevel [linsert $args 0 ::file $cmd]] |
||||||
|
# file is highly restrictive in child interps, so we can't do the following. |
||||||
|
return [uplevel [linsert $args 0 $child invokehidden file $cmd]] |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
proc Open { child args } { |
||||||
|
#*** !doctools |
||||||
|
#[call [fun Open] [arg child] [arg args]] |
||||||
|
#[para] Parses the options and arguments to the open command to discover which |
||||||
|
#[para] paths it tries to access and only return the results of its execution |
||||||
|
#[para] when these path are within the allowed islands of the filesystem. |
||||||
|
#[para] Arguments: |
||||||
|
# [list_begin arguments] |
||||||
|
# [arg_def string child] Identifier of the child interpreter |
||||||
|
# [arg_def string args] Arguments to the open subcommand |
||||||
|
# [list_end] |
||||||
|
|
||||||
|
set fname [lindex $args 0] |
||||||
|
if { [string index [string trim $fname] 0] eq "|" } { |
||||||
|
return -code error "Execution of external programs disabled." |
||||||
|
} |
||||||
|
|
||||||
|
if { [Allowed $child $fname] } { |
||||||
|
return [uplevel [list $child invokehidden open {*}$args]] |
||||||
|
} else { |
||||||
|
return -code error "Access to $fname denied." |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
proc Expose { child cmd args } { |
||||||
|
#*** !doctools |
||||||
|
#[call [fun Expose] [arg child] [arg cmd] [arg args]] |
||||||
|
#[para] This procedure allows to callback a command that would typically have |
||||||
|
#[para] been hidden from a child interpreter. It does not "interp expose" but |
||||||
|
#[para] rather calls the hidden command, so we can easily revert back. |
||||||
|
#[para] Arguments: |
||||||
|
# [list_begin arguments] |
||||||
|
# [arg_def string child] Identifier of the child interpreter |
||||||
|
# [arg_def string cmd] Hidden command to call |
||||||
|
# [arg_def string args] Arguments to the command |
||||||
|
# [list_end] |
||||||
|
|
||||||
|
return [uplevel 1 [list $child invokehidden $cmd {*}$args]] |
||||||
|
} |
||||||
|
|
||||||
|
proc Glob { child args } { |
||||||
|
#*** !doctools |
||||||
|
#[call [fun Glob] [arg child] [arg args]] |
||||||
|
#[para] Parses the options and arguments to the glob command to discover which |
||||||
|
#[para] paths it tries to access and only return the results of its execution |
||||||
|
#[para] when these path are within the allowed islands of the filesystem. |
||||||
|
#[para] Arguments: |
||||||
|
# [list_begin arguments] |
||||||
|
# [arg_def string child] Identifier of the child interpreter |
||||||
|
# [arg_def string args] Arguments to the glob command |
||||||
|
# [list_end] |
||||||
|
|
||||||
|
set noargs [list -join -nocomplain -tails ] |
||||||
|
set within "" |
||||||
|
set flags [list] |
||||||
|
set is_join 0 ;#manually handle join |
||||||
|
for {set i 0} {$i < [llength $args]} {incr i} { |
||||||
|
set itm [lindex $args $i] |
||||||
|
if { $itm eq "--" } { |
||||||
|
incr i; break |
||||||
|
} elseif { [string index $itm 0] eq "-" } { |
||||||
|
# Segregates between options that take a value and options that |
||||||
|
# have no arguments and are booleans. |
||||||
|
if { [lsearch $noargs $itm] < 0 } { |
||||||
|
incr i; # Jump over argument |
||||||
|
switch -glob -- $itm { |
||||||
|
"-dir*" { |
||||||
|
set within [lindex $args $i] |
||||||
|
append within / |
||||||
|
#don't add to flags - will be added back in below if necessary |
||||||
|
} |
||||||
|
"-path*" { |
||||||
|
set within [lindex $args $i] |
||||||
|
#don't add to flags |
||||||
|
} |
||||||
|
default { |
||||||
|
#e.g -type -types |
||||||
|
lappend flags $itm [lindex $args $i] |
||||||
|
} |
||||||
|
} |
||||||
|
} else { |
||||||
|
if {[string match "-j*" $itm]} { |
||||||
|
set is_join 1 |
||||||
|
} else { |
||||||
|
lappend flags [lindex $args $i] |
||||||
|
} |
||||||
|
} |
||||||
|
} else { |
||||||
|
break |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
set paths [dict create] |
||||||
|
set what [list] |
||||||
|
if {$is_join} { |
||||||
|
set patterns [list [join [lrange $args $i end] /]] |
||||||
|
} else { |
||||||
|
set patterns [lrange $args $i end] |
||||||
|
} |
||||||
|
foreach ptn $patterns { |
||||||
|
set path ${within}$ptn |
||||||
|
#look for leading safe tokens of form $p(:digits:) only and detokenize so island can test |
||||||
|
set re {(\$p\(:[0-9]*:\))(.*)} |
||||||
|
if {[regexp $re $path _all tok tailpattern]} { |
||||||
|
set tailpattern [string trim $tailpattern {/}] ;#review |
||||||
|
set detok [uplevel [list safe::DetokPath $child $tok]] |
||||||
|
set fullpathpattern [string map [list $tok $detok] $path] |
||||||
|
set dir $detok |
||||||
|
} else { |
||||||
|
set fullpathpattern $path |
||||||
|
set dir $within |
||||||
|
set tailpattern $ptn |
||||||
|
set tok "" ;#doesn't apply - we could lookup to see if one happens to correspond? review |
||||||
|
} |
||||||
|
set island_allowed [Allowed $child $fullpathpattern] |
||||||
|
dict set paths $path [list islandok [Allowed $child $fullpathpattern] fullpathpattern $fullpathpattern dir $dir tok $tok tailpattern $tailpattern] ;#store bool against each path for whether island allows |
||||||
|
#if { ![Allowed $child $path] } { |
||||||
|
# #return -code error "Access to $path denied." |
||||||
|
#} |
||||||
|
} |
||||||
|
#return [uplevel [list safe::AliasGlob $child {*}$args]] |
||||||
|
|
||||||
|
#As at 2024, The safe::AliasGlob version of glob requires the -directory option. |
||||||
|
#ie it doesn't support things like: glob {$p(:208:)/*} |
||||||
|
#This would instead have to be glob -directory {$p(:208:)} * |
||||||
|
#It also doesn't support shortened versions such as -dir instead of -directory |
||||||
|
|
||||||
|
set entries [list] |
||||||
|
dict for {path pathinfo} $paths { |
||||||
|
puts "------------->path: $path" |
||||||
|
puts " >pathinfo: $pathinfo" |
||||||
|
puts " >flags: $flags" |
||||||
|
puts " >args: $args" |
||||||
|
set islandok [dict get $pathinfo islandok] |
||||||
|
if {$islandok} { |
||||||
|
puts stderr "[a+ web-red]XXX ->[list $child invokehidden glob {*}$flags [dict get $pathinfo fullpathpattern]][a]" |
||||||
|
#return spuds |
||||||
|
#lappend entries [uplevel 1 [list $child invokehidden glob {*}$flags [dict get $pathinfo fullpathpattern]]] |
||||||
|
lappend entries [uplevel 1 [list ::glob {*}$flags [dict get $pathinfo fullpathpattern]]] |
||||||
|
} else { |
||||||
|
#only pass paths with tokens to safe - or we will get in a loop |
||||||
|
set tok [dict get $pathinfo tok] |
||||||
|
if {$tok ne ""} { |
||||||
|
puts stderr "============ tok:$tok tailpattern:[dict get $pathinfo tailpattern]" |
||||||
|
#dir is detokenised - but we should use the token for safe::AliasGlob |
||||||
|
lappend entries {*}[uplevel [list safe::AliasGlob $child {*}$flags -directory $tok [dict get $pathinfo tailpattern]]] |
||||||
|
} else { |
||||||
|
puts stderr "****============ no-token tailpattern:[dict get $pathinfo tailpattern]" |
||||||
|
lappend entries [uplevel 1 [list $child invokehidden glob {*}$flags [dict get $pathinfo fullpathpattern]]] |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
#dedup? |
||||||
|
if {$islandok} { |
||||||
|
puts stderr "[a+ web-green]$entries[a]" |
||||||
|
} |
||||||
|
return $entries |
||||||
|
#return [uplevel [list $child invokehidden glob {*}$args]] |
||||||
|
} |
||||||
|
|
||||||
|
proc Init { child } { |
||||||
|
#*** !doctools |
||||||
|
#[call [fun Init] [arg child] ] |
||||||
|
#[para] Initialise child interpreter so that it will be able to perform some |
||||||
|
#[para] file operations, but only within some islands of the filesystem. |
||||||
|
#[para] Arguments: |
||||||
|
# [list_begin arguments] |
||||||
|
# [arg_def string child] Identifier of the child interpreter |
||||||
|
# [list_end] |
||||||
|
$child alias file ::punk::island::system::File $child |
||||||
|
$child alias glob ::punk::island::system::Glob $child |
||||||
|
# Allow to open some of the files, and since we did, arrange to be able to |
||||||
|
# fconfigure them once opened. |
||||||
|
$child alias open ::punk::island::system::Open $child |
||||||
|
$child alias fconfigure ::punk::island::system::Expose $child fconfigure |
||||||
|
|
||||||
|
$child alias pwd ::punk::island::system::Expose $child pwd |
||||||
|
$child alias cd ::punk::island::system::Expose $child cd ;# warning: cd affects whole process - generally not something desirable in a safe interp |
||||||
|
} |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] [comment {--- end definitions namespace punk::island::system ---}] |
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
## Ready |
||||||
|
package provide punk::island [namespace eval punk::island { |
||||||
|
variable pkg punk::island |
||||||
|
variable version |
||||||
|
set version 999999.0a1.0 |
||||||
|
}] |
||||||
|
return |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[manpage_end] |
||||||
|
|
@ -0,0 +1,3 @@ |
|||||||
|
0.1.0 |
||||||
|
#First line must be a semantic version number |
||||||
|
#all other lines are ignored. |
@ -0,0 +1,255 @@ |
|||||||
|
# -*- tcl -*- |
||||||
|
# Maintenance Instruction: leave the 999999.xxx.x as is and use punkshell 'pmix make' or bin/punkmake to update from <pkg>-buildversion.txt |
||||||
|
# module template: shellspy/src/decktemplates/vendor/punk/modules/template_module-0.0.2.tm |
||||||
|
# |
||||||
|
# Please consider using a BSD or MIT style license for greatest compatibility with the Tcl ecosystem. |
||||||
|
# Code using preferred Tcl licenses can be eligible for inclusion in Tcllib, Tklib and the punk package repository. |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# (C) 2024 |
||||||
|
# |
||||||
|
# @@ Meta Begin |
||||||
|
# Application punk::repl::codethread 999999.0a1.0 |
||||||
|
# Meta platform tcl |
||||||
|
# Meta license <unspecified> |
||||||
|
# @@ Meta End |
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# doctools header |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
#*** !doctools |
||||||
|
#[manpage_begin shellspy_module_punk::repl::codethread 0 999999.0a1.0] |
||||||
|
#[copyright "2024"] |
||||||
|
#[titledesc {Module API}] [comment {-- Name section and table of contents description --}] |
||||||
|
#[moddesc {-}] [comment {-- Description at end of page heading --}] |
||||||
|
#[require punk::repl::codethread] |
||||||
|
#[keywords module] |
||||||
|
#[description] |
||||||
|
#[para] - |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[section Overview] |
||||||
|
#[para] overview of punk::repl::codethread |
||||||
|
#[subsection Concepts] |
||||||
|
#[para] - |
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
## Requirements |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[subsection dependencies] |
||||||
|
#[para] packages used by punk::repl::codethread |
||||||
|
#[list_begin itemized] |
||||||
|
|
||||||
|
package require Tcl 8.6- |
||||||
|
package require punk::config |
||||||
|
#*** !doctools |
||||||
|
#[item] [package {Tcl 8.6}] |
||||||
|
|
||||||
|
# #package require frobz |
||||||
|
# #*** !doctools |
||||||
|
# #[item] [package {frobz}] |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[section API] |
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# oo::class namespace |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
namespace eval punk::repl::codethread::class { |
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace punk::repl::codethread::class}] |
||||||
|
#[para] class definitions |
||||||
|
if {[info commands [namespace current]::interface_sample1] eq ""} { |
||||||
|
#*** !doctools |
||||||
|
#[list_begin enumerated] |
||||||
|
|
||||||
|
# oo::class create interface_sample1 { |
||||||
|
# #*** !doctools |
||||||
|
# #[enum] CLASS [class interface_sample1] |
||||||
|
# #[list_begin definitions] |
||||||
|
|
||||||
|
# method test {arg1} { |
||||||
|
# #*** !doctools |
||||||
|
# #[call class::interface_sample1 [method test] [arg arg1]] |
||||||
|
# #[para] test method |
||||||
|
# puts "test: $arg1" |
||||||
|
# } |
||||||
|
|
||||||
|
# #*** !doctools |
||||||
|
# #[list_end] [comment {-- end definitions interface_sample1}] |
||||||
|
# } |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] [comment {--- end class enumeration ---}] |
||||||
|
} |
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# Base namespace |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
namespace eval punk::repl::codethread { |
||||||
|
namespace export * |
||||||
|
variable replthread |
||||||
|
variable replthread_cond |
||||||
|
variable running 0 |
||||||
|
|
||||||
|
variable output_stdout "" |
||||||
|
variable output_stderr "" |
||||||
|
|
||||||
|
#variable xyz |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace punk::repl::codethread}] |
||||||
|
#[para] Core API functions for punk::repl::codethread |
||||||
|
#[list_begin definitions] |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#proc sample1 {p1 n args} { |
||||||
|
# #*** !doctools |
||||||
|
# #[call [fun sample1] [arg p1] [arg n] [opt {option value...}]] |
||||||
|
# #[para]Description of sample1 |
||||||
|
# #[para] Arguments: |
||||||
|
# # [list_begin arguments] |
||||||
|
# # [arg_def tring p1] A description of string argument p1. |
||||||
|
# # [arg_def integer n] A description of integer argument n. |
||||||
|
# # [list_end] |
||||||
|
# return "ok" |
||||||
|
#} |
||||||
|
|
||||||
|
proc is_running {} { |
||||||
|
variable running |
||||||
|
return $running |
||||||
|
} |
||||||
|
proc runscript {script} { |
||||||
|
#puts stderr "->runscript" |
||||||
|
variable replthread_cond |
||||||
|
variable output_stdout "" |
||||||
|
variable output_stderr "" |
||||||
|
#expecting to be called from a thread::send in parent repl - ie in the toplevel interp so that the sub-interp "code" is available |
||||||
|
#if a thread::send is done from the commandline in a codethread - Tcl will |
||||||
|
if {"code" ni [interp children] || ![info exists replthread_cond]} { |
||||||
|
#in case someone tries calling from codethread directly - don't do anything or change any state |
||||||
|
#(direct caller could create an interp named code at the level "" -> "code" -"code" and add a replthread_cond value to avoid this check - but it probably won't do anything useful) |
||||||
|
#if called directly - the context will be within the first 'code' interp. |
||||||
|
#inappropriate caller could add superfluous entries to shellfilter stack if function errors out |
||||||
|
#inappropriate caller could affect tsv vars (if their interp allows that anyway) |
||||||
|
puts stderr "runscript is meant to be called from the parent repl thread via a thread::send to the codethread" |
||||||
|
return |
||||||
|
} |
||||||
|
upvar ::punk::config::running running_config |
||||||
|
if {[string length [dict get $running_config color_stdout]] && [punk::console::colour]} { |
||||||
|
lappend outstack [shellfilter::stack::add stdout ansiwrap -settings [list -colour [dict get $running_config color_stdout]]] |
||||||
|
} |
||||||
|
lappend outstack [shellfilter::stack::add stdout tee_to_var -settings {-varname ::punk::repl::codethread::output_stdout}] |
||||||
|
if {[string length [dict get $running_config color_stderr]] && [punk::console::colour]} { |
||||||
|
#lappend errstack [shellfilter::stack::add stderr ansiwrap -settings [list -colour [dict get $running_config color_stderr]]] |
||||||
|
lappend errstack [shellfilter::stack::add stderr ansiwrap -settings [list -colour cyan]] |
||||||
|
} |
||||||
|
lappend errstack [shellfilter::stack::add stderr tee_to_var -settings {-varname ::punk::repl::codethread::output_stderr}] |
||||||
|
|
||||||
|
#an experiment |
||||||
|
#set errhandle [shellfilter::stack::item_tophandle stderr] |
||||||
|
#interp transfer "" $errhandle code |
||||||
|
|
||||||
|
set scope [interp eval code [list set ::punk::ns::ns_current]] |
||||||
|
set status [catch { |
||||||
|
interp eval code [list namespace inscope $scope $script] |
||||||
|
} result] |
||||||
|
|
||||||
|
|
||||||
|
flush stdout |
||||||
|
flush stderr |
||||||
|
|
||||||
|
#interp transfer code $errhandle "" |
||||||
|
#flush $errhandle |
||||||
|
set lastoutchar [string index [punk::ansi::stripansi $output_stdout] end] |
||||||
|
set lasterrchar [string index [punk::ansi::stripansi $output_stderr] end] |
||||||
|
#puts stderr "-->[ansistring VIEW -lf 1 $lastoutchar$lasterrchar]" |
||||||
|
|
||||||
|
set tid [thread::id] |
||||||
|
tsv::set codethread_$tid info [list lastoutchar $lastoutchar lasterrchar $lasterrchar] |
||||||
|
tsv::set codethread_$tid status $status |
||||||
|
tsv::set codethread_$tid result $result |
||||||
|
tsv::set codethread_$tid errorcode $::errorCode |
||||||
|
|
||||||
|
|
||||||
|
foreach s [lreverse $outstack] { |
||||||
|
shellfilter::stack::remove stdout $s |
||||||
|
} |
||||||
|
foreach s [lreverse $errstack] { |
||||||
|
shellfilter::stack::remove stderr $s |
||||||
|
} |
||||||
|
thread::cond notify $replthread_cond |
||||||
|
} |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] [comment {--- end definitions namespace punk::repl::codethread ---}] |
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
# Secondary API namespace |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
namespace eval punk::repl::codethread::lib { |
||||||
|
namespace export * |
||||||
|
namespace path [namespace parent] |
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace punk::repl::codethread::lib}] |
||||||
|
#[para] Secondary functions that are part of the API |
||||||
|
#[list_begin definitions] |
||||||
|
|
||||||
|
#proc utility1 {p1 args} { |
||||||
|
# #*** !doctools |
||||||
|
# #[call lib::[fun utility1] [arg p1] [opt {?option value...?}]] |
||||||
|
# #[para]Description of utility1 |
||||||
|
# return 1 |
||||||
|
#} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[list_end] [comment {--- end definitions namespace punk::repl::codethread::lib ---}] |
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
#*** !doctools |
||||||
|
#[section Internal] |
||||||
|
namespace eval punk::repl::codethread::system { |
||||||
|
#*** !doctools |
||||||
|
#[subsection {Namespace punk::repl::codethread::system}] |
||||||
|
#[para] Internal functions that are not part of the API |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ |
||||||
|
## Ready |
||||||
|
package provide punk::repl::codethread [namespace eval punk::repl::codethread { |
||||||
|
variable pkg punk::repl::codethread |
||||||
|
variable version |
||||||
|
set version 999999.0a1.0 |
||||||
|
}] |
||||||
|
return |
||||||
|
|
||||||
|
#*** !doctools |
||||||
|
#[manpage_end] |
||||||
|
|
@ -0,0 +1,3 @@ |
|||||||
|
0.1.0 |
||||||
|
#First line must be a semantic version number |
||||||
|
#all other lines are ignored. |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue