about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-04-22 12:32:43 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-04-22 12:32:43 +0000
commit0fed25f4616de9e97eae4478cd944e7bd7b3409b (patch)
treedf9a368d070dcf9ec496eb05b25f92826cc6cbdd /Completion
parentc1e87808acd58618fe3e7fdeda6eb731a3708a65 (diff)
downloadzsh-0fed25f4616de9e97eae4478cd944e7bd7b3409b.tar.gz
zsh-0fed25f4616de9e97eae4478cd944e7bd7b3409b.tar.xz
zsh-0fed25f4616de9e97eae4478cd944e7bd7b3409b.zip
18458: handle the prefix-needed style in _describe -o and new completion for renice
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/Utility/_describe4
-rw-r--r--Completion/Unix/Command/.distfiles2
-rw-r--r--Completion/Unix/Command/_renice21
3 files changed, 26 insertions, 1 deletions
diff --git a/Completion/Base/Utility/_describe b/Completion/Base/Utility/_describe
index eafdcc35b..f2f59085f 100644
--- a/Completion/Base/Utility/_describe
+++ b/Completion/Base/Utility/_describe
@@ -20,6 +20,10 @@ elif [[ "$1" = -t* ]]; then
   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
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles
index 1587bf64f..aecd9d9ba 100644
--- a/Completion/Unix/Command/.distfiles
+++ b/Completion/Unix/Command/.distfiles
@@ -19,5 +19,5 @@ _user_admin   _rsync        _arping	  _spamassassin _mtools       _ifconfig
 _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
 '
diff --git a/Completion/Unix/Command/_renice b/Completion/Unix/Command/_renice
new file mode 100644
index 000000000..cbdac8cae
--- /dev/null
+++ b/Completion/Unix/Command/_renice
@@ -0,0 +1,21 @@
+#compdef renice
+
+if [[ $CURRENT = 2 ]]; then
+  _message -e priority
+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