Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: PATCH: Re: sudo completion problem



>
> > - can somebody comment on long options case - is it
> expected behaviour?
> > Note, that I mean in this case "GNU long options". In this
> case, again,
> > _arguments should differentiate bewteen long and short
> case, again with
> > option. There are enough commands out there that use "long"
> options but
> > not GNU ones.
>
> It's not differences between long and short.  It's caused by the
> difference between traditional getopt and GNU getopt.
>

Yes, that is what I meant.

> By default, GNU getopt permutes argv and finds options on anywhere
> (until `--').
>
> If we can easily find out whether a command is linked with GNU getopt
> or not, we can (and should) complete correctly.
>

Well, hence I wrote "option for _arguments" for those commands, that use
GNU getopt.

> But I think the current behavior is not bad because it completes all
> correct (and some non-correct) candidates.  If _arguments behavior is
> changed as you said, it completes only subset of correct candidates.
>

No, it does not complete "corect" canditates. It completes totally wrong
set - options instead of arguments (files in case of diff). And this
change was introduced a couple of weeks ago ... and nobody has ever
complained before.

I think, old behaviour is "the least evil" case because it applies in
most cases. Apart from GNU getopt, there are commands that may intemix
options and arguments (with semantic - "this option applies to following
arguments" - do not have example ready) - but these are really special
cases and should be treated as such.

-andrej



Messages sorted by: Reverse Date, Date, Thread, Author