summaryrefslogtreecommitdiffstats
path: root/doc/lsort.n
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2001-09-28 15:32:16 (GMT)
committerdkf <dkf@noemail.net>2001-09-28 15:32:16 (GMT)
commite1a4b325cdb74c4365e8f2c30570da3fd9d9f50d (patch)
tree24d4af32d308623f80fbcb56ee84f241ea3d63fa /doc/lsort.n
parentb0afbce839d8c56d4af2ea91980fdc87a64ba254 (diff)
downloadtcl-e1a4b325cdb74c4365e8f2c30570da3fd9d9f50d.zip
tcl-e1a4b325cdb74c4365e8f2c30570da3fd9d9f50d.tar.gz
tcl-e1a4b325cdb74c4365e8f2c30570da3fd9d9f50d.tar.bz2
Fixed Bug #465674 reported by me. [lsort -index end-1] now behaves sensibly...
FossilOrigin-Name: 3a02710e2f6052b9c11de4dbd3d19b010828aa7d
Diffstat (limited to 'doc/lsort.n')
-rw-r--r--doc/lsort.n27
1 files changed, 21 insertions, 6 deletions
diff --git a/doc/lsort.n b/doc/lsort.n
index 2a21aa2..67f7f09 100644
--- a/doc/lsort.n
+++ b/doc/lsort.n
@@ -6,7 +6,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: lsort.n,v 1.9 2001/03/30 00:56:02 hobbs Exp $
+'\" RCS: @(#) $Id: lsort.n,v 1.10 2001/09/28 15:32:17 dkf Exp $
'\"
.so man.macros
.TH lsort n 8.3 Tcl "Tcl Built-In Commands"
@@ -65,15 +65,30 @@ Sort the list in decreasing order (``largest'' items first).
.TP 20
\fB\-index\0\fIindex\fR
If this option is specified, each of the elements of \fIlist\fR must
-itself be a proper Tcl sublist. Instead of sorting based on whole sublists,
-\fBlsort\fR will extract the \fIindex\fR'th element from each sublist
-and sort based on the given element. The keyword \fBend\fP is allowed
-for the \fIindex\fP to sort on the last sublist element. For example,
+itself be a proper Tcl sublist. Instead of sorting based on whole
+sublists, \fBlsort\fR will extract the \fIindex\fR'th element from
+each sublist and sort based on the given element. The keyword
+\fBend\fP is allowed for the \fIindex\fP to sort on the last sublist
+element,
+.VS 8.4
+and \fBend-\fIindex\fR sorts on a sublist element offset from
+the end.
+.VE
+For example,
.RS
.CS
lsort -integer -index 1 {{First 24} {Second 18} {Third 30}}
.CE
-returns \fB{Second 18} {First 24} {Third 30}\fR.
+returns \fB{Second 18} {First 24} {Third 30}\fR, and
+.VS 8.4
+'\"
+'\" This example is from the test suite!
+'\"
+.CS
+lsort -index end-1 {{a 1 e i} {b 2 3 f g} {c 4 5 6 d h}}
+.CE
+returns \fB{c 4 5 6 d h} {a 1 e i} {b 2 3 f g}\fR.
+.VE
This option is much more efficient than using \fB\-command\fR
to achieve the same effect.
.RE