Browse Source

tomlish and punk::netbox improvements

master
Julian Noble 2 weeks ago
parent
commit
a04a62d2e9
  1. 82
      src/bootsupport/modules/punk/args-0.1.0.tm
  2. 15
      src/bootsupport/modules/punk/path-0.1.0.tm
  3. 31
      src/bootsupport/modules/textblock-0.1.3.tm
  4. 5566
      src/bootsupport/modules/tomlish-1.1.2.tm
  5. 82
      src/modules/punk/args-999999.0a1.0.tm
  6. 1274
      src/modules/punk/imap4-999999.0a1.0.tm
  7. 1228
      src/modules/punk/netbox-999999.0a1.0.tm
  8. 3
      src/modules/punk/netbox-buildversion.txt
  9. 15
      src/modules/punk/path-999999.0a1.0.tm
  10. 31
      src/modules/textblock-999999.0a1.0.tm
  11. 82
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/args-0.1.0.tm
  12. 15
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/path-0.1.0.tm
  13. 31
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/textblock-0.1.3.tm
  14. 5566
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/tomlish-1.1.2.tm
  15. 82
      src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/args-0.1.0.tm
  16. 15
      src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/path-0.1.0.tm
  17. 31
      src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/textblock-0.1.3.tm
  18. 5566
      src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/tomlish-1.1.2.tm
  19. 5566
      src/vendormodules/tomlish-1.1.2.tm

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

