On Tue, Mar 20, 2012 at 2:12 PM, SanskritFritz <[email protected]>wrote:
> I'm trying to put together a conky-colors.fish file. conky-colors has
> that new style of parameters:
> --lang=<language>
> and so on.
> I want to have fish completions for this style, but cannot figure out
> what to do. This is so far what I came up with:
>
> complete --command conky-colors --no-files --long-option 'lang='
> --description 'Set language'
> complete --command conky-colors --no-files --condition
> '__fish_contains_opt lang=' --arguments 'bg de en et fr it pl pt ru es
> uk' --description 'Language'
>
> There are two problems with this:
> 1. fish automatically adds a space after completing "--lang= ", while
> conky-colors wants the parameter like "--lang=en". This is
> inconvenient and problematic since there is no clear indication that
> one has to delete the extra space with backspace.
> 2. I cannot use --long-option 'lang=LANGUAGE' because after an
> alt-backspace the __fish_contains_opt does not recongnise the
> "--lang=" option, hence the arguments do not show up on tab. This is a
> minor annoyance only, since having the "--lang=" prompt would be
> sufficient, as the "=" clearly indicates that an argument is expected.
>
> What should I do to eliminate the extra space in point 1 ?
>
>
Just for the record, I figured it out, I made things unnecessarily
complicated. Here is the working line:
complete --command conky-colors --no-files --long-option 'lang' --arguments
'bg de en et fr it pl pt ru es uk' --description 'Set language'
The clue was that no '=' is necessary in the long option 'lang', and the
--arguments had to be in the same complete command where the option is
defined and fish beautifully prompts the missing '=' with all the arguments.
Best regards
SanskritFritz
------------------------------------------------------------------------------
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