ng0 <contact....@cryptolab.net> writes:

> Hi,
>
> I'm currently working on a fish completion for a project I am
> involved in.
> I only worked on this (and fish scriptin in general) for two days
> now, there is one thing I can't figure out from all the already
> provided completions.
>
> How do I handle a completion which must have no space between
> long-option and some manually entered argument to it?
> Example:
>
> binary --qwert=asdf
>
> will work, while (and this happens currently):
>
> binary --qwert= asdf
>
> won't work.
>
> To clarify, binary has the long-option "qwert" and it only works
> with --qwert=some-valid-argument. If I pass:
> binary --qwert= some-valid-option  , both are regarded as options
> and therefore binary complains.
>
> Is there a way to erase the automatic inserted whitespace, and if
> so how do I achieve this?

To be clear, when you do something like

    complete -c $command -l qwert -a asdf

_without the "="_ this will make fish complete both `$command --qwert asdf` 
(without the
"=") and `$command --qwert=asdf`. This is how most programs behave, e.g.
GNU ls allows both "--quoting-style=c" and "--quoting-style c".

If your program doesn't, you might want to rethink that.

If you for some reason really don't want to add this, you'll want to
skip the "-l" option to complete and instead complete the option as
argument, i.e something like

    complete -c $command -a "--qwert=asdf"

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to