@ -331,26 +331,26 @@ tcl::namespace::eval punk::args {
parsing and help display.
directives include:
%B%@id%N% ?opt val...?
options: -id <str>
spec-options: -id <str>
%B%@cmd%N% ?opt val...?
options: -name <str> -help <str>
spec-options: -name <str> -help <str>
%B%@leaders%N% ?opt val...?
options: -min <int> -max <int>
spec-options: -min <int> -max <int>
(used for leading args that come before switches/opts)
%B%@opts%N% ?opt val...?
options: -any <bool>
spec-options: -any <bool>
%B%@values%N% ?opt val...?
options: -min <int> -max <int>
spec-options: -min <int> -max <int>
(used for trailing args that come after switches/opts)
%B%@argdisplay%N% ?opt val...?
options: -header <str> (text for header row of table)
spec-options: -header <str> (text for header row of table)
-body <str> (text to replace autogenerated arg info)
%B%@doc%N% ?opt val...?
options: -name <str> -url <str>
spec-options: -name <str> -url <str>
%B%@seealso%N% ?opt val...?
options: -name <str> -url <str> (for footer - unimplemented)
spec-options: -name <str> -url <str> (for footer - unimplemented)
Some other options normally present on custom arguments are available
Some other spec-options normally present on custom arguments are available
to use with the @leaders @opts @values directives to set defaults
for subsequent lines that represent your custom arguments.
These directives should occur in exactly this order - but can be
@ -361,7 +361,12 @@ tcl::namespace::eval punk::args {
or using the i <cmd>.. function - an @id with -id <value> is needed.
All directives can be omitted, in which case every line represents
a custom value or option.
a custom leader, value or option.
All will be leaders by default if no options defined.
If options are defined (by naming with leading dash, or explicitly
specifying @opts) then the definitions prior to the options will be
categorised as leaders, and those following the options will be
categorised as values.
Custom arguments are defined by using any word at the start of a
line that doesn't begin with @ or -
@ -369,7 +374,7 @@ tcl::namespace::eval punk::args {
that @@somearg becomes an argument named @somearg)
custom leading args, switches/options (names starting with -)
and trailing values also take options:
and trailing values also take spec-options:
-type <typename>
defaults to string. If no other restrictions
@ -397,12 +402,22 @@ tcl::namespace::eval punk::args {
-optional <boolean>
(defaults to true for flags/switches false otherwise)
For non flag/switch arguments - all arguments with
-optional true must sit consecutively within their group.
ie all optional leader arguments must be together, and all
optional value arguments must be together. Furthermore,
specifying both optional leaders and optional values will
often lead to ambiguous parsing results. Currently, all
optional non-flg/switch arguments should be either at the
trailing end of leaders or the trailing end of values.
Further unambiguous arrangements of optional args may be
made in future - but are currently considered 'unsupported'
-default <value>
-multiple <bool> (for leaders & values defines whether
subsequent received values are stored agains the same
argument name - only applies to final leader or value)
subsequent received values are stored against the same
argument name - only applies to final leader OR final value)
(for options/flags this allows the opt-val pair or solo
flag to appear multiple times - no necessarily contiguously)
flag to appear multiple times - not necessarily contiguously)
-choices {<choicelist>}
A list of allowable values for an argument.
The -default value doesn't have to be in the list.
@ -438,7 +453,7 @@ tcl::namespace::eval punk::args {
Max of -1 represents no upper limit.
If <range> allows more than one choice the value is a list
consisting of items in the choices made available through
entries in -choices/-choicegrups.
entries in -choices/-choicegroups.
-minsize (type dependant)
-maxsize (type dependant)
-range (type dependant)
@ -1667,6 +1682,7 @@ tcl::namespace::eval punk::args {
"
@leaders -min 0 -max 0
@opts
-return -default text -choices {text dict}
-form -default 0 -help\
"Ordinal index or name of command form"
@ -1694,7 +1710,7 @@ tcl::namespace::eval punk::args {
(directives are lines beginning with
@ e.g @id, @cmd etc)
if -type is @leaders,@opts or @values matches from that type
if -type is leaders,opts or values matches from that type
will be returned.
if -type is another directive such as @id, @doc etc the
@ -1706,7 +1722,9 @@ tcl::namespace::eval punk::args {
proc resolved_def {args} {
#not eating our own dogfood here as far as argument parsing. -id ::punk::args::resolved_def is for documentation/errors only.
set opts [dict create\
-return text\
-types {}\
-form 0\
-antiglobs {}\
@ -1743,7 +1761,7 @@ tcl::namespace::eval punk::args {
}
dict for {k v} $opts {
switch -- $k {
-form - -types - -antiglobs - -override {}
-return - -form - -types - -antiglobs - -override {}
default {
punk::args::parse $args withid ::punk::args::resolved_def
return
@ -1764,10 +1782,11 @@ tcl::namespace::eval punk::args {
variable id_cache_rawdef
set realid [real_id $id]
if {$realid eq ""} {
return
}
if {$realid ne ""} {
set deflist [tcl::dict::get $id_cache_rawdef $realid]
set result ""
set specdict [uplevel 1 [list ::punk::args::resolve {*}$deflist]]
set opt_form [dict get $opts -form]
@ -1777,6 +1796,7 @@ tcl::namespace::eval punk::args {
set formname $opt_form
}
set opt_override [dict get $opts -override]
set opt_return [dict get $opts -return]
#set arg_info [dict get $specdict ARG_INFO]
set arg_info [dict get $specdict FORMS $formname ARG_INFO]
@ -1811,14 +1831,18 @@ tcl::namespace::eval punk::args {
set globbed [lsort -unique $globbed]
set included_args [punk::args::system::punklib_ldiff $globbed $suppressed_args]
set result ""
set resultdict [dict create]
foreach type $typelist {
switch -exact -- $type {
* {
if {"@id" in $included_directives} {
if {[dict exists $opt_override @id]} {
append result \n "@id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]"
dict set resultdict @id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]
} else {
append result \n "@id -id [dict get $specdict id]"
dict set resultdict @id [list -id [dict get $specdict id]]
}
}
foreach directive {@package @cmd @doc @seealso @argdisplay} {
@ -1826,8 +1850,10 @@ tcl::namespace::eval punk::args {
if {"$directive" in $included_directives} {
if {[dict exists $opt_override $directive]} {
append result \n "$directive [dict merge [dict get $specdict ${dshort}_info] [dict get $opt_override $directive]]"
dict set resultdict $directive [dict merge [dict get $specdict ${dshort}_info] [dict get $opt_override $directive]]
} else {
append result \n "$directive [dict get $specdict ${dshort}_info]"
dict set resultdict $directive [dict get $specdict ${dshort}_info]
}
}
}
@ -1843,8 +1869,10 @@ tcl::namespace::eval punk::args {
if {"$directive" in $included_directives} {
if {[dict exists $opt_override "$directive"]} {
append result \n "$directive [dict merge [dict get $specdict $defaults_key] [dict get $opt_override $directive]]"
dict set resultdict $directive [dict merge [dict get $specdict $defaults_key] [dict get $opt_override $directive]]
} else {
append result \n "$directive [dict get $specdict $defaults_key]"
dict set resultdict $directive [dict get $specdict $defaults_key]
}
}
@ -1855,8 +1883,10 @@ tcl::namespace::eval punk::args {
set argspec [dict remove $argspec -ARGTYPE]
if {[dict exists $opt_override $m]} {
append result \n "$m [dict merge $argspec [dict get $opt_override $m]]"
dict set resultdict $m [dict merge $argspec [dict get $opt_override $m]]
} else {
append result \n "$m $argspec"
dict set resultdict $m $argspec
}
}
}
@ -1869,8 +1899,10 @@ tcl::namespace::eval punk::args {
#only a single id record can exist
if {[dict exists $opt_override @id]} {
append result \n "@id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]"
dict set resultdict @id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]
} else {
append result \n "@id -id [dict get $specdict id]"
dict set resultdict @id [list -id [dict get $specdict id]]
}
}
}
@ -1879,8 +1911,10 @@ tcl::namespace::eval punk::args {
set tp [string range $type 1 end] ;# @package -> package
if {[dict exists $opt_override $type]} {
append result \n "$type [dict merge [dict get $specdict ${tp}_info] [dict get $opt_override $type]]"
dict set resultdict $type [dict merge [dict get $specdict ${tp}_info] [dict get $opt_override $type]]
} else {
append result \n "$type [dict get $specdict ${tp}_info]"
dict set resultdict $type [dict get $specdict ${tp}_info]
}
}
}
@ -1894,8 +1928,10 @@ tcl::namespace::eval punk::args {
}
if {[dict exists $opt_override $type]} {
append result \n "$type [dict merge [dict get $specdict leaderspec_defaults] [dict get $opt_override $type]]"
dict set resultdict $type [dict merge [dict get $specdict leaderspec_defaults] [dict get $opt_override $type]]
} else {
append result \n "$type [dict get $specdict leaderspec_defaults]"
dict set resultdict $type [dict get $specdict leaderspec_defaults]
}
}
}
@ -1908,8 +1944,10 @@ tcl::namespace::eval punk::args {
set argspec [dict remove $argspec -ARGTYPE]
if {[dict exists $opt_override $m]} {
append result \n "$m [dict merge $argspec [dict get $opt_override $m]]"
dict set resultdict $m [dict merge $argspec [dict get $opt_override $m]]
} else {
append result \n "$m $argspec"
dict set resultdict $m $argspec
}
}
}
@ -1918,9 +1956,11 @@ tcl::namespace::eval punk::args {
default {
}
}
}
if {$opt_return eq "text"} {
return $result
} else {
return $resultdict
}
}
}

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

@ -713,9 +713,20 @@ namespace eval punk::path {
}
#todo - account for vfs where matched path could appear to be a directory but is mounted so could be a desired match?
set dirfiles [lsort [glob -nocomplain -dir $opt_dir -type f {*}$tailglobs]]
if {[catch {glob -nocomplain -dir $opt_dir -type f {*}$tailglobs} matches]} {
#we can get for example a permissions error
puts stderr "treefilenames error while listing files in dir $opt_dir\n $matches"
set dirfiles [list]
} else {
set dirfiles [lsort $matches]
}
lappend files {*}$dirfiles
set dirdirs [glob -nocomplain -dir $opt_dir -type d *]
if {[catch {glob -nocomplain -dir $opt_dir -type d *} dirdirs]} {
puts stderr "treefilenames error while listing subdirs in dir $opt_dir\n $dirdirs"
set dirdirs [list]
}
foreach dir $dirdirs {
set skip 0
foreach anti $opt_antiglob_paths {

31
src/bootsupport/modules/textblock-0.1.3.tm

@ -5974,13 +5974,40 @@ tcl::namespace::eval textblock {
[>punk . rhs]\
[punk::lib::list_as_lines -- [lrepeat 8 " | "]]
}
punk::args::define [punk::lib::tstr -return string {
@id -id ::textblock::table
@cmd -name "textblock::table" -help\
"A wrapper for creating a textblock::class::table
NOTE: more options available - argument definition
is incomplete"
@opts
-return -choices {table tableobject}
-rows -type list -default "" -help\
"A list of lists.
Each toplevel element represents a row.
The number of elements in each row must
be the same.
e.g for 2 rows and 3 columns:
table -rows {{r0c0 r0c1 r0c2} {r1c0 r1c1 r1c2}}
"
-headers -type list -default "" -help\
"This is a simplified form where each column
has a single header row.
Each element in this list goes into the top
header row for a column.
More complex header arrangements where each
column has multiple headers can be made
by using -return tableobject and calling
$tableobj configure_column <idx> -headers"
}]
proc table {args} {
#todo - use punk::args
upvar ::textblock::class::opts_table_defaults toptdefaults
set defaults [tcl::dict::create\
-rows [list]\
-headers [list]\
-return string\
-return table\
]
@ -6017,7 +6044,7 @@ tcl::namespace::eval textblock {
if {$opt_return eq "string"} {
if {$opt_return eq "table"} {
set result [$t print]
$t destroy
return $result

5566
src/bootsupport/modules/tomlish-1.1.2.tm

File diff suppressed because it is too large Load Diff

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

@ -331,26 +331,26 @@ tcl::namespace::eval punk::args {
parsing and help display.
directives include:
%B%@id%N% ?opt val...?
options: -id <str>
spec-options: -id <str>
%B%@cmd%N% ?opt val...?
options: -name <str> -help <str>
spec-options: -name <str> -help <str>
%B%@leaders%N% ?opt val...?
options: -min <int> -max <int>
spec-options: -min <int> -max <int>
(used for leading args that come before switches/opts)
%B%@opts%N% ?opt val...?
options: -any <bool>
spec-options: -any <bool>
%B%@values%N% ?opt val...?
options: -min <int> -max <int>
spec-options: -min <int> -max <int>
(used for trailing args that come after switches/opts)
%B%@argdisplay%N% ?opt val...?
options: -header <str> (text for header row of table)
spec-options: -header <str> (text for header row of table)
-body <str> (text to replace autogenerated arg info)
%B%@doc%N% ?opt val...?
options: -name <str> -url <str>
spec-options: -name <str> -url <str>
%B%@seealso%N% ?opt val...?
options: -name <str> -url <str> (for footer - unimplemented)
spec-options: -name <str> -url <str> (for footer - unimplemented)
Some other options normally present on custom arguments are available
Some other spec-options normally present on custom arguments are available
to use with the @leaders @opts @values directives to set defaults
for subsequent lines that represent your custom arguments.
These directives should occur in exactly this order - but can be
@ -361,7 +361,12 @@ tcl::namespace::eval punk::args {
or using the i <cmd>.. function - an @id with -id <value> is needed.
All directives can be omitted, in which case every line represents
a custom value or option.
a custom leader, value or option.
All will be leaders by default if no options defined.
If options are defined (by naming with leading dash, or explicitly
specifying @opts) then the definitions prior to the options will be
categorised as leaders, and those following the options will be
categorised as values.
Custom arguments are defined by using any word at the start of a
line that doesn't begin with @ or -
@ -369,7 +374,7 @@ tcl::namespace::eval punk::args {
that @@somearg becomes an argument named @somearg)
custom leading args, switches/options (names starting with -)
and trailing values also take options:
and trailing values also take spec-options:
-type <typename>
defaults to string. If no other restrictions
@ -397,12 +402,22 @@ tcl::namespace::eval punk::args {
-optional <boolean>
(defaults to true for flags/switches false otherwise)
For non flag/switch arguments - all arguments with
-optional true must sit consecutively within their group.
ie all optional leader arguments must be together, and all
optional value arguments must be together. Furthermore,
specifying both optional leaders and optional values will
often lead to ambiguous parsing results. Currently, all
optional non-flg/switch arguments should be either at the
trailing end of leaders or the trailing end of values.
Further unambiguous arrangements of optional args may be
made in future - but are currently considered 'unsupported'
-default <value>
-multiple <bool> (for leaders & values defines whether
subsequent received values are stored agains the same
argument name - only applies to final leader or value)
subsequent received values are stored against the same
argument name - only applies to final leader OR final value)
(for options/flags this allows the opt-val pair or solo
flag to appear multiple times - no necessarily contiguously)
flag to appear multiple times - not necessarily contiguously)
-choices {<choicelist>}
A list of allowable values for an argument.
The -default value doesn't have to be in the list.
@ -438,7 +453,7 @@ tcl::namespace::eval punk::args {
Max of -1 represents no upper limit.
If <range> allows more than one choice the value is a list
consisting of items in the choices made available through
entries in -choices/-choicegrups.
entries in -choices/-choicegroups.
-minsize (type dependant)
-maxsize (type dependant)
-range (type dependant)
@ -1667,6 +1682,7 @@ tcl::namespace::eval punk::args {
"
@leaders -min 0 -max 0
@opts
-return -default text -choices {text dict}
-form -default 0 -help\
"Ordinal index or name of command form"
@ -1694,7 +1710,7 @@ tcl::namespace::eval punk::args {
(directives are lines beginning with
@ e.g @id, @cmd etc)
if -type is @leaders,@opts or @values matches from that type
if -type is leaders,opts or values matches from that type
will be returned.
if -type is another directive such as @id, @doc etc the
@ -1706,7 +1722,9 @@ tcl::namespace::eval punk::args {
proc resolved_def {args} {
#not eating our own dogfood here as far as argument parsing. -id ::punk::args::resolved_def is for documentation/errors only.
set opts [dict create\
-return text\
-types {}\
-form 0\
-antiglobs {}\
@ -1743,7 +1761,7 @@ tcl::namespace::eval punk::args {
}
dict for {k v} $opts {
switch -- $k {
-form - -types - -antiglobs - -override {}
-return - -form - -types - -antiglobs - -override {}
default {
punk::args::parse $args withid ::punk::args::resolved_def
return
@ -1764,10 +1782,11 @@ tcl::namespace::eval punk::args {
variable id_cache_rawdef
set realid [real_id $id]
if {$realid eq ""} {
return
}
if {$realid ne ""} {
set deflist [tcl::dict::get $id_cache_rawdef $realid]
set result ""
set specdict [uplevel 1 [list ::punk::args::resolve {*}$deflist]]
set opt_form [dict get $opts -form]
@ -1777,6 +1796,7 @@ tcl::namespace::eval punk::args {
set formname $opt_form
}
set opt_override [dict get $opts -override]
set opt_return [dict get $opts -return]
#set arg_info [dict get $specdict ARG_INFO]
set arg_info [dict get $specdict FORMS $formname ARG_INFO]
@ -1811,14 +1831,18 @@ tcl::namespace::eval punk::args {
set globbed [lsort -unique $globbed]
set included_args [punk::args::system::punklib_ldiff $globbed $suppressed_args]
set result ""
set resultdict [dict create]
foreach type $typelist {
switch -exact -- $type {
* {
if {"@id" in $included_directives} {
if {[dict exists $opt_override @id]} {
append result \n "@id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]"
dict set resultdict @id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]
} else {
append result \n "@id -id [dict get $specdict id]"
dict set resultdict @id [list -id [dict get $specdict id]]
}
}
foreach directive {@package @cmd @doc @seealso @argdisplay} {
@ -1826,8 +1850,10 @@ tcl::namespace::eval punk::args {
if {"$directive" in $included_directives} {
if {[dict exists $opt_override $directive]} {
append result \n "$directive [dict merge [dict get $specdict ${dshort}_info] [dict get $opt_override $directive]]"
dict set resultdict $directive [dict merge [dict get $specdict ${dshort}_info] [dict get $opt_override $directive]]
} else {
append result \n "$directive [dict get $specdict ${dshort}_info]"
dict set resultdict $directive [dict get $specdict ${dshort}_info]
}
}
}
@ -1843,8 +1869,10 @@ tcl::namespace::eval punk::args {
if {"$directive" in $included_directives} {
if {[dict exists $opt_override "$directive"]} {
append result \n "$directive [dict merge [dict get $specdict $defaults_key] [dict get $opt_override $directive]]"
dict set resultdict $directive [dict merge [dict get $specdict $defaults_key] [dict get $opt_override $directive]]
} else {
append result \n "$directive [dict get $specdict $defaults_key]"
dict set resultdict $directive [dict get $specdict $defaults_key]
}
}
@ -1855,8 +1883,10 @@ tcl::namespace::eval punk::args {
set argspec [dict remove $argspec -ARGTYPE]
if {[dict exists $opt_override $m]} {
append result \n "$m [dict merge $argspec [dict get $opt_override $m]]"
dict set resultdict $m [dict merge $argspec [dict get $opt_override $m]]
} else {
append result \n "$m $argspec"
dict set resultdict $m $argspec
}
}
}
@ -1869,8 +1899,10 @@ tcl::namespace::eval punk::args {
#only a single id record can exist
if {[dict exists $opt_override @id]} {
append result \n "@id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]"
dict set resultdict @id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]
} else {
append result \n "@id -id [dict get $specdict id]"
dict set resultdict @id [list -id [dict get $specdict id]]
}
}
}
@ -1879,8 +1911,10 @@ tcl::namespace::eval punk::args {
set tp [string range $type 1 end] ;# @package -> package
if {[dict exists $opt_override $type]} {
append result \n "$type [dict merge [dict get $specdict ${tp}_info] [dict get $opt_override $type]]"
dict set resultdict $type [dict merge [dict get $specdict ${tp}_info] [dict get $opt_override $type]]
} else {
append result \n "$type [dict get $specdict ${tp}_info]"
dict set resultdict $type [dict get $specdict ${tp}_info]
}
}
}
@ -1894,8 +1928,10 @@ tcl::namespace::eval punk::args {
}
if {[dict exists $opt_override $type]} {
append result \n "$type [dict merge [dict get $specdict leaderspec_defaults] [dict get $opt_override $type]]"
dict set resultdict $type [dict merge [dict get $specdict leaderspec_defaults] [dict get $opt_override $type]]
} else {
append result \n "$type [dict get $specdict leaderspec_defaults]"
dict set resultdict $type [dict get $specdict leaderspec_defaults]
}
}
}
@ -1908,8 +1944,10 @@ tcl::namespace::eval punk::args {
set argspec [dict remove $argspec -ARGTYPE]
if {[dict exists $opt_override $m]} {
append result \n "$m [dict merge $argspec [dict get $opt_override $m]]"
dict set resultdict $m [dict merge $argspec [dict get $opt_override $m]]
} else {
append result \n "$m $argspec"
dict set resultdict $m $argspec
}
}
}
@ -1918,9 +1956,11 @@ tcl::namespace::eval punk::args {
default {
}
}
}
if {$opt_return eq "text"} {
return $result
} else {
return $resultdict
}
}
}

1274
src/modules/punk/imap4-999999.0a1.0.tm

File diff suppressed because it is too large Load Diff

1228
src/modules/punk/netbox-999999.0a1.0.tm

File diff suppressed because it is too large Load Diff

3
src/modules/punk/netbox-buildversion.txt

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

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

@ -713,9 +713,20 @@ namespace eval punk::path {
}
#todo - account for vfs where matched path could appear to be a directory but is mounted so could be a desired match?
set dirfiles [lsort [glob -nocomplain -dir $opt_dir -type f {*}$tailglobs]]
if {[catch {glob -nocomplain -dir $opt_dir -type f {*}$tailglobs} matches]} {
#we can get for example a permissions error
puts stderr "treefilenames error while listing files in dir $opt_dir\n $matches"
set dirfiles [list]
} else {
set dirfiles [lsort $matches]
}
lappend files {*}$dirfiles
set dirdirs [glob -nocomplain -dir $opt_dir -type d *]
if {[catch {glob -nocomplain -dir $opt_dir -type d *} dirdirs]} {
puts stderr "treefilenames error while listing subdirs in dir $opt_dir\n $dirdirs"
set dirdirs [list]
}
foreach dir $dirdirs {
set skip 0
foreach anti $opt_antiglob_paths {

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

@ -5974,13 +5974,40 @@ tcl::namespace::eval textblock {
[>punk . rhs]\
[punk::lib::list_as_lines -- [lrepeat 8 " | "]]
}
punk::args::define [punk::lib::tstr -return string {
@id -id ::textblock::table
@cmd -name "textblock::table" -help\
"A wrapper for creating a textblock::class::table
NOTE: more options available - argument definition
is incomplete"
@opts
-return -choices {table tableobject}
-rows -type list -default "" -help\
"A list of lists.
Each toplevel element represents a row.
The number of elements in each row must
be the same.
e.g for 2 rows and 3 columns:
table -rows {{r0c0 r0c1 r0c2} {r1c0 r1c1 r1c2}}
"
-headers -type list -default "" -help\
"This is a simplified form where each column
has a single header row.
Each element in this list goes into the top
header row for a column.
More complex header arrangements where each
column has multiple headers can be made
by using -return tableobject and calling
$tableobj configure_column <idx> -headers"
}]
proc table {args} {
#todo - use punk::args
upvar ::textblock::class::opts_table_defaults toptdefaults
set defaults [tcl::dict::create\
-rows [list]\
-headers [list]\
-return string\
-return table\
]
@ -6017,7 +6044,7 @@ tcl::namespace::eval textblock {
if {$opt_return eq "string"} {
if {$opt_return eq "table"} {
set result [$t print]
$t destroy
return $result

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

@ -331,26 +331,26 @@ tcl::namespace::eval punk::args {
parsing and help display.
directives include:
%B%@id%N% ?opt val...?
options: -id <str>
spec-options: -id <str>
%B%@cmd%N% ?opt val...?
options: -name <str> -help <str>
spec-options: -name <str> -help <str>
%B%@leaders%N% ?opt val...?
options: -min <int> -max <int>
spec-options: -min <int> -max <int>
(used for leading args that come before switches/opts)
%B%@opts%N% ?opt val...?
options: -any <bool>
spec-options: -any <bool>
%B%@values%N% ?opt val...?
options: -min <int> -max <int>
spec-options: -min <int> -max <int>
(used for trailing args that come after switches/opts)
%B%@argdisplay%N% ?opt val...?
options: -header <str> (text for header row of table)
spec-options: -header <str> (text for header row of table)
-body <str> (text to replace autogenerated arg info)
%B%@doc%N% ?opt val...?
options: -name <str> -url <str>
spec-options: -name <str> -url <str>
%B%@seealso%N% ?opt val...?
options: -name <str> -url <str> (for footer - unimplemented)
spec-options: -name <str> -url <str> (for footer - unimplemented)
Some other options normally present on custom arguments are available
Some other spec-options normally present on custom arguments are available
to use with the @leaders @opts @values directives to set defaults
for subsequent lines that represent your custom arguments.
These directives should occur in exactly this order - but can be
@ -361,7 +361,12 @@ tcl::namespace::eval punk::args {
or using the i <cmd>.. function - an @id with -id <value> is needed.
All directives can be omitted, in which case every line represents
a custom value or option.
a custom leader, value or option.
All will be leaders by default if no options defined.
If options are defined (by naming with leading dash, or explicitly
specifying @opts) then the definitions prior to the options will be
categorised as leaders, and those following the options will be
categorised as values.
Custom arguments are defined by using any word at the start of a
line that doesn't begin with @ or -
@ -369,7 +374,7 @@ tcl::namespace::eval punk::args {
that @@somearg becomes an argument named @somearg)
custom leading args, switches/options (names starting with -)
and trailing values also take options:
and trailing values also take spec-options:
-type <typename>
defaults to string. If no other restrictions
@ -397,12 +402,22 @@ tcl::namespace::eval punk::args {
-optional <boolean>
(defaults to true for flags/switches false otherwise)
For non flag/switch arguments - all arguments with
-optional true must sit consecutively within their group.
ie all optional leader arguments must be together, and all
optional value arguments must be together. Furthermore,
specifying both optional leaders and optional values will
often lead to ambiguous parsing results. Currently, all
optional non-flg/switch arguments should be either at the
trailing end of leaders or the trailing end of values.
Further unambiguous arrangements of optional args may be
made in future - but are currently considered 'unsupported'
-default <value>
-multiple <bool> (for leaders & values defines whether
subsequent received values are stored agains the same
argument name - only applies to final leader or value)
subsequent received values are stored against the same
argument name - only applies to final leader OR final value)
(for options/flags this allows the opt-val pair or solo
flag to appear multiple times - no necessarily contiguously)
flag to appear multiple times - not necessarily contiguously)
-choices {<choicelist>}
A list of allowable values for an argument.
The -default value doesn't have to be in the list.
@ -438,7 +453,7 @@ tcl::namespace::eval punk::args {
Max of -1 represents no upper limit.
If <range> allows more than one choice the value is a list
consisting of items in the choices made available through
entries in -choices/-choicegrups.
entries in -choices/-choicegroups.
-minsize (type dependant)
-maxsize (type dependant)
-range (type dependant)
@ -1667,6 +1682,7 @@ tcl::namespace::eval punk::args {
"
@leaders -min 0 -max 0
@opts
-return -default text -choices {text dict}
-form -default 0 -help\
"Ordinal index or name of command form"
@ -1694,7 +1710,7 @@ tcl::namespace::eval punk::args {
(directives are lines beginning with
@ e.g @id, @cmd etc)
if -type is @leaders,@opts or @values matches from that type
if -type is leaders,opts or values matches from that type
will be returned.
if -type is another directive such as @id, @doc etc the
@ -1706,7 +1722,9 @@ tcl::namespace::eval punk::args {
proc resolved_def {args} {
#not eating our own dogfood here as far as argument parsing. -id ::punk::args::resolved_def is for documentation/errors only.
set opts [dict create\
-return text\
-types {}\
-form 0\
-antiglobs {}\
@ -1743,7 +1761,7 @@ tcl::namespace::eval punk::args {
}
dict for {k v} $opts {
switch -- $k {
-form - -types - -antiglobs - -override {}
-return - -form - -types - -antiglobs - -override {}
default {
punk::args::parse $args withid ::punk::args::resolved_def
return
@ -1764,10 +1782,11 @@ tcl::namespace::eval punk::args {
variable id_cache_rawdef
set realid [real_id $id]
if {$realid eq ""} {
return
}
if {$realid ne ""} {
set deflist [tcl::dict::get $id_cache_rawdef $realid]
set result ""
set specdict [uplevel 1 [list ::punk::args::resolve {*}$deflist]]
set opt_form [dict get $opts -form]
@ -1777,6 +1796,7 @@ tcl::namespace::eval punk::args {
set formname $opt_form
}
set opt_override [dict get $opts -override]
set opt_return [dict get $opts -return]
#set arg_info [dict get $specdict ARG_INFO]
set arg_info [dict get $specdict FORMS $formname ARG_INFO]
@ -1811,14 +1831,18 @@ tcl::namespace::eval punk::args {
set globbed [lsort -unique $globbed]
set included_args [punk::args::system::punklib_ldiff $globbed $suppressed_args]
set result ""
set resultdict [dict create]
foreach type $typelist {
switch -exact -- $type {
* {
if {"@id" in $included_directives} {
if {[dict exists $opt_override @id]} {
append result \n "@id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]"
dict set resultdict @id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]
} else {
append result \n "@id -id [dict get $specdict id]"
dict set resultdict @id [list -id [dict get $specdict id]]
}
}
foreach directive {@package @cmd @doc @seealso @argdisplay} {
@ -1826,8 +1850,10 @@ tcl::namespace::eval punk::args {
if {"$directive" in $included_directives} {
if {[dict exists $opt_override $directive]} {
append result \n "$directive [dict merge [dict get $specdict ${dshort}_info] [dict get $opt_override $directive]]"
dict set resultdict $directive [dict merge [dict get $specdict ${dshort}_info] [dict get $opt_override $directive]]
} else {
append result \n "$directive [dict get $specdict ${dshort}_info]"
dict set resultdict $directive [dict get $specdict ${dshort}_info]
}
}
}
@ -1843,8 +1869,10 @@ tcl::namespace::eval punk::args {
if {"$directive" in $included_directives} {
if {[dict exists $opt_override "$directive"]} {
append result \n "$directive [dict merge [dict get $specdict $defaults_key] [dict get $opt_override $directive]]"
dict set resultdict $directive [dict merge [dict get $specdict $defaults_key] [dict get $opt_override $directive]]
} else {
append result \n "$directive [dict get $specdict $defaults_key]"
dict set resultdict $directive [dict get $specdict $defaults_key]
}
}
@ -1855,8 +1883,10 @@ tcl::namespace::eval punk::args {
set argspec [dict remove $argspec -ARGTYPE]
if {[dict exists $opt_override $m]} {
append result \n "$m [dict merge $argspec [dict get $opt_override $m]]"
dict set resultdict $m [dict merge $argspec [dict get $opt_override $m]]
} else {
append result \n "$m $argspec"
dict set resultdict $m $argspec
}
}
}
@ -1869,8 +1899,10 @@ tcl::namespace::eval punk::args {
#only a single id record can exist
if {[dict exists $opt_override @id]} {
append result \n "@id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]"
dict set resultdict @id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]
} else {
append result \n "@id -id [dict get $specdict id]"
dict set resultdict @id [list -id [dict get $specdict id]]
}
}
}
@ -1879,8 +1911,10 @@ tcl::namespace::eval punk::args {
set tp [string range $type 1 end] ;# @package -> package
if {[dict exists $opt_override $type]} {
append result \n "$type [dict merge [dict get $specdict ${tp}_info] [dict get $opt_override $type]]"
dict set resultdict $type [dict merge [dict get $specdict ${tp}_info] [dict get $opt_override $type]]
} else {
append result \n "$type [dict get $specdict ${tp}_info]"
dict set resultdict $type [dict get $specdict ${tp}_info]
}
}
}
@ -1894,8 +1928,10 @@ tcl::namespace::eval punk::args {
}
if {[dict exists $opt_override $type]} {
append result \n "$type [dict merge [dict get $specdict leaderspec_defaults] [dict get $opt_override $type]]"
dict set resultdict $type [dict merge [dict get $specdict leaderspec_defaults] [dict get $opt_override $type]]
} else {
append result \n "$type [dict get $specdict leaderspec_defaults]"
dict set resultdict $type [dict get $specdict leaderspec_defaults]
}
}
}
@ -1908,8 +1944,10 @@ tcl::namespace::eval punk::args {
set argspec [dict remove $argspec -ARGTYPE]
if {[dict exists $opt_override $m]} {
append result \n "$m [dict merge $argspec [dict get $opt_override $m]]"
dict set resultdict $m [dict merge $argspec [dict get $opt_override $m]]
} else {
append result \n "$m $argspec"
dict set resultdict $m $argspec
}
}
}
@ -1918,9 +1956,11 @@ tcl::namespace::eval punk::args {
default {
}
}
}
if {$opt_return eq "text"} {
return $result
} else {
return $resultdict
}
}
}

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

@ -713,9 +713,20 @@ namespace eval punk::path {
}
#todo - account for vfs where matched path could appear to be a directory but is mounted so could be a desired match?
set dirfiles [lsort [glob -nocomplain -dir $opt_dir -type f {*}$tailglobs]]
if {[catch {glob -nocomplain -dir $opt_dir -type f {*}$tailglobs} matches]} {
#we can get for example a permissions error
puts stderr "treefilenames error while listing files in dir $opt_dir\n $matches"
set dirfiles [list]
} else {
set dirfiles [lsort $matches]
}
lappend files {*}$dirfiles
set dirdirs [glob -nocomplain -dir $opt_dir -type d *]
if {[catch {glob -nocomplain -dir $opt_dir -type d *} dirdirs]} {
puts stderr "treefilenames error while listing subdirs in dir $opt_dir\n $dirdirs"
set dirdirs [list]
}
foreach dir $dirdirs {
set skip 0
foreach anti $opt_antiglob_paths {

31
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/textblock-0.1.3.tm

@ -5974,13 +5974,40 @@ tcl::namespace::eval textblock {
[>punk . rhs]\
[punk::lib::list_as_lines -- [lrepeat 8 " | "]]
}
punk::args::define [punk::lib::tstr -return string {
@id -id ::textblock::table
@cmd -name "textblock::table" -help\
"A wrapper for creating a textblock::class::table
NOTE: more options available - argument definition
is incomplete"
@opts
-return -choices {table tableobject}
-rows -type list -default "" -help\
"A list of lists.
Each toplevel element represents a row.
The number of elements in each row must
be the same.
e.g for 2 rows and 3 columns:
table -rows {{r0c0 r0c1 r0c2} {r1c0 r1c1 r1c2}}
"
-headers -type list -default "" -help\
"This is a simplified form where each column
has a single header row.
Each element in this list goes into the top
header row for a column.
More complex header arrangements where each
column has multiple headers can be made
by using -return tableobject and calling
$tableobj configure_column <idx> -headers"
}]
proc table {args} {
#todo - use punk::args
upvar ::textblock::class::opts_table_defaults toptdefaults
set defaults [tcl::dict::create\
-rows [list]\
-headers [list]\
-return string\
-return table\
]
@ -6017,7 +6044,7 @@ tcl::namespace::eval textblock {
if {$opt_return eq "string"} {
if {$opt_return eq "table"} {
set result [$t print]
$t destroy
return $result

5566
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/tomlish-1.1.2.tm

File diff suppressed because it is too large Load Diff

82
src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/args-0.1.0.tm

@ -331,26 +331,26 @@ tcl::namespace::eval punk::args {
parsing and help display.
directives include:
%B%@id%N% ?opt val...?
options: -id <str>
spec-options: -id <str>
%B%@cmd%N% ?opt val...?
options: -name <str> -help <str>
spec-options: -name <str> -help <str>
%B%@leaders%N% ?opt val...?
options: -min <int> -max <int>
spec-options: -min <int> -max <int>
(used for leading args that come before switches/opts)
%B%@opts%N% ?opt val...?
options: -any <bool>
spec-options: -any <bool>
%B%@values%N% ?opt val...?
options: -min <int> -max <int>
spec-options: -min <int> -max <int>
(used for trailing args that come after switches/opts)
%B%@argdisplay%N% ?opt val...?
options: -header <str> (text for header row of table)
spec-options: -header <str> (text for header row of table)
-body <str> (text to replace autogenerated arg info)
%B%@doc%N% ?opt val...?
options: -name <str> -url <str>
spec-options: -name <str> -url <str>
%B%@seealso%N% ?opt val...?
options: -name <str> -url <str> (for footer - unimplemented)
spec-options: -name <str> -url <str> (for footer - unimplemented)
Some other options normally present on custom arguments are available
Some other spec-options normally present on custom arguments are available
to use with the @leaders @opts @values directives to set defaults
for subsequent lines that represent your custom arguments.
These directives should occur in exactly this order - but can be
@ -361,7 +361,12 @@ tcl::namespace::eval punk::args {
or using the i <cmd>.. function - an @id with -id <value> is needed.
All directives can be omitted, in which case every line represents
a custom value or option.
a custom leader, value or option.
All will be leaders by default if no options defined.
If options are defined (by naming with leading dash, or explicitly
specifying @opts) then the definitions prior to the options will be
categorised as leaders, and those following the options will be
categorised as values.
Custom arguments are defined by using any word at the start of a
line that doesn't begin with @ or -
@ -369,7 +374,7 @@ tcl::namespace::eval punk::args {
that @@somearg becomes an argument named @somearg)
custom leading args, switches/options (names starting with -)
and trailing values also take options:
and trailing values also take spec-options:
-type <typename>
defaults to string. If no other restrictions
@ -397,12 +402,22 @@ tcl::namespace::eval punk::args {
-optional <boolean>
(defaults to true for flags/switches false otherwise)
For non flag/switch arguments - all arguments with
-optional true must sit consecutively within their group.
ie all optional leader arguments must be together, and all
optional value arguments must be together. Furthermore,
specifying both optional leaders and optional values will
often lead to ambiguous parsing results. Currently, all
optional non-flg/switch arguments should be either at the
trailing end of leaders or the trailing end of values.
Further unambiguous arrangements of optional args may be
made in future - but are currently considered 'unsupported'
-default <value>
-multiple <bool> (for leaders & values defines whether
subsequent received values are stored agains the same
argument name - only applies to final leader or value)
subsequent received values are stored against the same
argument name - only applies to final leader OR final value)
(for options/flags this allows the opt-val pair or solo
flag to appear multiple times - no necessarily contiguously)
flag to appear multiple times - not necessarily contiguously)
-choices {<choicelist>}
A list of allowable values for an argument.
The -default value doesn't have to be in the list.
@ -438,7 +453,7 @@ tcl::namespace::eval punk::args {
Max of -1 represents no upper limit.
If <range> allows more than one choice the value is a list
consisting of items in the choices made available through
entries in -choices/-choicegrups.
entries in -choices/-choicegroups.
-minsize (type dependant)
-maxsize (type dependant)
-range (type dependant)
@ -1667,6 +1682,7 @@ tcl::namespace::eval punk::args {
"
@leaders -min 0 -max 0
@opts
-return -default text -choices {text dict}
-form -default 0 -help\
"Ordinal index or name of command form"
@ -1694,7 +1710,7 @@ tcl::namespace::eval punk::args {
(directives are lines beginning with
@ e.g @id, @cmd etc)
if -type is @leaders,@opts or @values matches from that type
if -type is leaders,opts or values matches from that type
will be returned.
if -type is another directive such as @id, @doc etc the
@ -1706,7 +1722,9 @@ tcl::namespace::eval punk::args {
proc resolved_def {args} {
#not eating our own dogfood here as far as argument parsing. -id ::punk::args::resolved_def is for documentation/errors only.
set opts [dict create\
-return text\
-types {}\
-form 0\
-antiglobs {}\
@ -1743,7 +1761,7 @@ tcl::namespace::eval punk::args {
}
dict for {k v} $opts {
switch -- $k {
-form - -types - -antiglobs - -override {}
-return - -form - -types - -antiglobs - -override {}
default {
punk::args::parse $args withid ::punk::args::resolved_def
return
@ -1764,10 +1782,11 @@ tcl::namespace::eval punk::args {
variable id_cache_rawdef
set realid [real_id $id]
if {$realid eq ""} {
return
}
if {$realid ne ""} {
set deflist [tcl::dict::get $id_cache_rawdef $realid]
set result ""
set specdict [uplevel 1 [list ::punk::args::resolve {*}$deflist]]
set opt_form [dict get $opts -form]
@ -1777,6 +1796,7 @@ tcl::namespace::eval punk::args {
set formname $opt_form
}
set opt_override [dict get $opts -override]
set opt_return [dict get $opts -return]
#set arg_info [dict get $specdict ARG_INFO]
set arg_info [dict get $specdict FORMS $formname ARG_INFO]
@ -1811,14 +1831,18 @@ tcl::namespace::eval punk::args {
set globbed [lsort -unique $globbed]
set included_args [punk::args::system::punklib_ldiff $globbed $suppressed_args]
set result ""
set resultdict [dict create]
foreach type $typelist {
switch -exact -- $type {
* {
if {"@id" in $included_directives} {
if {[dict exists $opt_override @id]} {
append result \n "@id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]"
dict set resultdict @id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]
} else {
append result \n "@id -id [dict get $specdict id]"
dict set resultdict @id [list -id [dict get $specdict id]]
}
}
foreach directive {@package @cmd @doc @seealso @argdisplay} {
@ -1826,8 +1850,10 @@ tcl::namespace::eval punk::args {
if {"$directive" in $included_directives} {
if {[dict exists $opt_override $directive]} {
append result \n "$directive [dict merge [dict get $specdict ${dshort}_info] [dict get $opt_override $directive]]"
dict set resultdict $directive [dict merge [dict get $specdict ${dshort}_info] [dict get $opt_override $directive]]
} else {
append result \n "$directive [dict get $specdict ${dshort}_info]"
dict set resultdict $directive [dict get $specdict ${dshort}_info]
}
}
}
@ -1843,8 +1869,10 @@ tcl::namespace::eval punk::args {
if {"$directive" in $included_directives} {
if {[dict exists $opt_override "$directive"]} {
append result \n "$directive [dict merge [dict get $specdict $defaults_key] [dict get $opt_override $directive]]"
dict set resultdict $directive [dict merge [dict get $specdict $defaults_key] [dict get $opt_override $directive]]
} else {
append result \n "$directive [dict get $specdict $defaults_key]"
dict set resultdict $directive [dict get $specdict $defaults_key]
}
}
@ -1855,8 +1883,10 @@ tcl::namespace::eval punk::args {
set argspec [dict remove $argspec -ARGTYPE]
if {[dict exists $opt_override $m]} {
append result \n "$m [dict merge $argspec [dict get $opt_override $m]]"
dict set resultdict $m [dict merge $argspec [dict get $opt_override $m]]
} else {
append result \n "$m $argspec"
dict set resultdict $m $argspec
}
}
}
@ -1869,8 +1899,10 @@ tcl::namespace::eval punk::args {
#only a single id record can exist
if {[dict exists $opt_override @id]} {
append result \n "@id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]"
dict set resultdict @id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]
} else {
append result \n "@id -id [dict get $specdict id]"
dict set resultdict @id [list -id [dict get $specdict id]]
}
}
}
@ -1879,8 +1911,10 @@ tcl::namespace::eval punk::args {
set tp [string range $type 1 end] ;# @package -> package
if {[dict exists $opt_override $type]} {
append result \n "$type [dict merge [dict get $specdict ${tp}_info] [dict get $opt_override $type]]"
dict set resultdict $type [dict merge [dict get $specdict ${tp}_info] [dict get $opt_override $type]]
} else {
append result \n "$type [dict get $specdict ${tp}_info]"
dict set resultdict $type [dict get $specdict ${tp}_info]
}
}
}
@ -1894,8 +1928,10 @@ tcl::namespace::eval punk::args {
}
if {[dict exists $opt_override $type]} {
append result \n "$type [dict merge [dict get $specdict leaderspec_defaults] [dict get $opt_override $type]]"
dict set resultdict $type [dict merge [dict get $specdict leaderspec_defaults] [dict get $opt_override $type]]
} else {
append result \n "$type [dict get $specdict leaderspec_defaults]"
dict set resultdict $type [dict get $specdict leaderspec_defaults]
}
}
}
@ -1908,8 +1944,10 @@ tcl::namespace::eval punk::args {
set argspec [dict remove $argspec -ARGTYPE]
if {[dict exists $opt_override $m]} {
append result \n "$m [dict merge $argspec [dict get $opt_override $m]]"
dict set resultdict $m [dict merge $argspec [dict get $opt_override $m]]
} else {
append result \n "$m $argspec"
dict set resultdict $m $argspec
}
}
}
@ -1918,9 +1956,11 @@ tcl::namespace::eval punk::args {
default {
}
}
}
if {$opt_return eq "text"} {
return $result
} else {
return $resultdict
}
}
}

15
src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/path-0.1.0.tm

@ -713,9 +713,20 @@ namespace eval punk::path {
}
#todo - account for vfs where matched path could appear to be a directory but is mounted so could be a desired match?
set dirfiles [lsort [glob -nocomplain -dir $opt_dir -type f {*}$tailglobs]]
if {[catch {glob -nocomplain -dir $opt_dir -type f {*}$tailglobs} matches]} {
#we can get for example a permissions error
puts stderr "treefilenames error while listing files in dir $opt_dir\n $matches"
set dirfiles [list]
} else {
set dirfiles [lsort $matches]
}
lappend files {*}$dirfiles
set dirdirs [glob -nocomplain -dir $opt_dir -type d *]
if {[catch {glob -nocomplain -dir $opt_dir -type d *} dirdirs]} {
puts stderr "treefilenames error while listing subdirs in dir $opt_dir\n $dirdirs"
set dirdirs [list]
}
foreach dir $dirdirs {
set skip 0
foreach anti $opt_antiglob_paths {

31
src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/textblock-0.1.3.tm

@ -5974,13 +5974,40 @@ tcl::namespace::eval textblock {
[>punk . rhs]\
[punk::lib::list_as_lines -- [lrepeat 8 " | "]]
}
punk::args::define [punk::lib::tstr -return string {
@id -id ::textblock::table
@cmd -name "textblock::table" -help\
"A wrapper for creating a textblock::class::table
NOTE: more options available - argument definition
is incomplete"
@opts
-return -choices {table tableobject}
-rows -type list -default "" -help\
"A list of lists.
Each toplevel element represents a row.
The number of elements in each row must
be the same.
e.g for 2 rows and 3 columns:
table -rows {{r0c0 r0c1 r0c2} {r1c0 r1c1 r1c2}}
"
-headers -type list -default "" -help\
"This is a simplified form where each column
has a single header row.
Each element in this list goes into the top
header row for a column.
More complex header arrangements where each
column has multiple headers can be made
by using -return tableobject and calling
$tableobj configure_column <idx> -headers"
}]
proc table {args} {
#todo - use punk::args
upvar ::textblock::class::opts_table_defaults toptdefaults
set defaults [tcl::dict::create\
-rows [list]\
-headers [list]\
-return string\
-return table\
]
@ -6017,7 +6044,7 @@ tcl::namespace::eval textblock {
if {$opt_return eq "string"} {
if {$opt_return eq "table"} {
set result [$t print]
$t destroy
return $result

5566
src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/tomlish-1.1.2.tm

File diff suppressed because it is too large Load Diff

5566
src/vendormodules/tomlish-1.1.2.tm

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