Browse Source

punk::mix::commandset::project 0.2.1: -layout prefix-match validation fix

project::new documented -choices on -layout with -choiceprefix defaulting
to true (prefix matching promised), but the manual dict merge parser
accepted arbitrary values with no validation or normalization. Added
tcl::prefix::match against the documented layout choices so the parser
now validates and normalizes -layout values, matching the PUNKARGS
documentation.

Assisted-by: harness=opencode; primary-model=openrouter/z-ai/glm-5.2; api-location=openrouter.ai
master
Julian Noble 6 days ago
parent
commit
d579760e68
  1. 3
      src/modules/punk/mix/commandset/project-999999.0a1.0.tm
  2. 3
      src/modules/punk/mix/commandset/project-buildversion.txt

3
src/modules/punk/mix/commandset/project-999999.0a1.0.tm

@ -168,6 +168,9 @@ namespace eval punk::mix::commandset::project {
}
set opts [dict merge $defaults $args]
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
#validate -layout against documented choices with prefix matching (punk::args -choiceprefix defaults to true)
dict set opts -layout [tcl::prefix::match -message "project.new -layout" $::punk::mix::commandset::project::argdoc::LAYOUTNAMES [dict get $opts -layout]]
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set opt_type [dict get $opts -type]
if {$opt_type ni [punk::mix::cli::lib::module_types]} {
error "deck new error - unknown type '$opt_type' known types: [punk::mix::cli::lib::module_types]"

3
src/modules/punk/mix/commandset/project-buildversion.txt

@ -1,5 +1,6 @@
0.2.0
0.2.1
#First line must be a semantic version number
#all other lines are ignored.
#0.2.1 - fix: -layout now validated and normalized via tcl::prefix::match against documented layout choices, matching the PUNKARGS -choiceprefix default (true); previously the manual parser accepted arbitrary values with no validation
#0.2.0 - updated punkcheck::install call sites to use -exclude-paths / -exclude-paths-core (replaced -antiglob-paths + -exclude-dirsegments) — call-site API change warrants minor bump
#0.2.0 - updated call sites to use hyphenated flag names (-punkcheck-folder, -exclude-paths-core)

Loading…
Cancel
Save