|
|
|
@ -3765,11 +3765,52 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO |
|
|
|
#per-subcommand-flags reality the declaration cannot. |
|
|
|
#per-subcommand-flags reality the declaration cannot. |
|
|
|
@form -synopsis "make.tcl ?subcommand? ?flags?" |
|
|
|
@form -synopsis "make.tcl ?subcommand? ?flags?" |
|
|
|
@leaders -min 1 -max 1 |
|
|
|
@leaders -min 1 -max 1 |
|
|
|
subcommand -type string -optional 0 -choicecolumns 1 -& |
|
|
|
subcommand -type string -optional 0 -choicecolumns 2 -& |
|
|
|
-choicegroups {${$SUBGROUPS}} -& |
|
|
|
-choicegroups {${$SUBGROUPS}} -& |
|
|
|
-choicelabels {${$SUMMARIES}} -& |
|
|
|
-choicelabels {${$SUMMARIES}} -& |
|
|
|
-help "Use 'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' for details of a subcommand." |
|
|
|
-help "Use 'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' for details of a subcommand." |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#Rich top-level overview (2026-08-02, the 'i info' style): each subcommand |
|
|
|
|
|
|
|
#cell carries its one-line summary plus the auto-generated bracket-notation |
|
|
|
|
|
|
|
#synopsis line(s) of that subcommand's OWN definition (per-form lines for |
|
|
|
|
|
|
|
#the multi-form tool/buildsuite), grouped by SUBGROUPS in two columns - |
|
|
|
|
|
|
|
#the same punk::args choices-table machinery punk::ns::cmdhelp uses for |
|
|
|
|
|
|
|
#built-in ensembles. Hung on a SEPARATE id so the label cost (a synopsis |
|
|
|
|
|
|
|
#render per subcommand, a few ms total) is paid only when the top-level |
|
|
|
|
|
|
|
#help actually renders: the lean (script)::punkboot definition above stays |
|
|
|
|
|
|
|
#the dispatch surface, and overview_labels runs at lazy resolve time |
|
|
|
|
|
|
|
#(first usage of this id - deliberately NOT in the capability probe below). |
|
|
|
|
|
|
|
proc ::punkboot::argdoc::overview_labels {} { |
|
|
|
|
|
|
|
variable SUMMARIES |
|
|
|
|
|
|
|
set labels [dict create] |
|
|
|
|
|
|
|
dict for {sub summary} $SUMMARIES { |
|
|
|
|
|
|
|
set lines [list] |
|
|
|
|
|
|
|
if {![catch {punk::args::synopsis -noheader (script)::punkboot::$sub} syn]} { |
|
|
|
|
|
|
|
catch {set syn [punk::ansi::ansistrip $syn]} |
|
|
|
|
|
|
|
foreach ln [split $syn \n] { |
|
|
|
|
|
|
|
#drop '## FORM n <name>' headers - the synopsis lines are |
|
|
|
|
|
|
|
#self-describing and the cells stay compact |
|
|
|
|
|
|
|
if {[string match "## *" [string trim $ln]] || [string trim $ln] eq ""} continue |
|
|
|
|
|
|
|
lappend lines $ln |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
dict set labels $sub "# $summary\n[join $lines \n]" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return $labels |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
punk::args::define { |
|
|
|
|
|
|
|
@id -id "(script)::punkboot.overview" |
|
|
|
|
|
|
|
@cmd -name "make.tcl" -& |
|
|
|
|
|
|
|
-summary "punkshell project build tool (punk boot)" -& |
|
|
|
|
|
|
|
-help -& |
|
|
|
|
|
|
|
{${$TOPLEVEL_HELP}} |
|
|
|
|
|
|
|
@form -synopsis "make.tcl ?subcommand? ?flags?" |
|
|
|
|
|
|
|
@leaders -min 1 -max 1 |
|
|
|
|
|
|
|
subcommand -type string -optional 0 -choicecolumns 2 -& |
|
|
|
|
|
|
|
-choicegroups {${$SUBGROUPS}} -& |
|
|
|
|
|
|
|
-choicelabels {${[::punkboot::argdoc::overview_labels]}} -& |
|
|
|
|
|
|
|
-help "Use 'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' for details of a subcommand." |
|
|
|
|
|
|
|
} |
|
|
|
#capability probe: force resolution of representative definitions now, inside |
|
|
|
#capability probe: force resolution of representative definitions now, inside |
|
|
|
#the guarded block - a stale punk::args that accepted the raw text but cannot |
|
|
|
#the guarded block - a stale punk::args that accepted the raw text but cannot |
|
|
|
#resolve a mechanism used here (e.g snapshots predating -& record continuation |
|
|
|
#resolve a mechanism used here (e.g snapshots predating -& record continuation |
|
|
|
@ -3991,8 +4032,10 @@ if {$do_help} { |
|
|
|
set help_shown 0 |
|
|
|
set help_shown 0 |
|
|
|
if {$::punkboot::punkargs_ok} { |
|
|
|
if {$::punkboot::punkargs_ok} { |
|
|
|
#tabled usage via punk::args - degrade to the plain fallback help if the rendering |
|
|
|
#tabled usage via punk::args - degrade to the plain fallback help if the rendering |
|
|
|
#stack (punk::ansi/textblock etc) can't produce it |
|
|
|
#stack (punk::ansi/textblock etc) can't produce it. The bare top level renders |
|
|
|
set usage_id (script)::punkboot |
|
|
|
#the rich overview id (per-subcommand summary + synopsis cells); the lean |
|
|
|
|
|
|
|
#(script)::punkboot id remains the dispatch surface. |
|
|
|
|
|
|
|
set usage_id (script)::punkboot.overview |
|
|
|
if {$help_subject ne ""} { |
|
|
|
if {$help_subject ne ""} { |
|
|
|
set usage_id (script)::punkboot::$help_subject |
|
|
|
set usage_id (script)::punkboot::$help_subject |
|
|
|
} |
|
|
|
} |
|
|
|
|