cmdr
Check-in [9d0fa722e9]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Bump versions of cmdr::color and cmdr::ask to 1. Fixed a prompt issue in cmdr::ask::string*. Extended debug narrative regarding prompt handling.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9d0fa722e9ba9e357f264bffa2bf626ef82647d9
User & Date: andreask 2014-08-27 23:41:25
Context
2014-08-29
05:07
Tweaked output for help --full, added option arguments for options requiring them. check-in: 84658915a6 user: aku tags: trunk
2014-08-27
23:41
Bump versions of cmdr::color and cmdr::ask to 1. Fixed a prompt issue in cmdr::ask::string*. Extended debug narrative regarding prompt handling. check-in: 9d0fa722e9 user: andreask tags: trunk
2014-08-26
20:56
Fix another oops. check-in: db22847a09 user: andreask tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ask.tcl.

   117    117       }
   118    118       return $response
   119    119   }
   120    120   
   121    121   proc ::cmdr::ask::string* {query} {
   122    122       debug.cmdr/ask {}
   123    123   
   124         -    Ensure query :   ;# TODO: allow customization (string prompt string)
   125         -    append query { }
          124  +    Chop   query {: }
          125  +    append query {: }   ;# TODO: allow customization (string prompt string)
   126    126   
   127    127       try {
   128    128   	set response [Interact {*}[Fit $query 10] -hidden 1]
   129    129       } on error {e o} {
   130    130   	if {$e eq "aborted"} {
   131    131   	    error Interrupted error SIGTERM
   132    132   	}
................................................................................
   331    331       # set header [join [lreverse [lassign [lreverse [split $prompt \n]] prompt]] \n]
   332    332       append prompt { }
   333    333   
   334    334       return [list $header $prompt]
   335    335   }
   336    336   
   337    337   proc ::cmdr::ask::Chop {var charset} {
          338  +    debug.cmdr/ask {}
   338    339       upvar 1 $var text
   339    340       set text [::string trimright $text $charset]
          341  +
          342  +    debug.cmdr/ask {/done ==> ($text)}
   340    343       return
   341    344   }
   342    345   
   343    346   proc ::cmdr::ask::Ensure {var char} {
          347  +    debug.cmdr/ask {}
   344    348       upvar 1 $var text
   345         -    if {[::string index $text end] eq $char} return
          349  +    if {[::string index $text end] eq $char} {
          350  +	debug.cmdr/ask {/done, no change}
          351  +	return
          352  +    }
   346    353       append text $char
          354  +
          355  +    debug.cmdr/ask {/done ==> ($text)}
   347    356       return
   348    357   }
   349    358   
   350    359   # # ## ### ##### ######## ############# #####################
   351    360   ## Ready
   352         -package provide cmdr::ask 0
          361  +package provide cmdr::ask 1

Changes to color.tcl.

   342    342   	lappend smap $c $o
   343    343       }
   344    344       lappend smap \127 \\127
   345    345   } ::cmdr::color}
   346    346   
   347    347   # # ## ### ##### ######## ############# #####################
   348    348   ## Ready
   349         -package provide cmdr::color 0
          349  +package provide cmdr::color 1