From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8401 invoked by alias); 11 Mar 2014 17:05:07 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32472 Received: (qmail 6643 invoked from network); 11 Mar 2014 17:04:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SX6KsdRdlpSYWVefodL6LmVMX7qGl6ddT/wblEgFTOU=; b=KQHfJw1W1X7cId0KONZlMGLDThdt/hI1bTdUEHsICeu1OjQpUm4juXQ+/5ZGLqF5/7 GyiY/WGbVVVCvaOb2OjLhVSDLkk32Cm/fXbBdsJt2u9nOvIDsf0AHzrWheSWeWZy8DXu +hnRu+MqTfgTK8m5RYiiwXC+/KnePLZ8hxh6xokhgrOBlF2X7nsx+tqUAv47i0TrERP/ H+S5/OCMqoDCr2dwvSIBkrB+Akt2hLcAY5id2rG9CXKziHOa01JK7n7onj4bAR/hbqkf w9oHZOqPQu89dnfD+RaXq9/b/g6ZnxronvpxWK7Gu0VFTVobajtuUxHn73C57gyRF8Ia 5uyg== X-Received: by 10.68.130.202 with SMTP id og10mr48739580pbb.133.1394557490020; Tue, 11 Mar 2014 10:04:50 -0700 (PDT) From: Kosuke Asami To: zsh-workers@zsh.org Cc: Kosuke Asami Subject: [PATCH 1/3] _pgrep: add missing options in each environments Date: Wed, 12 Mar 2014 02:04:06 +0900 Message-Id: <1394557448-31011-2-git-send-email-tfortress58@gmail.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1394557448-31011-1-git-send-email-tfortress58@gmail.com> References: <1394557448-31011-1-git-send-email-tfortress58@gmail.com> pgrep options are different between operating systems. --- Completion/Unix/Command/_pgrep | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index e460202..e4bd2e2 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -5,18 +5,29 @@ typeset -A opt_args typeset -a arguments arguments=('-P[parent process id]:parent process id:->ppid' + '-F[match only in process in pidfile]:files:_files' '-g[match only in process group ids]:group:->pgid' '-G[match only real group id]:group:_groups' + '-j[match only in processes inside jails]' + '-M[extract the name list from the specified core]:files:_files' + '-N[extract the name list from the specified system]:files:_files' '-s[match only session id]:session id:->sid' '-t[match only controlled by terminal]:terminal device:->tty' + '-T[match only in processes specified routing table in rtable]' '-u[match only effective user id]:user:_users' '-U[match only real user id]:user:_users' '(-n)-o[oldest process]' '(-o)-n[newest process]' + '-a[include process ancestors in the match list]' + '-c[print a count of matching processes]' '-f[match against full command line]' + '-i[ignore case distinctions]' + '-I[confirmation before attempting to single each process]' + '-L[given pidfile must be locked]' + '-q[do not write anything to standard output]' + '-S[search also in system processes]' '-v[negate matching]' - '-x[match exactly]' - '*:process name:->pname') + '-x[match exactly]') if [[ $service == 'pkill' ]] then @@ -27,6 +38,27 @@ then '-l[list name in addition to id]') fi +local optchars +case "$OSTYPE" in + linux*) + optchars="cflvxdnoPgsuUGt" + ;; + freebsd*) + optchars="LSafilnoqvxFGMNPUdgjstu" + ;; + openbsd*) + optchars="flnoqvxdGgPsTtUu" + ;; + darwin*) + optchars="LafilnoqvxFGPUdgtu" + ;; + *) + optchars="flvxdnoPgsuUGt" + ;; +esac +arguments=( ${(M)arguments:#(|\*)(|\(*\))-[$optchars]*} + '*:process name:->pname') + _arguments -s -w $arguments && ret=0 case $state in -- 1.9.0