diff options
author | nijtmans <nijtmans> | 2010-05-27 08:32:22 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-05-27 08:32:22 (GMT) |
commit | 11fff51d24f1d24c5fe3950c5a0dfffc10b03d62 (patch) | |
tree | 991dabe2e7c6e598cdcbe8719a2126e348c79390 /library | |
parent | b6b47d546475f2262d264826edf0f9397c9e08db (diff) | |
download | tcl-11fff51d24f1d24c5fe3950c5a0dfffc10b03d62.zip tcl-11fff51d24f1d24c5fe3950c5a0dfffc10b03d62.tar.gz tcl-11fff51d24f1d24c5fe3950c5a0dfffc10b03d62.tar.bz2 |
optParse.tcl: Don't generate spaces at the end of a line.
Diffstat (limited to 'library')
-rw-r--r-- | library/opt/optparse.tcl | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/library/opt/optparse.tcl b/library/opt/optparse.tcl index 67f3cc1..16e56b0 100644 --- a/library/opt/optparse.tcl +++ b/library/opt/optparse.tcl @@ -8,7 +8,7 @@ # on it. If your code does rely on this package you # may directly incorporate this code into your application. # -# RCS: @(#) $Id: optparse.tcl,v 1.11 2009/11/18 21:45:37 nijtmans Exp $ +# RCS: @(#) $Id: optparse.tcl,v 1.12 2010/05/27 08:32:23 nijtmans Exp $ package require Tcl 8.2 # When this version number changes, update the pkgIndex.tcl file @@ -892,22 +892,22 @@ proc ::tcl::OptKeyError {prefix descKey {header 0}} { } # output the tree proc OptTree {desc nl tl dl} { - set res ""; + set res "" foreach item $desc { - if {[OptIsCounter $item]} continue; + if {[OptIsCounter $item]} continue if {[OptIsPrg $item]} { - append res [OptTree $item $nl $tl $dl]; + append res [OptTree $item $nl $tl $dl] } else { - set dv [OptTypeArgs $item]; + set dv [OptTypeArgs $item] if {[OptState $item] != "header"} { - set dv "($dv)"; + set dv "($dv)" } - append res [format "\n %-*s %-*s %-*s %s" \ + append res [string trimright [format "\n %-*s %-*s %-*s %s" \ $nl [OptName $item] $tl [OptType $item] \ - $dl $dv [OptHelp $item]] + $dl $dv [OptHelp $item]]] } } - return $res; + return $res } # Give nice usage string @@ -915,9 +915,9 @@ proc ::tcl::OptError {prefix desc {header 0}} { # determine length if {$header} { # add faked instruction - set h [list [OptNewInst header Var/FlagName Type Value Help]]; - lappend h [OptNewInst header ------------ ---- ----- ----]; - lappend h [OptNewInst header {( -help} "" "" {gives this help )}] + set h [list [OptNewInst header Var/FlagName Type Value Help]] + lappend h [OptNewInst header ------------ ---- ----- ----] + lappend h [OptNewInst header {(-help} "" "" {gives this help)}] set desc [concat $h $desc] } OptLengths $desc nl tl dl |