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.


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to