Artifact e6c94c3edb817e6982f53bc26d4da4374901bd20:
- Executable file examples/ask-menu — part of check-in [1eeef53431] at 2014-05-23 21:51:43 on branch trunk — cmdr::ask - Fixed a syntax problem. Fixed scope issue (string command). Tweaked the prompt setup. Plus example apps (also for interactive testing). (user: andreask size: 351)
#!/usr/bin/env tclsh # -*- tcl -*- package require Tcl 8.5 package require cmdr::ask lappend fruit apple lappend fruit cherry lappend fruit plum lappend fruit peach lappend fruit banana lappend fruit pear set rand [lindex $fruit [expr {int(0.1+(rand()*([llength $fruit])))}]] puts [cmdr ask menu {Choose your meal} {Which fruit} $fruit $rand] exit