coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] ls: add --sort=width (-W) option to sort by filename width


From: Glenn Golden
Subject: Re: [PATCH] ls: add --sort=width (-W) option to sort by filename width
Date: Thu, 15 Apr 2021 14:27:23 -0600
User-agent: Cyrus-JMAP/3.5.0-alpha0-273-g8500d2492d-fm-20210323.002-g8500d249

On Thu, Apr 15, 2021, at 08:41, Michael Stone wrote:
> On Thu, Apr 15, 2021 at 07:56:30AM -0500, Carl Edquist wrote:
> >Anyway, after some time if you find yourself wanting to use the feature a
> >lot but being bored to type --sort=width each time, maybe that will
> >provide more inclination to add a short option...
> >
> >("Yes," you might say, "but that's what shell aliases are for."
> >
> >But...don't you like munging short options? :)
> >
> >"Search your feelings, Luke."
> >
> >...
> >
> >Lastly, in the help / manpage output, "width" will looks a bit lonely
> >among the sort options, as the only one without an accompanying short
> >option:
> >
> >    --sort=WORD      sort by WORD instead of name: none (-U), size (-S),
> >                       time (-t), version (-v), extension (-X), width
> >
> >And, it might be worth noting that in the help / manpage output, the
> >_only_ documentation (although pithy) for what the different sort types
> >actually do is in the description for their corresponding short options.
> >
> >So, you lose the chance to document it in the --help output if you omit
> >the short opiton.
> >
> >...
> >
> >
> >What do you think?  :)
> 
> I think it's a heck of a lot easier to add short options than it is to 
> remove them, and that there are more ideas for things to do than there 
> are letters. I'm on the side of make it a long option. In a few years if 
> it's a commonly used thing with a groundswell of demand for a short 
> option, it can always be added. There are a lot of existing short 
> options that aren't used very often, are redundant, or are simply 
> confusing, and it would be really nice (but impossible) to have those 
> letters back. Continuing the tradition of burning short options by 
> default just makes the hole deeper.
> 
> 

Agree. As much a I like this new sorting capability, short options are
a valuable syntax resource. Imo, use one up only if it becomes really
popular. Until then, a shell alias or function can sweeten it up for 
afficianados.



reply via email to

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