diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2003-04-22 12:32:43 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2003-04-22 12:32:43 +0000 |
commit | 0fed25f4616de9e97eae4478cd944e7bd7b3409b (patch) | |
tree | df9a368d070dcf9ec496eb05b25f92826cc6cbdd | |
parent | c1e87808acd58618fe3e7fdeda6eb731a3708a65 (diff) | |
download | zsh-0fed25f4616de9e97eae4478cd944e7bd7b3409b.tar.gz zsh-0fed25f4616de9e97eae4478cd944e7bd7b3409b.tar.xz zsh-0fed25f4616de9e97eae4478cd944e7bd7b3409b.zip |
18458: handle the prefix-needed style in _describe -o and new completion for renice
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | Completion/Base/Utility/_describe | 4 | ||||
-rw-r--r-- | Completion/Unix/Command/.distfiles | 2 | ||||
-rw-r--r-- | Completion/Unix/Command/_renice | 21 |
4 files changed, 32 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 21a0088bc..6d1fa5ea9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-04-22 Oliver Kiddle <opk@zsh.org> + + * 18458: Completion/Unix/Command/_renice: new completion for renice + + * 18458: Completion/Base/Utility/_describe: handle the prefix-needed style + 2003-04-19 Felix Rosencrantz <f_rosencrantz@yahoo.com> * 18455: Completion/Unix/Command/_screen, 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 |