GNU bug report logs - #14686
Bug#713022: truncate man and info pages must mention -s / -r mandatory

Previous Next

Package: coreutils;

Reported by: jidanni <at> jidanni.org, 713022 <at> bugs.debian.org

Date: Fri, 21 Jun 2013 21:43:02 UTC

Severity: normal

Found in version 8.13-3.3

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14686 in the body.
You can then email your comments to 14686 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org, bug-coreutils <at> gnu.org:
bug#14686; Package coreutils. (Fri, 21 Jun 2013 21:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to jidanni <at> jidanni.org, 713022 <at> bugs.debian.org:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org, bug-coreutils <at> gnu.org. (Fri, 21 Jun 2013 21:43:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: jidanni <at> jidanni.org
To: submit <at> bugs.debian.org
Subject: Bug#713022: truncate man and info pages must mention -s / -r mandatory
Date: Sat, 22 Jun 2013 04:05:29 +0800
Package: coreutils
Version: 8.13-3.3
File: /usr/share/man/man1/truncate.1.gz
X-debbugs-CC: bug-coreutils <at> gnu.org

$ truncate /tmp/erere
truncate: you must specify either `--size' or `--reference'

What a shock. Not mentioned on man or info pages!

And
       truncate OPTION... FILE...
should be
       truncate <--size|--ref...> <number> [OPTION...] FILE...

Also mention size is in bytes. Don't just hope the reader will examine
every options' wording to ferret that out.




Reply sent to Pádraig Brady <P <at> draigBrady.com>:
You have taken responsibility. (Fri, 21 Jun 2013 22:38:02 GMT) Full text and rfc822 format available.

Notification sent to jidanni <at> jidanni.org, 713022 <at> bugs.debian.org:
bug acknowledged by developer. (Fri, 21 Jun 2013 22:38:04 GMT) Full text and rfc822 format available.

Message #10 received at 14686-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: jidanni <at> jidanni.org, 713022 <at> bugs.debian.org
Cc: 14686-done <at> debbugs.gnu.org
Subject: Re: bug#14686: Bug#713022: truncate man and info pages must mention
 -s / -r mandatory
Date: Fri, 21 Jun 2013 23:37:20 +0100
On 06/21/2013 09:05 PM, jidanni <at> jidanni.org wrote:
> Package: coreutils
> Version: 8.13-3.3
> File: /usr/share/man/man1/truncate.1.gz
> X-debbugs-CC: bug-coreutils <at> gnu.org
> 
> $ truncate /tmp/erere
> truncate: you must specify either `--size' or `--reference'
> 
> What a shock. Not mentioned on man or info pages!

Well it was immediately obvious what to do given the above output.
Some might consider a pointed message like this,
preferable to having to read the manual initially.

> 
> And
>        truncate OPTION... FILE...
> should be
>        truncate <--size|--ref...> <number> [OPTION...] FILE...

Or more accurately:

 truncate <--size|--reference> <SIZE|FILE> [OPTION...] FILE...

Now some may find the above more confusing to parse.
Also worth noting is the next line in the man page and info manual,
i.e. the first line of the description, should make it quite obvious
a size is required:

  "Shrink or extend the size of each FILE to the specified size"

Also we follow this pattern for other utils like cut(1).

So I'm slightly inclined to leave as is.

> Also mention size is in bytes. Don't just hope the reader will examine
> every options' wording to ferret that out.

Fair enough. I'll adjust to:

  -s, --size=SIZE
          set or adjust the file size by SIZE bytes.  See also --io-blocks

thanks,
Pádraig.





Information forwarded to bug-coreutils <at> gnu.org:
bug#14686; Package coreutils. (Sat, 22 Jun 2013 08:43:02 GMT) Full text and rfc822 format available.

Message #13 received at 14686-done <at> debbugs.gnu.org (full text, mbox):

From: jidanni <at> jidanni.org
To: p <at> draigbrady.com
Cc: 713022 <at> bugs.debian.org, 14686-done <at> debbugs.gnu.org
Subject: Re: bug#14686: Bug#713022: truncate man and info pages must mention
 -s / -r mandatory
Date: Sat, 22 Jun 2013 16:42:01 +0800
I thought it would do the obvious, like touch does.


NAME
       touch - change file timestamps

SYNOPSIS
       touch [OPTION]... FILE...

DESCRIPTION
       Update  the  access  and modification times of each FILE to the current
       time.

       A FILE argument that does not exist is created empty, unless -c  or  -h
       is supplied.



NAME
       truncate - shrink or extend the size of a file to the specified size

SYNOPSIS
       truncate OPTION... FILE...

DESCRIPTION
       Shrink or extend the size of each FILE to the specified size

       A FILE argument that does not exist is created.



Who would have guessed that for some reason an argument is required,
I don't see why
$ truncate FILE
cannot just work too.
You know, to truncate the file, to zero bytes.
But hey I'm not a pro.




Information forwarded to bug-coreutils <at> gnu.org:
bug#14686; Package coreutils. (Sat, 22 Jun 2013 09:59:02 GMT) Full text and rfc822 format available.

Message #16 received at 14686-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: jidanni <at> jidanni.org
Cc: 713022 <at> bugs.debian.org, 14686-done <at> debbugs.gnu.org
Subject: Re: bug#14686: Bug#713022: truncate man and info pages must mention
 -s / -r mandatory
Date: Sat, 22 Jun 2013 10:58:21 +0100
On 06/22/2013 09:42 AM, jidanni <at> jidanni.org wrote:
> I thought it would do the obvious, like touch does.
> 
> 
> NAME
>        touch - change file timestamps
> 
> SYNOPSIS
>        touch [OPTION]... FILE...
> 
> DESCRIPTION
>        Update  the  access  and modification times of each FILE to the current
>        time.
> 
>        A FILE argument that does not exist is created empty, unless -c  or  -h
>        is supplied.
> 
> 
> 
> NAME
>        truncate - shrink or extend the size of a file to the specified size
> 
> SYNOPSIS
>        truncate OPTION... FILE...
> 
> DESCRIPTION
>        Shrink or extend the size of each FILE to the specified size
> 
>        A FILE argument that does not exist is created.
> 
> 
> 
> Who would have guessed that for some reason an argument is required,
> I don't see why
> $ truncate FILE
> cannot just work too.
> You know, to truncate the file, to zero bytes.
> But hey I'm not a pro.

I remember discussing the interface at the time.
The thinking was that since data was destroyed here,
an explicit -s0 was required to avoid typos like:

  truncate - s1M file

Behaving like you suggest would create '-' and 's1M'
and truncate 'file' without warning.

cheers,
Pádraig.




Information forwarded to bug-coreutils <at> gnu.org:
bug#14686; Package coreutils. (Sat, 22 Jun 2013 10:04:01 GMT) Full text and rfc822 format available.

Message #19 received at 14686-done <at> debbugs.gnu.org (full text, mbox):

From: jidanni <at> jidanni.org
To: Pádraig Brady <P <at> draigBrady.com>
Cc: 713022 <at> bugs.debian.org, 14686-done <at> debbugs.gnu.org
Subject: Re: bug#14686: Bug#713022: truncate man and info pages must mention
 -s / -r mandatory
Date: Sat, 22 Jun 2013 18:02:59 +0800
Well I bet that rm is as evil.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 20 Jul 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 299 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.