Fabian Homborg <fhomb...@gmail.com> writes:

> 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"

The last recommendation partially solved my problem. However it
introduces the new problem of the option being the default
completion after hitting the tab key.
Will completions work without the binary being in someones path?
If so I can link to the repository in the next message so that
it's not all theoretic.

I will work with this approach and when I get stuck again I will
get back to you.

Thanks!
-- 
♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/

------------------------------------------------------------------------------
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