From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24672 invoked from network); 30 May 2020 03:32:45 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 30 May 2020 03:32:45 -0000 Received: (qmail 25368 invoked by alias); 30 May 2020 03:32:36 -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: List-Unsubscribe: X-Seq: 45939 Received: (qmail 7871 invoked by uid 1010); 30 May 2020 03:32:36 -0000 X-Qmail-Scanner-Diagnostics: from mail-ot1-f49.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25821. spamassassin: 3.4.4. Clear:RC:0(209.85.210.49):SA:0(-1.7/5.0):. Processed in 1.891146 secs); 30 May 2020 03:32:36 -0000 X-Envelope-From: phy1729@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.210.49 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :mime-version:content-disposition; bh=mYXzTpOs2LaTmGyImcJccBCu3c7ZOVea825TLhetBQM=; b=AchGo5cTGg9JkFu41WqME4H3JNB83ZAPVRIAYX3g1N1/+/FddOKbA3FMHgKSOLYgX1 2W0FH2mwtt8UDppvCuufIKIPLNs2TSTpN/vz4xqhwooKdAQV5+mMmqz1QXGZYxvtWRNq x5oWbOGJtTiha94PVt5O7ErvYVsEX0om4wMCaLdd/uMx67AiYcWXhROGoIuv2TKQyWut j47hsIOuKEKISBCw2q/am8RHSS6zL93NFWbuG8GXuSnSpZONq0QZdMpgQ6MP0byIGOR8 qTZJcGwljJ77pb88QASwHu45WBEtxRLuFER3MypFhcv3rI+gB1NsyK+gAibzQRNtudPF OBmg== X-Gm-Message-State: AOAM532tS8ZByDlSsBZw0tgLOMm9s+SlE7RKNzxgZyW3dkmWKWQwt+QA gS/Ihh7UrXpe/6jeAFjipVng5oJkAQ8= X-Google-Smtp-Source: ABdhPJyeertUF8k4WauEMK9+156iR0o1MkGPOLO0z0egyGc5UxiCww0ab0E7lP3cnZfnAomzFkHdgw== X-Received: by 2002:a9d:6d85:: with SMTP id x5mr8427137otp.64.1590809520593; Fri, 29 May 2020 20:32:00 -0700 (PDT) Date: Fri, 29 May 2020 22:31:57 -0500 From: Matthew Martin To: zsh-workers@zsh.org Subject: [PATCH 1/2] Add _pgids type Message-ID: <20200530033157.GA78622@CptOrmolo.darkstar> Mail-Followup-To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Add a _pgids type with code taken from _pgrep. Not facny like _pids, but maintains _pgrep feature parity and uses _pgids where useful in current completers. --- Completion/Linux/Command/_ionice | 4 ++-- Completion/Unix/Command/_lsof | 2 +- Completion/Unix/Command/_pgrep | 2 +- Completion/Unix/Command/_renice | 2 +- Completion/Unix/Type/_pgids | 5 +++++ 5 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 Completion/Unix/Type/_pgids diff --git a/Completion/Linux/Command/_ionice b/Completion/Linux/Command/_ionice index d64f1c496..ba403ca56 100644 --- a/Completion/Linux/Command/_ionice +++ b/Completion/Linux/Command/_ionice @@ -17,14 +17,14 @@ _arguments -C -s -S \ '(- *)'{-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)'{-P-,--pgid=-}'[specify process group IDs]::process group:_pgids' \ '(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' + _pgids && ret=0 elif (( $+opt_args[args--u] || $+opt_args[args---uid] )); then _message -e uids 'user id' else diff --git a/Completion/Unix/Command/_lsof b/Completion/Unix/Command/_lsof index 754012e3b..8afb55e1d 100644 --- a/Completion/Unix/Command/_lsof +++ b/Completion/Unix/Command/_lsof @@ -34,7 +34,7 @@ _arguments -C -s -S $args \ '-f[inhibit listing of kernel file structure info]::info type:->file-structures' \ '+f[enable listing of kernel file structure info]::info type:->file-structures' \ '-F[select output fields]:fields:->fields' \ - '-g[select by process group id]::process group id' \ + '-g[select by process group id]::process group id:_sequence -s , _pgids' \ '(*)*-i[select internet files]::address:->addresses' \ '-K+[select listing of tasks of processes]::value:((i\:ignore\ tasks))' \ '-k[specify kernel name list file]:kernel file:_files' \ diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index 3b4d082a7..3f00b21dc 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -149,7 +149,7 @@ case $state in _pgrep_sequence ppids 'parent process ID' ppid ;; (pgid) - _pgrep_sequence pgids 'process group ID' pgid + _sequence _pgids ;; (projid) _pgrep_sequence project-ids 'project ID' project diff --git a/Completion/Unix/Command/_renice b/Completion/Unix/Command/_renice index cbdac8cae..3b0457348 100644 --- a/Completion/Unix/Command/_renice +++ b/Completion/Unix/Command/_renice @@ -12,7 +12,7 @@ else _describe -o option opts && ret=0 case ${(v)words[(I)-?]} in - -g) _message -e pgids 'process group ID' && ret=0 ;; + -g) _pgids && ret=0 ;; -u) _users && ret=0 ;; *) _pids && ret=0;; esac diff --git a/Completion/Unix/Type/_pgids b/Completion/Unix/Type/_pgids new file mode 100644 index 000000000..25d0c4af0 --- /dev/null +++ b/Completion/Unix/Type/_pgids @@ -0,0 +1,5 @@ +#autoload + +local expl + +_wanted pgids expl 'process group ID' compadd "$@" - ${(un)$(_call_program pgids ps -A -o pgid=)} -- 2.26.2