zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers@zsh.org
Subject: PATCH: _schedtool: Add schedtool completion.
Date: Sun, 14 Aug 2011 16:10:31 +0200	[thread overview]
Message-ID: <1313331031-3388-1-git-send-email-mikachu@gmail.com> (raw)

Not sure how commonly installed this util is, since util-linux has chrt
and taskset.

---
 Completion/Zsh/Command/.distfiles |    1 +
 Completion/Zsh/Command/_schedtool |   25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 0 deletions(-)
 create mode 100644 Completion/Zsh/Command/_schedtool

diff --git a/Completion/Zsh/Command/.distfiles b/Completion/Zsh/Command/.distfiles
index 6feec49..3981f74 100644
--- a/Completion/Zsh/Command/.distfiles
+++ b/Completion/Zsh/Command/.distfiles
@@ -23,6 +23,7 @@ _print
 _prompt
 _read
 _sched
+_schedtool
 _set
 _setopt
 _source
diff --git a/Completion/Zsh/Command/_schedtool b/Completion/Zsh/Command/_schedtool
new file mode 100644
index 0000000..869f146
--- /dev/null
+++ b/Completion/Zsh/Command/_schedtool
@@ -0,0 +1,25 @@
+#compdef schedtool
+
+local curcontext="$curcontext" line state ret=1
+
+_arguments -C \
+  '(-p    -F -R -B -I -D -M)-N[for SCHED_NORMAL]' \
+  '(   -N    -R -B -I -D -M)-F[for SCHED_FIFO]' \
+  '(   -N -F    -B -I -D -M)-R[for SCHED_RR]' \
+  '(-p -N -F -R    -I -D -M)-B[for SCHED_BATCH]' \
+  '(   -N -F -R -B    -D -M)-I[for SCHED_ISO]' \
+  '(-p -N -F -R -B -I    -M)-D[for SCHED_IDLEPRIO]' \
+  '(   -N -F -R -B -I -D   )-M[for manual mode; raw number for POLICY]:raw policy number' \
+  '(   -N       -B    -D   )-p[usually 1-99; only for FIFO, RR or ISO]:static priority' \
+  '-a[cpu affinity]:mask or list' \
+  '-n[set niceness to NICE_LEVEL]:priority' \
+  '-e[start COMMAND with specified policy/priority]:program: _command_names -e:*::program arguments: _normal' \
+  '-v[be verbose]' \
+  '*:processes:->processes' && ret=0
+
+if [[ -n "$state" ]]; then
+  _alternative \
+    'processes:: _pids' && ret=0
+fi
+
+return ret
-- 
1.7.5.4


                 reply	other threads:[~2011-08-14 14:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1313331031-3388-1-git-send-email-mikachu@gmail.com \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).