From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6151 invoked from network); 17 Sep 2001 16:16:45 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 17 Sep 2001 16:16:45 -0000 Received: (qmail 8840 invoked by alias); 17 Sep 2001 16:16:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15834 Received: (qmail 8825 invoked from network); 17 Sep 2001 16:16:38 -0000 Date: Mon, 17 Sep 2001 18:15:57 +0200 From: Bruno Bonfils To: zsh-workers Subject: Re: GPG completion function Message-ID: <20010917181557.A11187@debian-fr.org> Mail-Followup-To: Bruno Bonfils , zsh-workers References: <20010917000505.A5637@debian-fr.org> <3BA60396.7EB63F80@yahoo.co.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mP3DRpeJDSE+ciuQ" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3BA60396.7EB63F80@yahoo.co.uk>; from okiddle@yahoo.co.uk on Mon, Sep 17, 2001 at 03:07:18PM +0100 --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Le lun 17 septembre, Oliver Kiddle a =E9crit : > Bruno Bonfils wrote: > >=20 > > i submit you my first completion function (for gpg) > >=20 > > i don't have finish completely, but i send you in order > > to have comments/idea. >=20 > Looks good. Let us know when it is finished and we can include it in > the distribution. >=20 > > _any_ comments/ideas are welcome >=20 > Mainly it looks fine. I've added a few comments though within limits as > I'm not familiar with usage of gpg. >=20 > > local context state line >=20 > You only need these declared if you use states with _arguments. With -C > to _arguments the form would be slightly different actually. I suspect > the final version may use states though. >=20 i believe that some functions declared this var without using them. That's = why i write this line > > typeset -A opt_args >=20 > I think you only need this if you're going to use it. >=20 ok > > local keys_list >=20 > You don't need that any more but `name' needs to be declared local. >=20 yes, i forgot to remplace keys_list by name (grrr) > > # i must rewrite this line using pattern matching > > for name in `gpg --list-keys | awk '/^pub/ { print $NF }' | tr "<|>" = -d` > > do=09 > > compadd "$name"; > > done >=20 > As you say in the comment this could be rewritten with a zsh > substitution using pattern matching. You then shouldn't need the for > loop. It could do with then using _wanted with the compadd to assign a > tag and description. Also, you will need to redirect stderr from gpg > --list-keys so anyone who hasn't used gpg ever will get nothing > completed instead of error messages. i need to read and reread doc, i have some difficulty with pattern matching >=20 > > _arguments -C -s \ > > '-a[create ASCII armored output]' \ > > '-o[write output to file]:_files attachment:_files' \ >=20 > Your description on that line and others is messed up. I'd need to know > more about gpg usage but the file attachment maybe could be completed > with a '1' or '*' spec to _arguments. >=20 i don't understand completely. you mean that i delete all descriptions (which comes from gpg's manpage) ? > > '-u[use name as the user ID to sign]'\ >=20 > I think that needs to be -u+[... The plus indicates that the username > can be specified imediately after -u without a space, or a space can be > used. > ok > > '-s[sign a file]:file attachment:_files' \ >=20 > I see that options like this have a long form as well. Zsh 4.1.x can > recognise this and list them together so I'd suggest using something > like: '(-s --sign)'{-s,--sign}'[sign a file]:file attachment:_files' ok it is possible to tell zsh there maybe more than 1 file after the option ?=20 > It seems that you still have a few gpg options to add to it. There are > also > no exclusion lists - I take it that -e and -s can not be used together > for example. >=20 > I hope that is helpful >=20 Thank you very I'm sorry for my mistakes (i'm beginner, i use zsh since 2 months) and for my __very__ poor english > Oliver >=20 > _____________________________________________________________________ > This message has been checked for all known viruses by the=20 > MessageLabs Virus Scanning Service. For further information visit > http://www.messagelabs.com/stats.asp --=20 Bruno Bonfils Admin Sys Linux http://www.darksnow.org http://www.debian-fr.org Si la connerie =E9tait cot=E9e en bourse,tu serais incarc=E9r=E9 pour d=E9lit d'initi=E9... -+- EB in: Guide du Cabaliste Usenet - Les initi=E9s ont la cote -+- --mP3DRpeJDSE+ciuQ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Pour information voir http://www.gnupg.org iEYEARECAAYFAjumIb0ACgkQ8dj4f/OdzPUBKgCePaMtbg6So1K0cFm/3e5qaAJv ++MAoK0qjLUM2NYYCkaczyiRH95YLt74 =9FL4 -----END PGP SIGNATURE----- --mP3DRpeJDSE+ciuQ--