zsh-workers
 help / color / mirror / code / Atom feed
From: "Jörg Sommer" <joerg@alea.gnuu.de>
To: zsh-workers@sunsite.dk
Subject: Re: [PATCH] Completion for chrt and ionice
Date: Mon, 22 Sep 2008 16:53:59 +0000 (UTC)	[thread overview]
Message-ID: <slrngdfjd7.1rn.joerg@alea.gnuu.de> (raw)
In-Reply-To: <slrngdckpi.23d.joerg@alea.gnuu.de>

Hi,

Jörg Sommer <joerg@alea.gnuu.de> wrote:
> commit 14b01890163625d1aa41610beb46e00155090308
> Author: Jörg Sommer <joerg@alea.gnuu.de>
> Date:   Sun Sep 21 15:51:36 2008 +0200
>
>     Completion for the Linux command ionice
>     
>     The command ionice is used on Linux to get or set the IO scheduling
>     attributes of a process.

This completion is not correct. Here are patches for it:

commit 0488523c0581a74a321d8c1e1852bc0aa58a2003
Author: Jörg Sommer <joerg@alea.gnuu.de>
Date:   Mon Sep 22 16:50:03 2008 +0200

    Reverse the order of unnamed priorities
    
    The completion was printed in reverse order. So add the entries in
    descending order to get the ascending ording in the help message.

diff --git a/Completion/Linux/Command/_ionice b/Completion/Linux/Command/_ionice
index e3b64aa..fd49dcd 100644
--- a/Completion/Linux/Command/_ionice
+++ b/Completion/Linux/Command/_ionice
@@ -9,7 +9,7 @@ _arguments \
   '-c[scheduling class]:class:(( 1\:realtime 2\:best-effort 3\:idle ))' \
   '-n[scheduling class priority]:class-pririty:((
     0\:high\ priority
-    {1..6}\:
+    {6..1}\:
     7\:low\ priority
   ))' \
   '*::command or pid:->cmd_or_prio' \

commit e2da3b57bfa4145811aa3b3921edb329b7bef1f7
Author: Jörg Sommer <joerg@alea.gnuu.de>
Date:   Mon Sep 22 16:54:28 2008 +0200

    The pid for -p must follow the option
    
    The process ID is the mandatory argument of the -p option.

diff --git a/Completion/Linux/Command/_ionice b/Completion/Linux/Command/_ionice
index fd49dcd..b7cd21b 100644
--- a/Completion/Linux/Command/_ionice
+++ b/Completion/Linux/Command/_ionice
@@ -1,23 +1,12 @@
 #compdef ionice
 
-local context state line
-typeset -A opt_args
-
 _arguments \
   '(* -)-h[display usage information]' \
-  '-p[interpret args as process ID]' \
+  '(*)-p[interpret args as process ID]:pid:_pids' \
   '-c[scheduling class]:class:(( 1\:realtime 2\:best-effort 3\:idle ))' \
   '-n[scheduling class priority]:class-pririty:((
     0\:high\ priority
     {6..1}\:
     7\:low\ priority
   ))' \
-  '*::command or pid:->cmd_or_prio' \
-  && return 0
-
-if (( $+opt_args[-p] ))
-then
-    _pids
-else
-    _normal
-fi
+  '*::command:_normal'

Bye, Jörg.
-- 
“…anytime you install something new on the Windows platform, you risk
spending the next five or six hours trying to figure out what happened”
            (Robert Roblin, Adobe)


  reply	other threads:[~2008-09-22 17:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-21 13:59 Jörg Sommer
2008-09-22 16:53 ` Jörg Sommer [this message]
2008-09-23  5:28   ` Clint Adams
2008-10-03  1:11   ` Jörg Sommer
2008-10-03  2:32     ` Clint Adams
2008-10-03 16:07       ` Jörg Sommer
2008-10-04 18:15         ` Clint Adams

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=slrngdfjd7.1rn.joerg@alea.gnuu.de \
    --to=joerg@alea.gnuu.de \
    --cc=zsh-workers@sunsite.dk \
    /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).