@ -2610,13 +2610,18 @@ proc ::punkboot::punkboot_gethelp {args} {
append h " $ s c r i p t n a m e b u i l d s u i t e l i s t | i n f o | b u i l d ? < s u i t e n a m e > ? ? d r i v e r - a r g s . . . ? " \ n
append h " - l i s t t h e d e f i n e d b u i l d s u i t e s u n d e r s r c / b u i l d s u i t e s ( z i g r u n t i m e f a c t o r y ) , s h o w a s u i t e ' s c o n f i g u r e d " \ n
append h " d e t a i l ( s o u r c e s / z i g p i n / p r o d u c t s f r o m i t s s o u r c e s . c o n f i g ) , o r r u n i t s d r i v e r f o r w a r d i n g t h e a r g s " \ n \ n
append h " $ s c r i p t n a m e t o o l l i s t | i n f o | b u i l d | t e s t ? < t o o l n a m e > . . . ? ? - t e s t 0 | 1 ? " \ n
append h " $ s c r i p t n a m e t o o l l i s t ? < t o o l n a m e > . . . ? " \ n
append h " $ s c r i p t n a m e t o o l i n f o < t o o l n a m e > . . . " \ n
append h " $ s c r i p t n a m e t o o l b u i l d ? - t e s t 0 | 1 ? ? < t o o l n a m e > . . . ? " \ n
append h " $ s c r i p t n a m e t o o l t e s t ? < t o o l n a m e > . . . ? " \ n
append h " - v e n d o r e d f i r s t - p a r t y b u i l d t o o l s u n d e r s r c / t o o l s ( z i g s o u r c e ; G - 1 2 6 ) : l i s t / d e t a i l t h e m , r u n t h e i r " \ n
append h " t e s t s u i t e s , o r b u i l d ( t e s t - g a t e d ) a n d i n s t a l l t o < p r o j e c t d i r > / b i n " \ n
append h " t e s t s u i t e s , o r b u i l d ( t e s t - g a t e d ) a n d i n s t a l l t o < p r o j e c t d i r > / b i n ; o p t i o n s p r e c e d e t h e t o o l n a m e s " \ n
append h " - z i g i s O P T I O N A L : p a c k a g e s / b a k e n e v e r r e q u i r e t h i s s t e p ; w i t h o u t a s u i t a b l e t o o l c h a i n t h e s t a t e i s " \ n
append h " r e p o r t e d a n d b u i l d / t e s t e x i t n o n z e r o w i t h f e t c h g u i d a n c e ( b i n / p u n k - g e t z i g . c m d ) " \ n \ n
append h " $ s c r i p t n a m e h e l p ? s u b c o m m a n d ? " \ n
append h " - s h o w u s a g e f o r $ s c r i p t n a m e o r o n e o f i t s s u b c o m m a n d s ( e q u i v a l e n t : $ s c r i p t n a m e < s u b c o m m a n d > - h e l p ) " \ n \ n
append h " $ s c r i p t n a m e h e l p ? s u b c o m m a n d ? ? a c t i o n ? " \ n
append h " - s h o w u s a g e f o r $ s c r i p t n a m e o r o n e o f i t s s u b c o m m a n d s ( e q u i v a l e n t : $ s c r i p t n a m e < s u b c o m m a n d > - h e l p ) ; " \ n
append h " w i t h a n a c t i o n w o r d o r 0 - b a s e d f o r m i n d e x , t h a t a c t i o n ' s s i n g l e - f o r m u s a g e w h e n t h e t a b l e d h e l p " \ n
append h " i s a v a i l a b l e " \ n \ n
append h " F l a g s : " \ n
append h " - c o n f i r m 0 | 1 " \ n
append h " - i n t e r a c t i v e y / n c o n f i r m a t i o n p o l i c y ( d e f a u l t 1 : p r o m p t w h e n s t d i n i s a t e r m i n a l , a b o r t f a s t w h e n i t i s n o t ) . " \ n
@ -3234,7 +3239,11 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
help
"
Show tabled usage for make.tcl as a whole, or for a single subcommand.
Equivalent to ' make.tcl < subcommand> - help' ."
Equivalent to ' make.tcl < subcommand> - help' . For the multi-form
subcommands ( tool , buildsuite) an action word - or the 0 - based form
index the synopsis hints display - narrows to that action' s
single-form usage: ' make.tcl help tool build' , ' make.tcl help tool 2 '
and ' make.tcl tool build - help' all render the build form."
buildsuite
"
Surface for the defined buildsuites under src/ buildsuites ( zig-built
@ -3278,16 +3287,19 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
tool info < name> ...
Per-tool detail: paths, provenance records, toolchain
resolution.
tool build ? < name> ...? ? - test 0 | 1 ?
tool build ? - test 0 | 1 ? ? < name> ...?
Resolve a zig satisfying the tool' s declared floor, run the
' zig build test' gate ( default on; the gate is the EXIT CODE -
expected warnings on stderr do not fail it) , build ReleaseSafe
and install to < projectdir> / bin. Nothing is installed when the
gate or the build fails. With no name, all tools are
gate or the build fails. Options precede the tool names
( punk : : args positional model) ; with no name, all tools are
processed.
tool test ? < name> ...?
Run each tool' s ' zig build test' only.
' make.tcl help tool < action> ' shows a single action' s usage table.
Toolchain resolution: PUNK_ZIG= < path-to-zig-or-its-folder>
overrides ; otherwise < projectdir> / bin/ tools/ zig* is scanned and
the LOWEST release satisfying the floor wins ( deterministic as
@ -3404,7 +3416,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S b a k e h o u s e ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS bakehouse] } }
@ form - synopsis " m a k e . t c l b a k e h o u s e ? - k ? ? - d i r t y - a b o r t 1 | 0 ? ? - c o n f i r m 0 | 1 ? "
@ opts
$ { $OPT_FORCEKILL }
$ { $OPT_DIRTYABORT_ON }
@ -3417,7 +3428,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S p a c k a g e s ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS packages] } }
@ form - synopsis " m a k e . t c l p a c k a g e s ? - d i r t y - a b o r t ? ? - c o n f i r m 0 | 1 ? "
@ opts
$ { $OPT_DIRTYABORT }
$ { $OPT_CONFIRM }
@ -3429,7 +3439,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S m o d u l e s ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS modules] } }
@ form - synopsis " m a k e . t c l m o d u l e s ? - d i r t y - a b o r t ? ? - c o n f i r m 0 | 1 ? "
@ opts
$ { $OPT_DIRTYABORT }
$ { $OPT_CONFIRM }
@ -3441,7 +3450,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S l i b s ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS libs] } }
@ form - synopsis " m a k e . t c l l i b s ? - d i r t y - a b o r t ? ? - c o n f i r m 0 | 1 ? "
@ opts
$ { $OPT_DIRTYABORT }
$ { $OPT_CONFIRM }
@ -3453,7 +3461,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S b a k e ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS bake] } }
@ form - synopsis " m a k e . t c l b a k e ? - k ? ? - d i r t y - a b o r t ? ? - c o n f i r m 0 | 1 ? ? k i t n a m e . . . ? "
@ opts
$ { $OPT_FORCEKILL }
$ { $OPT_DIRTYABORT }
@ -3472,7 +3479,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S b a k e l i s t ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS bakelist] } }
@ form - synopsis " m a k e . t c l b a k e l i s t ? k i t n a m e . . . ? "
@ values - min 0 - max - 1
kitname - type string - optional 1 - multiple 1 $ { $KITNAME_CHOICEPART } - help - &
" C o n f i g u r e d k i t o u t p u t ( s ) t o r e p o r t o n - a k i t n a m e , o r @ < g r o u p n a m e >
@ -3486,7 +3492,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S v f s l i b s ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS vfslibs] } }
@ form - synopsis " m a k e . t c l v f s l i b s ? - d i r t y - a b o r t ? ? - c o n f i r m 0 | 1 ? "
@ opts
$ { $OPT_DIRTYABORT }
$ { $OPT_CONFIRM }
@ -3498,7 +3503,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S b i n ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS bin] } }
@ form - synopsis " m a k e . t c l b i n ? - k ? ? - d i r t y - a b o r t ? ? - c o n f i r m 0 | 1 ? "
@ opts
$ { $OPT_FORCEKILL }
$ { $OPT_DIRTYABORT }
@ -3511,7 +3515,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S v e n d o r u p d a t e ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS vendorupdate] } }
@ form - synopsis " m a k e . t c l v e n d o r u p d a t e ? - c o n f i r m 0 | 1 ? "
@ opts
$ { $OPT_CONFIRM }
@ values - min 0 - max 0
@ -3522,7 +3525,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S l i b f e t c h ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS libfetch] } }
@ form - synopsis " m a k e . t c l l i b f e t c h ? - s e r v e r u r l < u r l > ? ? - t r u s t - s e r v e r ? ? - f o r c e ? "
@ opts
$ { $OPT_SERVERURL }
$ { $OPT_TRUSTSERVER }
@ -3535,7 +3537,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S b o o t s u p p o r t ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS bootsupport] } }
@ form - synopsis " m a k e . t c l b o o t s u p p o r t ? - d i r t y - a b o r t ? ? - c o n f i r m 0 | 1 ? "
@ opts
$ { $OPT_DIRTYABORT }
$ { $OPT_CONFIRM }
@ -3547,7 +3548,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S v f s c o m m o n u p d a t e ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS vfscommonupdate] } }
@ form - synopsis " m a k e . t c l v f s c o m m o n u p d a t e ? - d i r t y - a b o r t ? ? - c o n f i r m 0 | 1 ? "
@ opts
$ { $OPT_DIRTYABORT }
$ { $OPT_CONFIRM }
@ -3559,7 +3559,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S i n f o ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS info] } }
@ form - synopsis " m a k e . t c l i n f o ? - c o n f i r m 0 | 1 ? "
@ opts
$ { $OPT_CONFIRM }
@ values - min 0 - max 0
@ -3570,7 +3569,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S c h e c k ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS check] } }
@ form - synopsis " m a k e . t c l c h e c k "
@ opts
@ values - min 0 - max 0
}
@ -3580,7 +3578,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S p r o j e c t v e r s i o n ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS projectversion] } }
@ form - synopsis " m a k e . t c l p r o j e c t v e r s i o n "
@ opts
@ values - min 0 - max 0
}
@ -3590,7 +3587,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S w o r k f l o w ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS workflow] } }
@ form - synopsis " m a k e . t c l w o r k f l o w "
@ opts
@ values - min 0 - max 0
}
@ -3602,7 +3598,6 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
" R u n t h e p u n k s h e l l ( r e p l ) u s i n g b o o t s u p p o r t l i b r a r i e s .
All arguments after the shell subcommand are passed through to the
repl untouched ( they are not parsed or validated by make.tcl) ."
@ form - synopsis " m a k e . t c l s h e l l ? a r g . . . ? "
@ values - min 0 - max - 1
arg - type any - optional 1 - multiple 1 - help - &
" A r g u m e n t s p a s s e d t h r o u g h t o t h e p u n k r e p l . "
@ -3613,11 +3608,28 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S b u i l d s u i t e ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS buildsuite] } }
@ form - synopsis " m a k e . t c l b u i l d s u i t e l i s t | i n f o | b u i l d ? < s u i t e n a m e > ? ? d r i v e r - a r g s . . . ? "
@ values - min 0 - max - 1
arg - type any - optional 1 - multiple 1 - help - &
" A c t i o n ( l i s t | i n f o | b u i l d ) , s u i t e n a m e , a n d - f o r b u i l d - d r i v e r
arguments forwarded to the suite' s suite.tcl untouched."
@ form - form { list info build}
@ form - form list
@ leaders - min 1 - max 1
action - choices { list } - choicelabels - &
{ list " D i s c o v e r t h e s u i t e s ( d i r e c t o r i e s c a r r y i n g a s u i t e . t c l d r i v e r ) w i t h t h e i r o n e - l i n e d e s c r i p t i o n s " }
@ values - min 0 - max 0
@ form - form info
@ leaders - min 1 - max 1
action - choices { info } - choicelabels - &
{ info " S h o w a s u i t e ' s c o n f i g u r e d d e t a i l : d e s c r i p t i o n , s o u r c e r e c o r d s , z i g p i n , p r o d u c t s , d o c p o i n t e r s " }
@ values - min 1 - max 1
suitename - type string - optional 0 - help - &
" S u i t e n a m e ( a d i r e c t o r y u n d e r s r c / b u i l d s u i t e s c a r r y i n g a s u i t e . t c l d r i v e r ) . "
@ form - form build
@ leaders - min 1 - max 1
action - choices { build } - choicelabels - &
{ build " R u n t h e s u i t e ' s d r i v e r ( ' s u i t e . t c l b u i l d ' ) , f o r w a r d i n g t r a i l i n g a r g s u n t o u c h e d " }
@ values - min 1 - max - 1
suitename - type string - optional 0 - help - &
" S u i t e t o b u i l d . "
driverarg - type any - optional 1 - multiple 1 - help - &
" D r i v e r a r g u m e n t s f o r w a r d e d t o s u i t e . t c l u n t o u c h e d ( e . g - t c l b r a n c h / - r e f r e s h / - s t e p s ) . "
}
punk : : args::define {
@ -3626,11 +3638,38 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S t o o l ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS tool] } }
@ form - synopsis " m a k e . t c l t o o l l i s t | i n f o | b u i l d | t e s t ? < t o o l n a m e > . . . ? ? - t e s t 0 | 1 ? "
@ form - form { list info build test}
@ form - form list
@ leaders - min 1 - max 1
action - choices { list } - choicelabels - &
{ list " D i s c o v e r t h e t o o l s w i t h v e r s i o n , z i g f l o o r , i n s t a l l s t a t e a n d v e n d o r e d c o m m i t ; r e p o r t t h e r e s o l v e d t o o l c h a i n " }
@ values - min 0 - max - 1
arg - type any - optional 1 - multiple 1 - help - &
" A c t i o n ( l i s t | i n f o | b u i l d | t e s t ) , t o o l n a m e ( s ) , a n d - f o r b u i l d -
the - test 0 | 1 gate flag. Parsed by the handler."
toolname - type string - optional 1 - multiple 1 - &
-help " V a l i d a t e d a g a i n s t t h e c o n f i g u r e d t o o l s ( l i s t r e p o r t s a l l r e g a r d l e s s ) . "
@ form - form info
@ leaders - min 1 - max 1
action - choices { info } - choicelabels - &
{ info " P e r - t o o l d e t a i l : p a t h s , p r o v e n a n c e r e c o r d s , t o o l c h a i n r e s o l u t i o n " }
@ values - min 1 - max - 1
toolname - type string - optional 0 - multiple 1 - &
-help " T o o l ( s ) t o d e s c r i b e ( d i r e c t o r y n a m e s u n d e r s r c / t o o l s ) . "
@ form - form build
@ leaders - min 1 - max 1
action - choices { build } - choicelabels - &
{ build " R e s o l v e z i g , r u n t h e t e s t g a t e , b u i l d R e l e a s e S a f e a n d i n s t a l l t o < p r o j e c t d i r > / b i n " }
@ opts
-test - type boolean - default 1 - help - &
" R u n t h e ' z i g b u i l d t e s t ' g a t e b e f o r e b u i l d i n g ( d e f a u l t 1 ) . T h e g a t e i s t h e e x i t c o d e . "
@ values - min 0 - max - 1
toolname - type string - optional 1 - multiple 1 - &
-help " T o o l ( s ) t o b u i l d ; w i t h n o n a m e , a l l t o o l s a r e p r o c e s s e d . "
@ form - form test
@ leaders - min 1 - max 1
action - choices { test } - choicelabels - &
{ test " R u n e a c h t o o l ' s ' z i g b u i l d t e s t ' o n l y " }
@ values - min 0 - max - 1
toolname - type string - optional 1 - multiple 1 - &
-help " T o o l ( s ) t o t e s t ; w i t h n o n a m e , a l l t o o l s a r e p r o c e s s e d . "
}
punk : : args::define {
@ -3639,11 +3678,13 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
-summary " $ { [ d i c t g e t $ S U M M A R I E S h e l p ] } " - &
-help - &
{ $ { [ dict get $HELPTEXTS help] } }
@ form - synopsis " m a k e . t c l h e l p ? s u b c o m m a n d ? "
@ values - min 1 - max 1
@ values - min 1 - max 2
subject - type string - optional 0 - &
-choices { $ { [ dict keys $SUMMARIES ] } } - &
-help " S u b c o m m a n d t o s h o w u s a g e f o r . "
action - type string - optional 1 - help - &
" A c t i o n w o r d ( o r 0 - b a s e d f o r m i n d e x ) o f a m u l t i - f o r m s u b c o m m a n d
( tool , buildsuite) - shows that action' s single-form usage."
}
# t o p - l e v e l d e f i n i t i o n : t h e s u b c o m m a n d t a b l e r e n d e r e d b y ' m a k e . t c l ' / ' m a k e . t c l - h e l p '
variable SUBGROUPS {
@ -3664,16 +3705,21 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
' bin ' and ' modules' folders at the same level as ' src' .
General usage: make.tcl < subcommand> ? flags?
' make.tcl help < subcommand> ' or ' make.tcl < subcommand> - help' shows a
subcommand ' s own usage. Interactive y/ n confirmations can be driven
non-interactively with the - confirm flag declared on the relevant
subcommands. }
' make.tcl help < subcommand> ? action? ' or ' make.tcl < subcommand> ? action? - help'
shows a subcommand' s own usage ( a single action' s usage for the
multi-form tool/ buildsuite subcommands) . Interactive y/ n
confirmations can be driven non-interactively with the - confirm
flag declared on the relevant subcommands.}
punk : : args::define {
@ id - id " ( s c r i p t ) : : p u n k b o o t "
@ cmd - name " m a k e . t c l " - &
-summary " p u n k s h e l l p r o j e c t b u i l d t o o l ( p u n k b o o t ) " - &
-help - &
{ $ { $TOPLEVEL_HELP } }
# s o l e r e m a i n i n g e x p l i c i t s y n o p s i s o v e r r i d e ( G - 1 4 3 r e t i r e d t h e p e r - s u b c o m m a n d
# o n e s p e r G - 1 4 4 ' s @ c m d - n a m e a u t o - s y n o p s i s ) : t h e a u t o r e n d e r w o u l d s h o w t h e
# s u b c o m m a n d l e a d e r a s m a n d a t o r y - t h i s l i n e s t a t e s t h e b a r e - i n v o c a t i o n a n d
# p e r - s u b c o m m a n d - f l a g s r e a l i t y t h e d e c l a r a t i o n c a n n o t .
@ form - synopsis " m a k e . t c l ? s u b c o m m a n d ? ? f l a g s ? "
@ leaders - min 1 - max 1
subcommand - type string - optional 0 - choicecolumns 1 - &
@ -3708,6 +3754,7 @@ if {$::punkboot::punkargs_ok && [package provide punk::ansi] ne "" && [package p
set do_help 0
set help_subject " "
set help_action " "
set help_exitcode 0
# d e f a u l t s f o r t h e o p t i o n - d e r i v e d v a r i a b l e s ( f a l l b a c k s c a n a n d p a s s t h r o u g h s u b c o m m a n d s r e l y o n t h e s e )
set : : punkboot::opt_forcekill 0
@ -3743,10 +3790,26 @@ if {$::punkboot::punkargs_ok} {
exit 1
}
set help_subject [ dict get $argd values subject]
if { [ dict exists $argd values action] } {
# G - 1 4 3 : ' m a k e . t c l h e l p < s u b c o m m a n d > < a c t i o n > ' r e n d e r s t h e a c t i o n ' s
# s i n g l e - f o r m u s a g e ( r e s o l v e d a g a i n s t t h e s u b j e c t ' s f o r m s b e l o w )
set help_action [ dict get $argd values action]
}
}
} elseif { $wants_help } {
set do_help 1
set help_subject $subcommand
# G - 1 4 3 : ' < s u b c o m m a n d > < a c t i o n > - h e l p ' r o u t e s t o t h e a c t i o n ' s s i n g l e - f o r m
# u s a g e w h e n t h e s u b c o m m a n d i s d e c l a r e d m u l t i - f o r m ( t o o l , b u i l d s u i t e ) -
# t h e a c t i o n c a n d i d a t e i s t h e f i r s t n o n - f l a g w o r d . S i n g l e - f o r m s u b c o m m a n d s
# k e e p t h e h i s t o r i c w h o l e - s u b c o m m a n d r e n d e r ( t r a i l i n g w o r d s i g n o r e d ) .
set firstword " "
foreach w $subargs {
if { ! [ string match - * $w ] } { set firstword $w ; break }
}
if { $firstword ne " " && [ llength [ punk : : args::forms ( script ) : : punkboot::$subcommand ] ] > 1 } {
set help_action $firstword
}
} elseif { $subcommand eq " s h e l l " } {
# d e c l a r e d p a s s t h r o u g h : e v e r y t h i n g a f t e r ' s h e l l ' g o e s t o t h e r e p l u n p a r s e d
set : : punkboot::command shell
@ -3756,9 +3819,29 @@ if {$::punkboot::punkargs_ok} {
set : : punkboot::command buildsuite
set : : punkboot::bs_args $subargs
} elseif { $subcommand eq " t o o l " } {
# d e c l a r e d p a s s t h r o u g h : t h e h a n d l e r p a r s e s a c t i o n / n a m e s / - t e s t i t s e l f ( G - 1 2 6 )
# G - 1 4 3 : t o o l i s d e c l a r e d m u l t i - f o r m ( o n e @ f o r m p e r a c t i o n ) a n d d i s p a t c h
# p a r s e s t h r o u g h t h e d e f i n i t i o n - u n k n o w n a c t i o n s a n d u n k n o w n f l a g s i n
# o p t i o n p o s i t i o n p r o d u c e p o i n t e d p u n k : : a r g s u s a g e e r r o r s ( e x i t 1 ) . T h e
# d e f i n i t i o n ' s p o s i t i o n a l m o d e l p u t s - t e s t b e f o r e t h e t o o l n a m e s
# ( ' m a k e . t c l t o o l b u i l d - t e s t 0 < n a m e > . . . ' ) ; t h e h i s t o r i c f l a g - a n y w h e r e
# o r d e r i s n o t c a r r i e d o v e r ( d o c s u p d a t e d ) . B a r e ' t o o l ' s e l e c t s t h e l i s t
# f o r m . T h e d e g r a d e d p l a i n s c a n k e e p s t h e h i s t o r i c m a n u a l t a i l p a r s e
# ( h a n d l e r - s i d e , e x i t - 2 s u r f a c e p r e s e r v e d t h e r e ) .
if { ! [ llength $subargs ] } { set subargs [ list list] }
if { [ catch { punk : : args::parse $subargs - errorstyle $::punkboot::errstyle withid ( script ) : : punkboot::tool} argd] } {
puts stderr $argd
exit 1
}
set : : punkboot::command tool
set : : punkboot::tool_args $subargs
set : : punkboot::tool_action [ dict get $argd form]
set : : punkboot::tool_names [ list ]
if { [ dict exists $argd values toolname] } {
set : : punkboot::tool_names [ dict get $argd values toolname]
}
set : : punkboot::tool_dotest 1
if { [ dict exists $argd opts - test] } {
set : : punkboot::tool_dotest [ dict get $argd opts - test]
}
} else {
if { [ catch { punk : : args::parse $subargs - errorstyle $::punkboot::errstyle withid ( script ) : : punkboot::$subcommand } argd] } {
puts stderr $argd
@ -3871,7 +3954,32 @@ if {$do_help} {
if { $help_subject ne " " } {
set usage_id ( script ) : : punkboot::$help_subject
}
if { ! [ catch { punk : : args::usage $usage_id } usage_out] } {
set usage_args [ list ]
if { $help_action ne " " } {
# G - 1 4 3 : p e r - a c t i o n s i n g l e - f o r m u s a g e . A n u n k n o w n a c t i o n w o r d i s a p o i n t e d
# p u n k : : a r g s u s a g e e r r o r ( e x i t 1 ) - n e v e r a p l a i n - h e l p f a l l b a c k . F o r m
# n a m e s r e s o l v e b y u n a m b i g u o u s p r e f i x , m a t c h i n g t h e d i s p a t c h c o n v e n t i o n ;
# a 0 - b a s e d f o r m I N D E X i s a l s o a c c e p t e d - t h e n o t a t i o n p u n k : : a r g s i t s e l f
# a d v e r t i s e s ( t h e ' i - f o r m N . . . ' s y n o p s i s h i n t s a n d i t s - f o r m e r r o r
# m e s s a g e s b o t h s p e a k i n d e x e s ) .
set form_names [ punk : : args::forms $usage_id ]
set fmatch [ tcl : : prefix::match - error " " $form_names $help_action ]
if { $fmatch eq " " && [ string is integer - strict $help_action ]
&& $help_action >= 0 && $help_action < [ llength $form_names ] } {
set fmatch [ lindex $form_names $help_action ]
}
if { $fmatch eq " " } {
if { [ catch { punk : : args::usage - form $help_action $usage_id } usage_err] } {
puts stderr $usage_err
} else {
puts stderr " m a k e . t c l : n o a c t i o n ' $ h e l p _ a c t i o n ' f o r ' $ h e l p _ s u b j e c t ' ( a c t i o n s : $ f o r m _ n a m e s ) "
}
exit 1
}
set help_action $fmatch
lappend usage_args - form $help_action
}
if { ! [ catch { punk : : args::usage { * } $usage_args $usage_id } usage_out] } {
puts stdout $usage_out
set availability_note [ : : punkboot : : punkboot_availability_note]
if { $availability_note ne " " } {
@ -5126,30 +5234,40 @@ if {$::punkboot::command eq "tool"} {
# f e t c h g u i d a n c e . B u i l d c a c h e s ( . z i g - c a c h e / z i g - o u t ) a r e d e l i b e r a t e l y l e f t i n
# p l a c e b e t w e e n b u i l d s f o r r e b u i l d s p e e d ( b o t h g i t - a n d f o s s i l - i g n o r e d ) .
set tool_root [ file join $sourcefolder tools]
if { ! [ info exists : : punkboot::tool_args] } { set : : punkboot::tool_args [ list ] }
set targs $::punkboot::tool_args
set tool_action [ lindex $targs 0 ]
if { $tool_action eq " " } { set tool_action list}
# a r g s a f t e r t h e a c t i o n : t o o l n a m e s p l u s a n o p t i o n a l ' - t e s t 0 | 1 ' f l a g ( b u i l d )
set tool_dotest 1
set tool_names [ list ]
set _i 1
while { $_i < [ llength $targs ] } {
set a [ lindex $targs $_i ]
if { $a eq " - t e s t " } {
incr _i
set v [ lindex $targs $_i ]
if { ! [ string is boolean - strict $v ] } {
puts stderr " m a k e . t c l t o o l : - t e s t r e q u i r e s a b o o l e a n v a l u e ( g o t ' $ v ' ) "
exit 2
if { $::punkboot::punkargs_ok } {
# G - 1 4 3 : a c t i o n / n a m e s / - t e s t a l r e a d y p a r s e d t h r o u g h t h e m u l t i - f o r m d e f i n i t i o n
# a t d i s p a t c h ( p o i n t e d p u n k : : a r g s u s a g e e r r o r s f o r u n k n o w n a c t i o n s / f l a g s ) .
set tool_action $::punkboot::tool_action
set tool_names $::punkboot::tool_names
set tool_dotest $::punkboot::tool_dotest
} else {
# d e g r a d e d p l a i n s c a n : t h e h a n d l e r ' s h i s t o r i c m a n u a l t a i l p a r s e ( i t s u n k n o w n
# a c t i o n / b a d - t e s t e x i t - 2 s u r f a c e i s p r e s e r v e d i n t h i s m o d e )
if { ! [ info exists : : punkboot::tool_args] } { set : : punkboot::tool_args [ list ] }
set targs $::punkboot::tool_args
set tool_action [ lindex $targs 0 ]
if { $tool_action eq " " } { set tool_action list}
# a r g s a f t e r t h e a c t i o n : t o o l n a m e s p l u s a n o p t i o n a l ' - t e s t 0 | 1 ' f l a g ( b u i l d )
set tool_dotest 1
set tool_names [ list ]
set _i 1
while { $_i < [ llength $targs ] } {
set a [ lindex $targs $_i ]
if { $a eq " - t e s t " } {
incr _i
set v [ lindex $targs $_i ]
if { ! [ string is boolean - strict $v ] } {
puts stderr " m a k e . t c l t o o l : - t e s t r e q u i r e s a b o o l e a n v a l u e ( g o t ' $ v ' ) "
exit 2
}
set tool_dotest [ expr { bool ( $v ) } ]
} else {
lappend tool_names $a
}
set tool_dotest [ expr { bool ( $v ) } ]
} else {
lappend tool_names $a
incr _i
}
incr _i
unset - nocomplain _i a v
}
unset - nocomplain _i a v
proc : : punkboot::tool_dirs { tool_root } {
set dirs [ list ]
@ -5297,6 +5415,9 @@ if {$::punkboot::command eq "tool"} {
set selected [ list ]
foreach n $tool_names {
if { ! [ dict exists $byname $n ] } {
if { [ string match - * $n ] } {
puts stderr " t o o l : ' $ n ' l o o k s l i k e a f l a g - o p t i o n s p r e c e d e t h e t o o l n a m e s ( e . g ' m a k e . t c l t o o l b u i l d - t e s t 0 < n a m e > . . . ' ) "
}
puts stderr " t o o l ' $ n ' n o t f o u n d u n d e r $ t o o l _ r o o t - c o n f i g u r e d t o o l s : [ d i c t k e y s $ b y n a m e ] "
exit 2
}
@ -5340,7 +5461,7 @@ if {$::punkboot::command eq "tool"} {
}
puts stdout " "
puts stdout " - ' m a k e . t c l t o o l i n f o < n a m e > ' s h o w s a t o o l ' s d e t a i l "
puts stdout " - ' m a k e . t c l t o o l b u i l d ? < n a m e > . . . ? ? - t e s t 0 | 1 ? ' b u i l d s ( t e s t - g a t e d ) a n d i n s t a l l s t o b i n / "
puts stdout " - ' m a k e . t c l t o o l b u i l d ? - t e s t 0 | 1 ? ? < n a m e > . . . ? ' b u i l d s ( t e s t - g a t e d ) a n d i n s t a l l s t o b i n / "
puts stdout " - z i g i s O P T I O N A L f o r p u n k s h e l l b u i l d s : p a c k a g e s / b a k e n e v e r r e q u i r e t h i s s t e p "
exit 0
}
@ -5446,7 +5567,7 @@ if {$::punkboot::command eq "tool"} {
}
default {
puts stderr " u n k n o w n t o o l a c t i o n ' $ t o o l _ a c t i o n ' - e x p e c t e d l i s t | i n f o | b u i l d | t e s t "
puts stderr " u s a g e : m a k e . t c l t o o l l i s t | i n f o | b u i l d | t e s t ? < t o o l n a m e > . . . ? ? - t e s t 0 | 1 ? "
puts stderr " u s a g e : m a k e . t c l t o o l l i s t | i n f o | b u i l d | t e s t ? - t e s t 0 | 1 ? ? <t o o l n a m e > . . . ? "
exit 2
}
}