zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: prefix-needed ignored by _describe -o
@ 2003-04-22 12:16 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2003-04-22 12:16 UTC (permalink / raw)
  To: Zsh workers

The documentation for _describe -o says that it will check, among
others, the prefix-needed style. But it doesn't. This patch makes it do
so. It also adds a completion for renice which uses _describe for
options and thus alerted me to the problem.

Oliver

Index: Completion/Base/Utility/_describe
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_describe,v
retrieving revision 1.13
diff -u -r1.13 _describe
--- Completion/Base/Utility/_describe	23 May 2002 12:16:42 -0000
1.13
+++ Completion/Base/Utility/_describe	22 Apr 2003 10:59:47 -0000
@@ -20,6 +20,10 @@
   shift
 fi
 
+[[ "$_type" = options && ! -prefix [-+]* ]] && \
+    zstyle -T ":completion:${curcontext}:options" prefix-needed &&
+        return 1
+
 # Do the tests. `showd' is set if the descriptions should be shown.
 
 zstyle -T ":completion:${curcontext}:$_type" verbose && _showd=yes
Index: Completion/Unix/Command/.distfiles
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/.distfiles,v
retrieving revision 1.39
diff -u -r1.39 .distfiles
--- Completion/Unix/Command/.distfiles	19 Apr 2003 17:23:47 -0000
1.39
+++ Completion/Unix/Command/.distfiles	22 Apr 2003 10:59:47 -0000
@@ -19,5 +19,5 @@
 _fsh          _chkconfig    _cdcd         _irssi        _mysqldiff
_sccs
 _netcat       _larch        _texinfo	  _figlet       _elinks
_tidy
 _global       _global_tags  _ant          _lsof         _mt
_xmlsoft
-_perforce     _python       _antiword     _screen
+_perforce     _python       _antiword     _screen       _renice
 '
Index: Completion/Unix/Command/_renice
===================================================================
RCS file: Completion/Unix/Command/_renice
diff -N Completion/Unix/Command/_renice
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Completion/Unix/Command/_renice	22 Apr 2003 10:59:47 -0000
@@ -0,0 +1,22 @@
+#compdef renice
+
+if [[ $CURRENT = 2 ]]; then
+  _message -e priority
*  return
+else
+  local opts ret=1
+  opts=(
+    '-g:interpret args as process group IDs'
+    '-u:interpret args as user names'
+    '-p:interpret args as process IDs'
+  )
+  _describe -o option opts && ret=0
+
+  case ${(v)words[(I)-?]} in
+    -g) _message -e pgids 'process group ID' && ret=0 ;;
+    -u) _users && ret=0 ;;
+    *)  _pids && ret=0;;
+  esac
+fi
+
+return ret


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-22 12:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-22 12:16 PATCH: prefix-needed ignored by _describe -o Oliver Kiddle

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).