From: Oliver Kiddle <okiddle@yahoo.co.uk>
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 [thread overview]
Message-ID: <27791.1088156389@trentino.logica.co.uk> (raw)
In-Reply-To: <20040624204736.GA10715@scowler.net>
Clint Adams wrote:
> > It doesn't with 4.1.1. I'll try current in a bit.
>
> % iconv -f <TAB>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)"$(</usr/lib/iconv/iconv_data)"}%%[[:blank:]]*} )
elif [[ -d $LOCPATH/iconv ]]; then # OSF
codeset=( $LOCPATH/iconv/*(N:t) )
next prev parent reply other threads:[~2004-06-26 11:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040616184219.GA7569@larve.net>
2004-06-16 23:52 ` Clint Adams
2004-06-17 13:03 ` Oliver Kiddle
2004-06-17 14:02 ` Clint Adams
2004-06-17 14:04 ` Clint Adams
2004-06-17 14:43 ` Oliver Kiddle
2004-06-17 15:01 ` Clint Adams
2004-06-24 20:47 ` Clint Adams
2004-06-25 9:39 ` Oliver Kiddle [this message]
2004-06-26 14:37 ` Clint Adams
2004-06-26 18:12 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=27791.1088156389@trentino.logica.co.uk \
--to=okiddle@yahoo.co.uk \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).