[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: option abbreviation exceptions
From: |
Pádraig Brady |
Subject: |
Re: option abbreviation exceptions |
Date: |
Tue, 30 Dec 2008 09:46:42 +0000 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20071008) |
Eric Blake wrote:
> src/truncate.c: printf (_("Usage: %s OPTION... FILE...\n"),
> program_name);
>
> Inconsistent formatting. Do we really want to require either -r or -s, or
> would it make sense to make OPTION optional, in which case the default is
> -s0?
I'm not sure that's a desirable default.
If one wants to truncate a file to 0, then the usual method is `> file`.
Having this as a default seems a little arbitrary/dangerous.
> Also, would it make sense to extend this such that:
>
> $ echo hi > foo
> $ truncate --size=0 < foo
>
> resizes foo to 0 bytes, by way of ftruncate on stdin? If so, maybe it makes
> sense to render this as:
>
> Usage: truncate [OPTION]... [FILE]...
Is supporting stdin a useful enhancement?
Maybe if you can get the shell to open
different files based on some condition,
though again that seems a little contrived.
cheers,
Pádraig.
- Suggestion for rmdir, Adam Jimerson, 2008/12/27
- Re: Suggestion for rmdir, Eric Blake, 2008/12/27
- Re: Suggestion for rmdir, Adam Jimerson, 2008/12/28
- Re: Suggestion for rmdir, Eric Blake, 2008/12/27
- Re: Suggestion for rmdir, Jim Meyering, 2008/12/27
- option abbreviation exceptions (was: Suggestion for rmdir), Eric Blake, 2008/12/29
- Re: option abbreviation exceptions, Eric Blake, 2008/12/29
- Re: option abbreviation exceptions, Jim Meyering, 2008/12/29
- Re: option abbreviation exceptions,
Pádraig Brady <=
- Re: option abbreviation exceptions, Eric Blake, 2008/12/30
- Re: option abbreviation exceptions, Jim Meyering, 2008/12/29