Posted to tcl by stu at Tue Aug 09 18:07:46 GMT 2022view raw

  1. return -code {*}[expr {
  2. $subcommand eq "list"
  3. ? [llength $args] == 0
  4. ? [list ok [dict keys $pkgconfig]]
  5. : [list error "wrong # args: should be \"[namespace current]::pkgconfig list\""]
  6. : $subcommand eq "get"
  7. ? [llength $args] == 1
  8. ? [dict exists $pkgconfig [set key [lindex $args 0]]]
  9. ? [list ok [dict get $pkgconfig $key]]
  10. : [list error "key \"$key\" not known"]
  11. : [list error "wrong # args: should be \"[namespace current]::pkgconfig get key\""]
  12. : [list uh oh]
  13. }]