Posted to tcl by daedra at Thu Jul 21 09:21:43 GMT 2011view raw

  1. set nargs [llength $argv]
  2. if {$nargs == 0} {
  3. func $arg1 $arg2
  4. }
  5.  
  6.  
  7. proc func {apps sections args} {
  8. if { [func2 $arg1 $arg2 $args] == 0 } {
  9. error "did not succeed"
  10. }
  11. }
  12.  
  13. proc func2 {apps sections args} {
  14. set nargs [llength $args]
  15. if {$args == "{}"} { set nargs 0 }
  16.  
  17.  
  18. if {$nargs == 0} {
  19. blah
  20. exit 1
  21. } elseif {$nargs == 1} {
  22. bloo
  23. exit 0
  24. }
  25. }
  26.