Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: complete value of $TZ



I've had to set $TZ a few times recently and it would make sense to use
the completion from _zdump for this, so here's the small patch for
that.

Oliver

Index: Completion/Unix/Command/_zdump
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_zdump,v
retrieving revision 1.1
diff -u -r1.1 _zdump
--- Completion/Unix/Command/_zdump	2001/04/02 12:07:26	1.1
+++ Completion/Unix/Command/_zdump	2001/10/26 12:54:43
@@ -1,9 +1,5 @@
 #compdef zdump
 
-if (( ! $+_zoneinfo_dirs )); then
-  _zoneinfo_dirs=( /usr/{share,lib,share/lib}/zoneinfo*(/) )
-fi
-
 _arguments '-v[lowest possible]' \
            '-c[cutoff]:cutoff year:' \
-           '*:timezone:_files -W _zoneinfo_dirs'
+           '*:timezone:_time_zone'
Index: Completion/Unix/Type/_time_zone
===================================================================
RCS file: _time_zone
diff -N _time_zone
--- /dev/null	Thu May 24 22:33:05 2001
+++ _time_zone	Fri Oct 26 05:54:43 2001
@@ -0,0 +1,9 @@
+#compdef
+
+local expl
+
+if (( ! $+_zoneinfo_dirs )); then
+  _zoneinfo_dirs=( /usr/{share,lib,share/lib}/zoneinfo*(/) )
+fi
+
+_wanted timezone expl 'time zone' _files -W _zoneinfo_dirs
Index: Completion/Zsh/Context/_value
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Context/_value,v
retrieving revision 1.2
diff -u -r1.2 _value
--- Completion/Zsh/Context/_value	2001/08/07 19:29:14	1.2
+++ Completion/Zsh/Context/_value	2001/10/26 12:54:43
@@ -60,4 +60,6 @@
 
 _value:DISPLAY() { _x_display "$@" }
 
+_value:TZ() { _time_zone "$@" }
+
 _value "$@"

_____________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp



Messages sorted by: Reverse Date, Date, Thread, Author