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

Re: completion with descriptions



> I took _aptitude as a template and came up with the following (see below)
> which works as wanted except for the fact that zsh inserts the _whole_
> line (command + description) instead of just the command. *sigh*

I solved it!

For the records, the problem was an extra space:
> cmds=( ${${(M)${(f)"$(gigaset --commands 2>/dev/null)"}:#* -- *}/(#b) (*[^ ]) #-- (*)/$match[1]:$match[2]:l})
                                                           right here ^^^
because my program doesn't begin the lines (in the list of possible
commands) with a space.

After also deleting the ":l" at the end zsh stopped converting all my
German words to lowercase, oh what wonder. :-)

So this works now beautifully:
 cmds=( ${${(M)${(f)"$(gigaset --commands 2>/dev/null)"}:#* -- *}/(#b)(*[^ ]) #-- (*)/$match[1]:$match[2]})

Thanks for all the help,
 Andy.

-- 
 "security is an exercise in applied paranoia"       -- Unknown



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