On 30/06/2007, at 9:18 PM, Richard L. Hamilton wrote:
>> The option -/ is already used by star:
>>
>> -/ don't strip leading '/'s from file
>> names
>>
>> I believe that special characters like '/' should be
>> use for similar tasks
>> in order to make it easier to memorize options.
>>
>> I propose to use either a different character or to
>> introduce long options,
>> e.g. by switching from getopt() to getargs().
>
> What different character? Of the ASCII punctuation,
> I think only @%-_+=:,./ would not need quoting in some shell or
> another.
> "-+" or "-=" would be confusing (some progs have + and - options or
> -name=val
> options), "--" would be impossible (option terminator in case 1st
> file name starts with a dash), "-@" is already used for the file-
> like named
> extended attributes, "-:" would not work with getopt(), and "-_",
> "-,", or "-."
> are all very ugly or at least could be hard to see under some
> circumstances.
>
> I suppose -= is the least bad of the lot, but that's not saying much.
>
> Is there any firm guidance on the use of long options (or the
> addition of
> them to commands with short options, esp. in the case where there
> might be more long options than short options)? Because whether it
> is this
> or something else, ls is running low on options, and if one wants
> consistent
> similar options, that's just about impossible past a certain
> point. The
> problem is, for the consistent option consideration, a whole bunch of
> commands would have to be modified to add long option support.
There is something else about this proposal that needs consideration,
IMHO. It seems to be proposing that the options are:
-/ <verbose_flag>
examples:
-/ v
-/ c
-% <timestamp>
examples:
-% all
-% atime
So, not only does the proposal use somewhat obscure option characters
(at least one of which needs quoting in my shell), this would be the
first time (solaris) ls has options that take a parameter. I'm not
opposed in principle to this, but ls is arguably the single most
executed command in the entrire OS so I think careful consideration
should be given to any changes.
Boyd