From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26695 invoked from network); 26 Jun 2004 11:17:36 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.85) by ns1.primenet.com.au with SMTP; 26 Jun 2004 11:17:36 -0000 Received: (qmail 27879 invoked from network); 26 Jun 2004 12:17:07 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Jun 2004 12:17:07 -0000 Received: (qmail 11639 invoked by alias); 26 Jun 2004 11:08:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20101 Received: (qmail 11629 invoked from network); 26 Jun 2004 11:08:27 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.85) by sunsite.dk with SMTP; 26 Jun 2004 11:08:27 -0000 Received: (qmail 15827 invoked from network); 26 Jun 2004 11:59:43 -0000 Received: from mail36.messagelabs.com (193.109.254.211) by a.mx.sunsite.dk with SMTP; 26 Jun 2004 11:59:39 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-13.tower-36.messagelabs.com!1088156434!7257857 X-StarScan-Version: 5.2.10; banners=-,-,- X-Originating-IP: [158.234.9.163] Received: (qmail 1424 invoked from network); 25 Jun 2004 09:40:34 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-13.tower-36.messagelabs.com with SMTP; 25 Jun 2004 09:40:34 -0000 Received: from trentino.logica.co.uk ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id i5P9eXUI021244 for ; Fri, 25 Jun 2004 10:40:34 +0100 Received: from trentino.logica.co.uk (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id 727817970C6A for ; Fri, 25 Jun 2004 11:39:49 +0200 (CEST) X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <20040624204736.GA10715@scowler.net> From: Oliver Kiddle References: <20040616184219.GA7569@larve.net> <20040616235219.GA18736@scowler.net> <2794.1087477429@trentino.logica.co.uk> <20040617140223.GA27353@scowler.net> <3672.1087483410@trentino.logica.co.uk> <20040617150150.GA31176@scowler.net> <20040624204736.GA10715@scowler.net> To: zsh-workers@sunsite.dk Subject: Re: Bug#254801: zsh: iconv code set completion case insensitivity Date: Fri, 25 Jun 2004 11:39:49 +0200 Message-ID: <27791.1088156389@trentino.logica.co.uk> X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 Clint Adams wrote: > > It doesn't with 4.1.1. I'll try current in a bit. > > % iconv -f Usage: iconv [-c] [-s] [-f fromcode] [-t tocode] [file ...] I don't quite understand why you got the usage message four times. Anyway, can you try the following patch. I've just noticed that the Sourceforge compile farm has Solaris 9 machines but their iconv is identical to that of Solaris 8. So we probably need to just try running iconv -l. Does /usr/lib/iconv/iconv_data exist? What are the -c and -s options - the same as GNU iconv's? Oliver Index: Completion/Unix/Command/_iconv =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_iconv,v retrieving revision 1.4 diff -u -r1.4 _iconv --- Completion/Unix/Command/_iconv 17 Jun 2004 13:12:26 -0000 1.4 +++ Completion/Unix/Command/_iconv 25 Jun 2004 09:26:07 -0000 @@ -1,9 +1,10 @@ #compdef iconv local expl curcontext="$curcontext" state line codeset ret=1 +local -a args local LOCPATH="${LOCPATH:-/usr/lib/nls/loc}" -if _pick_variant gnu=GNU unix --version; then +if _pick_variant gnu=GNU unix --version 2>/dev/null; then local exargs="--list -? --help --usage --version -V" _arguments -C -S -s \ @@ -31,14 +32,18 @@ return ret else - - _arguments -C \ - '-f[specify code set of input file]:code set:->codeset' \ - '-t[specify code set for output]:code set:->codeset' \ - '1:file:_files' && return 0 + [[ $OSTYPE = solaris2.9 ]] && + args=( '(-l)'{-c,-s} '(- 1)-l[list available code sets]' ) + + _arguments -C $args \ + '(-l)-f[specify code set of input file]:code set:->codeset' \ + '(-l)-t[specify code set for output]:code set:->codeset' \ + '(-l)1:file:_files' && return 0 if [[ $state = codeset ]]; then - if [[ -f /usr/lib/iconv/iconv_data ]]; then # IRIX & Solaris + if [[ $OSTYPE = solaris2.9 ]]; then + codeset=( $(_call_program codesets iconv -l) ) + elif [[ -f /usr/lib/iconv/iconv_data ]]; then # IRIX & Solaris codeset=( ${${(f)"$(