Given the description of 'complete' I would have expected it to behave
differently, given:

    complete (-c|--command|-p|--path) COMMAND [(-s|--short-option)
SHORT_OPTION] [(-l|--long-option|-o|--old-option) LONG_OPTION
[(-a||--arguments) OPTION_ARGUMENTS] [(-d|--description) DESCRIPTION]

(which I interpret as  ...[(-l|--long-option|-o|--old-option) LONG_OPTION
[(-a||--arguments) OPTION_ARGUMENTS]]... (note the added ] at the end), but
perhaps my bracket placement is incorrect)

I would have expected your second line:

    complete --command foo --no-files --arguments '(sleep 5s)'
--description 'slept'

To be invalid since '-a' does not follow either '-l' or '-o' and I also
dont see the logic in that a script given to '-a' ever returning a list of
options.

So I would say that the behavior is incorrect, but perhaps it is meant to
work in an other way?

On Fri, Apr 13, 2012 at 10:50 AM, Maxim Gonchar <[email protected]> wrote:

> > So it is intentional then. How can I prevent this behaviour? I toyed with
> > __fish_contains_opt, but that is not optimal. I will try to parse
> > commandline --current-token but it gets too complicated, it defies the
> > simplicity of completions.
> Well, the completions mechanism should be updated somehow. I also see some
> problems and limitations, that broke simplicity.
> I hope I will do it sometime, if no one do it before.
>
> Maxim
>
>
> ------------------------------------------------------------------------------
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2
> _______________________________________________
> Fish-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to