From 0fed25f4616de9e97eae4478cd944e7bd7b3409b Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 22 Apr 2003 12:32:43 +0000 Subject: 18458: handle the prefix-needed style in _describe -o and new completion for renice --- Completion/Base/Utility/_describe | 4 ++++ Completion/Unix/Command/.distfiles | 2 +- Completion/Unix/Command/_renice | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 Completion/Unix/Command/_renice (limited to 'Completion') 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 -- cgit 1.4.1