Browse Source

fix punk::args parse when multiple flags marked optional false and more than one of them not supplied

master
Julian Noble 3 weeks ago
parent
commit
65bb493544
  1. 6
      src/bootsupport/modules/punk/args-0.2.1.tm
  2. 6
      src/modules/punk/args-999999.0a1.0.tm
  3. 6
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/args-0.2.1.tm
  4. 6
      src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/args-0.2.1.tm
  5. 6
      src/vfs/_vfscommon.vfs/modules/punk/args-0.2.1.tm

6
src/bootsupport/modules/punk/args-0.2.1.tm

@ -8875,7 +8875,11 @@ tcl::namespace::eval punk::args {
if {[llength $OPT_REQUIRED]} { if {[llength $OPT_REQUIRED]} {
set api_opt_required [lmap v $OPT_REQUIRED {lindex [split $v |] end}] set api_opt_required [lmap v $OPT_REQUIRED {lindex [split $v |] end}]
if {[llength [set missing [punklib_ldiff $api_opt_required $flagsreceived]]]} { if {[llength [set missing [punklib_ldiff $api_opt_required $flagsreceived]]]} {
set full_missing [dict get $lookup_optset $missing] set full_missing [list]
foreach m $missing {
lappend full_missing [dict get $lookup_optset $m]
}
#set full_missing [dict get $lookup_optset $missing]
set msg "Required option missing for %caller%. missing flags: '$full_missing' are marked with -optional false - so must be present" set msg "Required option missing for %caller%. missing flags: '$full_missing' are marked with -optional false - so must be present"
return -options [list -code error -errorcode [list PUNKARGS VALIDATION [list optionmissing $full_missing received $flagsreceived] -argspecs $argspecs]] $msg return -options [list -code error -errorcode [list PUNKARGS VALIDATION [list optionmissing $full_missing received $flagsreceived] -argspecs $argspecs]] $msg
#arg_error "Required option missing for [Get_caller]. missing flags: '$missing' are marked with -optional false - so must be present " $argspecs #arg_error "Required option missing for [Get_caller]. missing flags: '$missing' are marked with -optional false - so must be present " $argspecs

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

@ -8875,7 +8875,11 @@ tcl::namespace::eval punk::args {
if {[llength $OPT_REQUIRED]} { if {[llength $OPT_REQUIRED]} {
set api_opt_required [lmap v $OPT_REQUIRED {lindex [split $v |] end}] set api_opt_required [lmap v $OPT_REQUIRED {lindex [split $v |] end}]
if {[llength [set missing [punklib_ldiff $api_opt_required $flagsreceived]]]} { if {[llength [set missing [punklib_ldiff $api_opt_required $flagsreceived]]]} {
set full_missing [dict get $lookup_optset $missing] set full_missing [list]
foreach m $missing {
lappend full_missing [dict get $lookup_optset $m]
}
#set full_missing [dict get $lookup_optset $missing]
set msg "Required option missing for %caller%. missing flags: '$full_missing' are marked with -optional false - so must be present" set msg "Required option missing for %caller%. missing flags: '$full_missing' are marked with -optional false - so must be present"
return -options [list -code error -errorcode [list PUNKARGS VALIDATION [list optionmissing $full_missing received $flagsreceived] -argspecs $argspecs]] $msg return -options [list -code error -errorcode [list PUNKARGS VALIDATION [list optionmissing $full_missing received $flagsreceived] -argspecs $argspecs]] $msg
#arg_error "Required option missing for [Get_caller]. missing flags: '$missing' are marked with -optional false - so must be present " $argspecs #arg_error "Required option missing for [Get_caller]. missing flags: '$missing' are marked with -optional false - so must be present " $argspecs

6
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/args-0.2.1.tm

@ -8875,7 +8875,11 @@ tcl::namespace::eval punk::args {
if {[llength $OPT_REQUIRED]} { if {[llength $OPT_REQUIRED]} {
set api_opt_required [lmap v $OPT_REQUIRED {lindex [split $v |] end}] set api_opt_required [lmap v $OPT_REQUIRED {lindex [split $v |] end}]
if {[llength [set missing [punklib_ldiff $api_opt_required $flagsreceived]]]} { if {[llength [set missing [punklib_ldiff $api_opt_required $flagsreceived]]]} {
set full_missing [dict get $lookup_optset $missing] set full_missing [list]
foreach m $missing {
lappend full_missing [dict get $lookup_optset $m]
}
#set full_missing [dict get $lookup_optset $missing]
set msg "Required option missing for %caller%. missing flags: '$full_missing' are marked with -optional false - so must be present" set msg "Required option missing for %caller%. missing flags: '$full_missing' are marked with -optional false - so must be present"
return -options [list -code error -errorcode [list PUNKARGS VALIDATION [list optionmissing $full_missing received $flagsreceived] -argspecs $argspecs]] $msg return -options [list -code error -errorcode [list PUNKARGS VALIDATION [list optionmissing $full_missing received $flagsreceived] -argspecs $argspecs]] $msg
#arg_error "Required option missing for [Get_caller]. missing flags: '$missing' are marked with -optional false - so must be present " $argspecs #arg_error "Required option missing for [Get_caller]. missing flags: '$missing' are marked with -optional false - so must be present " $argspecs

6
src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/args-0.2.1.tm

@ -8875,7 +8875,11 @@ tcl::namespace::eval punk::args {
if {[llength $OPT_REQUIRED]} { if {[llength $OPT_REQUIRED]} {
set api_opt_required [lmap v $OPT_REQUIRED {lindex [split $v |] end}] set api_opt_required [lmap v $OPT_REQUIRED {lindex [split $v |] end}]
if {[llength [set missing [punklib_ldiff $api_opt_required $flagsreceived]]]} { if {[llength [set missing [punklib_ldiff $api_opt_required $flagsreceived]]]} {
set full_missing [dict get $lookup_optset $missing] set full_missing [list]
foreach m $missing {
lappend full_missing [dict get $lookup_optset $m]
}
#set full_missing [dict get $lookup_optset $missing]
set msg "Required option missing for %caller%. missing flags: '$full_missing' are marked with -optional false - so must be present" set msg "Required option missing for %caller%. missing flags: '$full_missing' are marked with -optional false - so must be present"
return -options [list -code error -errorcode [list PUNKARGS VALIDATION [list optionmissing $full_missing received $flagsreceived] -argspecs $argspecs]] $msg return -options [list -code error -errorcode [list PUNKARGS VALIDATION [list optionmissing $full_missing received $flagsreceived] -argspecs $argspecs]] $msg
#arg_error "Required option missing for [Get_caller]. missing flags: '$missing' are marked with -optional false - so must be present " $argspecs #arg_error "Required option missing for [Get_caller]. missing flags: '$missing' are marked with -optional false - so must be present " $argspecs

6
src/vfs/_vfscommon.vfs/modules/punk/args-0.2.1.tm

@ -8875,7 +8875,11 @@ tcl::namespace::eval punk::args {
if {[llength $OPT_REQUIRED]} { if {[llength $OPT_REQUIRED]} {
set api_opt_required [lmap v $OPT_REQUIRED {lindex [split $v |] end}] set api_opt_required [lmap v $OPT_REQUIRED {lindex [split $v |] end}]
if {[llength [set missing [punklib_ldiff $api_opt_required $flagsreceived]]]} { if {[llength [set missing [punklib_ldiff $api_opt_required $flagsreceived]]]} {
set full_missing [dict get $lookup_optset $missing] set full_missing [list]
foreach m $missing {
lappend full_missing [dict get $lookup_optset $m]
}
#set full_missing [dict get $lookup_optset $missing]
set msg "Required option missing for %caller%. missing flags: '$full_missing' are marked with -optional false - so must be present" set msg "Required option missing for %caller%. missing flags: '$full_missing' are marked with -optional false - so must be present"
return -options [list -code error -errorcode [list PUNKARGS VALIDATION [list optionmissing $full_missing received $flagsreceived] -argspecs $argspecs]] $msg return -options [list -code error -errorcode [list PUNKARGS VALIDATION [list optionmissing $full_missing received $flagsreceived] -argspecs $argspecs]] $msg
#arg_error "Required option missing for [Get_caller]. missing flags: '$missing' are marked with -optional false - so must be present " $argspecs #arg_error "Required option missing for [Get_caller]. missing flags: '$missing' are marked with -optional false - so must be present " $argspecs

Loading…
Cancel
Save