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

Re: zsh and RPM: a case of study (for me)

Francis GALIEGUE <fg@xxxxxxxxxxxxxxxx> writes:

How it's you ;),

> Just for example, lets say I have a:
> compctl -X bar -k "(a b)" foo

small x "-x"

> how can I do so that it's actually a completion widget which returns the
> "(a b)" stuff? Or am I missing the point completely?

it's depend what you want the  your command if you want the first or
second argument.

> Another probably dumb example: I'm used to the bash key sequences
> (C-x|Esc)(!|@|~|/|$), how can I reproduce them in a simple manner?

i don't understand what you want to reproduce excatly ?

> And for the hardest part now: a set of functions|widgets|whatever for
> rpm...
> I make RPMs quite often indeed, and I'd like:
> rpm -b<whatever> [ --target=whatever ] <TAB>
> to complete on *.spec files,

look in my directory i use this for rpm :


function _rpmAVAIL { reply=($(rpm -qa)) }

compctl  -f -x 's[--]' -s "$_rpmOPT" - \
	'W[1,-e]' -K _rpmAVAIL - \
    'p[1] s[-b]' -k '(p l c i b a)' - \
    "c[-1,--queryformat]" -k _rpmQUE -\
    'W[1,-q*] C[-1,-([^-]*|)f*]' -f - \
    'W[1,-qa]' -k '( )' - \
    'W[1,-b*], c[-1,--rmsource]' -g '*.spec' + -f - \
    "c[-1,--recompile], c[-1,--rebuild]" -g '*.src.rpm' + -f -\
    'W[1,-(i|U|q)*], W[1,-([^-]*|)p*]' -g '*.rpm' + -f -\
    -- rpm

unset _rpmOPT

when rpm_options contains :

oldpackage percent replacefiles replacepkgs noscripts root excludedocs includedocs test upgrade test clean short-circuit sign recompile rebuild resign querytags queryformat version help quiet rcfile force hash short-circuit rmsource nodeps

and rpm_query rpm --querytags

MandrakeSoft          http://www.mandrakesoft.com/

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