bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10019: sort options -Mn are incompatible


From: Eric Blake
Subject: bug#10019: sort options -Mn are incompatible
Date: Wed, 16 Nov 2011 10:13:10 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

On 11/12/2011 02:29 PM, Paul Eggert wrote:
> On 11/12/11 05:54, Eric Blake wrote:
>>   -k --key=KEYDEF  control where a key starts and ends, and give
>>                    ordering specific to the key. See KEYDEF below.
>>
>> KEYDEF is F[.C][OPTS][,F[.C][OPTS]], where F is a field number and C
>> a character position in the field; both are origin 1.  If the second
>> position is omitted, the key runs to the end of the line.  If neither
>> -t nor -b is in effect, characters in a field are counted from the
>> beginning of the preceding whitespace.  OPTS is one or more
>> single-letter ordering options [bdfgiMhnRrV], which override global
>> ordering options for that key.  If no key is given, use the entire line
>> as the key.
> 
> That's nicer, but a bit longer.  How about this attempt to shorten its
> first two sentences?
> 
>     -k, --key=KEYDEF          sort via a key; KEYDEF gives location and type
> 
>   ...
> 
>   KEYDEF is F[.C][OPTS][,F[.C][OPTS]], where F is a field number and C a
>   character position in the field; both are origin 1, and the key's end
>   defaults to the line's end.
> 
> with the remainder as before.

Sure.  Here's the current state of things in patch format; any last
objections before I push this?

From 968b21312eda99fd5e9402546c370775d1e696cf Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Wed, 16 Nov 2011 10:09:12 -0700
Subject: [PATCH] sort: clarify wording on -k syntax
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* src/sort.c (usage): Use KEYDEF instead of POS, and call out the
specific OPTS that can occur in KEYDEF.
Based on a report by Lars Noodén, http://bugs.gnu.org/10019
---
 src/sort.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/sort.c b/src/sort.c
index 3e94a6e..236cb6a 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -457,8 +457,7 @@ Other options:\n\
                             If F is - then read names from standard
input\n\
 "), stdout);
       fputs (_("\
-  -k, --key=POS1[,POS2]     start a key at POS1 (origin 1), end it at
POS2\n\
-                            (default end of line).  See POS syntax below\n\
+  -k, --key=KEFDEF          sort via a key; KEYDEF gives location and
type\n\
   -m, --merge               merge already sorted files; do not sort\n\
 "), stdout);
       fputs (_("\
@@ -483,13 +482,13 @@ Other options:\n\
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
       fputs (_("\
 \n\
-POS is F[.C][OPTS], where F is the field number and C the character
position\n\
-in the field; both are origin 1.  If neither -t nor -b is in effect,
characters\
-\n\
-in a field are counted from the beginning of the preceding whitespace.
 OPTS is\
-\n\
-one or more single-letter ordering options, which override global
ordering\n\
-options for that key.  If no key is given, use the entire line as the
key.\n\
+KEYDEF is F[.C][OPTS][,F[.C][OPTS]] for start and stop position, where
F is a\n\
+field number and C a character position in the field; both are origin
1, and\n\
+the stop position defaults to the line's end.  If neither -t nor -b is
in\n\
+effect, characters in a field are counted from the beginning of the
preceding\n\
+whitespace.  OPTS is one or more single-letter ordering options
[bdfgiMhnRrV],\n\
+which override global ordering options for that key.  If no key is
given, use\n\
+the entire line as the key.\n\
 \n\
 SIZE may be followed by the following multiplicative suffixes:\n\
 "), stdout);
-- 
1.7.7.1



-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]