bug-coreutils
[Top][All Lists]
Advanced

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

bug#8231: Bug in the linux command: tail


From: Eric Blake
Subject: bug#8231: Bug in the linux command: tail
Date: Fri, 11 Mar 2011 14:34:35 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

[re-adding the list, to keep others in the loop]

On 03/11/2011 02:20 PM, Roger N. Clark wrote:
> Eric Blake wrote:
> 
>> Coreutils 8.10 is the latest release, and the man
>> page from that version (as well as 'tail --help', from which the man
>> page is generated) states:
>>
>>       -n, --lines=K
>>               output the last K lines, instead of the last 10; or use -n
>>               +K to output lines starting with the Kth
> 
> Eric,
> So then shouldn't it read something like:
> 
>        -n, -n K, --lines=K

No.  If anything, you are asking for:

         -K, -n K, --lines=K

since you used K as the metavariable, and extension is that you can skip
the -n and specify just the dash-number.  In fact, it would be less
confusing if we did:

         -NUM, -n NUM, --lines=NUM

but that wastes valuable 'tail --help' real estate (long lines in --help
output are hard to justify).  We already had that proposal, and didn't
like how long it made things.

Besides, we already have the convention that long options that require
an argument mean that the associated short option also requires an
option.  That is, we are already consistent in writing

-n, --lines=K

as shorthand for:

-n K OR --lines=K

Furthermore, our argument is that -NUM is an _intentionally
undocumented_ extension - it exists because of older POSIX, but since it
is not required by current POSIX, so we would rather _only_ document the
POSIX-preferred spelling of -n <metavariable>, to try and encourage
people to use only the new form.  K was the shortest <metavariable> name
we could think of that wasn't ambiguous with an option name (the older
-n, --lines=n used 'n' as both a short option and a metavariable in the
same line, which is why we switched to K).  And listing the '-n +K'
example in the explanatory text was on purpose, to try and make people
figure out that '-n' is the literal short option name and that it takes
an argument related to the metavariable K.

> 
> Sorry to be persistent; I would just like the man page to be a little
> clearer.

Suggestions welcome, but know that this has already been debated in the
past, so good luck coming up with something that still fits within the
constraints.

-- 
Eric Blake   address@hidden    +1-801-349-2682
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]