From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1525 invoked from network); 30 Sep 1999 02:11:39 -0000 Received: from mail2.primenet.com.au (HELO primenet.com.au) (?npEoSX/7P32tLsFzs3wbB2Coz8ABvu5I?@203.24.36.6) by ns1.primenet.com.au with SMTP; 30 Sep 1999 02:11:39 -0000 Received: (qmail 13558 invoked from network); 29 Sep 1999 20:12:17 -0000 Received: from sunsite.auc.dk (130.225.51.30) by mail2.primenet.com.au with SMTP; 29 Sep 1999 20:12:17 -0000 Received: (qmail 20505 invoked by alias); 29 Sep 1999 19:50:49 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2632 Received: (qmail 20490 invoked from network); 29 Sep 1999 19:50:45 -0000 To: Francis GALIEGUE Cc: zsh-users@sunsite.auc.dk Subject: Re: zsh and RPM: a case of study (for me) References: <37F26815.B5B90B8@mandrakesoft.com> X-no-archive: yes From: Chmouel Boudjnah Date: 29 Sep 1999 21:53:50 +0200 In-Reply-To: Francis GALIEGUE's message of "Wed, 29 Sep 1999 19:27:17 +0000" Message-ID: User-Agent: Gnus/5.070096 (Pterodactyl Gnus v0.96) XEmacs/21.1 (Arches) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Francis GALIEGUE 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 [ --target=whatever ] > to complete on *.spec files, look in my directory i use this for rpm : # _rpmOPT=($(<$HOME/.sh/clist/rpm_options)) _rpmQUE=($(<$HOME/.sh/clist/rpm_query)) 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/ --Chmouel