Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _time_zone gives me candidates other than timezones
- X-seq: zsh-workers 50017
- From: Jun T <takimoto-j@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: _time_zone gives me candidates other than timezones
- Date: Fri, 8 Apr 2022 16:30:26 +0900
- Archived-at: <https://zsh.org/workers/50017>
- In-reply-to: <CAH+w=7YLPLqgOcm6eiGKA67SHnWTR+ESm9c3r7G+L_=hTZ2yiw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <875yo3b3ka.fsf@smokey> <CAH+w=7adn97N6Mzu_r5_ukqeZfXrE1sULzgVpbuT+NnfsxzvYA@mail.gmail.com> <YkOgbFr9VG+WCqi2@pug.qqx.org> <D00CFC5E-4FE4-4874-8C13-A52EE1C7590B@kba.biglobe.ne.jp> <87bkxfw24f.fsf@smokey> <CAH+w=7YLPLqgOcm6eiGKA67SHnWTR+ESm9c3r7G+L_=hTZ2yiw@mail.gmail.com>
> 2022/04/07 5:11、Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>のメール:
>
> However, I did notice that if one explicitly attempts to start a
> timezone name with "z" or "l", the lower case file names are in fact
> offered (instead of, for example, correcting to Zulu).
Do you mean this?
If there is no time zone file/directoey staring with 'X', but there is
a non-timezone file 'xyz', say, then
TZ=x<TAB>
will still offer xyz.
diff --git a/Completion/Unix/Type/_time_zone b/Completion/Unix/Type/_time_zone
index c437252a8..a7b63adcd 100644
--- a/Completion/Unix/Type/_time_zone
+++ b/Completion/Unix/Type/_time_zone
@@ -6,4 +6,5 @@ if (( ! $+_zoneinfo_dirs )); then
_zoneinfo_dirs=( /usr/{share,lib,share/lib}/{zoneinfo*,locale/TZ}(/) )
fi
-_wanted time-zones expl 'time zone' _files -g '[A-Z]*' -W _zoneinfo_dirs "$@" -
+_wanted time-zones expl 'time zone' \
+ _files -g '[A-Z]*' -M 'm:{a-z}={A-Z}' -W _zoneinfo_dirs "$@" -
Messages sorted by:
Reverse Date,
Date,
Thread,
Author