about summary refs log tree commit diff
path: root/Completion/Linux/Command/_ionice
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2017-09-18 15:58:14 +0200
committerOliver Kiddle <opk@zsh.org>2017-09-18 15:58:14 +0200
commitda085b7a20729401c725f91ae930200d0deda64f (patch)
treed4c3e73d351769ba3f14bc51f34e296db3175b1d /Completion/Linux/Command/_ionice
parentb138acf42e52dcdf470f5001aa7ffa1e70eb60f3 (diff)
downloadzsh-da085b7a20729401c725f91ae930200d0deda64f.tar.gz
zsh-da085b7a20729401c725f91ae930200d0deda64f.tar.xz
zsh-da085b7a20729401c725f91ae930200d0deda64f.zip
update completion of options for util-linux 2.30.1
Diffstat (limited to 'Completion/Linux/Command/_ionice')
-rw-r--r--Completion/Linux/Command/_ionice35
1 files changed, 29 insertions, 6 deletions
diff --git a/Completion/Linux/Command/_ionice b/Completion/Linux/Command/_ionice
index a3d49ec99..d64f1c496 100644
--- a/Completion/Linux/Command/_ionice
+++ b/Completion/Linux/Command/_ionice
@@ -1,12 +1,35 @@
 #compdef ionice
 
-_arguments \
-  '(* -)-h[display usage information]' \
-  '(*)-p[interpret args as process ID]:pid:_pids' \
-  '-c+[scheduling class]:class:(( 1\:realtime 2\:best-effort 3\:idle ))' \
-  '-n+[scheduling class priority]:class-priority:((
+local curcontext="$curcontext" state line expl ret=1
+local -A opt_args
+
+_arguments -C -s -S \
+  '(H -c --class)'{-c+,--class=}'[scheduling class]:class:((0\:none 1\:realtime 2\:best-effort 3\:idle))' \
+  '(H -m --classdata)'{-n+,--classdata=}'[scheduling class priority]:class-priority:((
     0\:high\ priority
     {6..1}\:
     7\:low\ priority
   ))' \
-  '*::command:_normal'
+  '(H -t --ignore)'{-t,--ignore}'[ignore failures]' \
+  '(H)*:: :->args' \
+  + 'H' \
+  '(- *)'{-V,--version}'[display version information]' \
+  '(- *)'{-h,--help}'[display help information]' \
+  + '(args)' \
+  '(H)'{-p-,--pid=-}'[interpret args as process ID]::process id:_pids' \
+  '(H)'{-P-,--pgid=-}'[specify process group IDs]::process group' \
+  '(H)'{-u-,--uid=-}'[act on running process owned by specified users]::user id' && ret=0
+
+if [[ -n $state ]]; then
+  if (( $+opt_args[args--p] || $+opt_args[args---pid] )); then
+    _pids && ret=0
+  elif (( $+opt_args[args--P] || $+opt_args[args---pgid] )); then
+    _message -e pgids 'process group'
+  elif (( $+opt_args[args--u] || $+opt_args[args---uid] )); then
+    _message -e uids 'user id'
+  else
+    _normal && ret=0
+  fi
+fi
+
+return ret