From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 4693ab90 for ; Fri, 22 Feb 2019 04:03:54 +0000 (UTC) Received: (qmail 25207 invoked by alias); 22 Feb 2019 04:03:39 -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: 44077 Received: (qmail 5431 invoked by uid 1010); 22 Feb 2019 04:03:39 -0000 X-Qmail-Scanner-Diagnostics: from mail-it1-f194.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(209.85.166.194):SA:0(-1.9/5.0):. Processed in 2.41205 secs); 22 Feb 2019 04:03:39 -0000 X-Envelope-From: dana@dana.is 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.166.194 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=A+pnrJ6UkoKIJWRAcKV5cu+1rNLH5vUQJeKRd01AUV8=; b=iJOk5jr+XqekehXbwk3MXSyE9atGZvN0j0yghBAc7UUaL/sB8m6ZS8pO2+bIxCDrd/ BmxQi8g0PtLDq7T0Z3a4a7wRZdKQQYV54vZYkNpn7+CksTWsiCB/zLfqEhgkECXMrD7f CafCKEj2vQZ3Oqn6MWLKy7GQMG7WKTGWUQoUqGD7LOBHywZYaDjaXsFosEDHRQkpAUzh p/VmEVOzBk+sFSRxJt8BEj9Q3GuLBtPRtwBy9LL/ehJN7PeFxuITOZ9Jzo8rSc92JsQ9 8IgfY3ngkTthGJPuLVwBRs0lztBoDZYqETR4qo9Dhr4+jEY0v+5FiNUhtoc+dWzU+GjC wttQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=A+pnrJ6UkoKIJWRAcKV5cu+1rNLH5vUQJeKRd01AUV8=; b=YncjAuAqcRzBTN7ZYgz4L4iXpApjKixDUuVgb3SeVXPdVUjv1f7hnAgJbHGpEJt4PG MovFOSbM1kw2lti2bNef5Nox94wnfwz+EV+1bKtbfU1THIrbqqchIParftbSSE2U2GgP fq7x9uV/ZNDdpixCQUi+0Q/XfzotG3CLtzNnhVJJhiDOnRYaGBSi5UEX1hOP6sTo+zKR BDlqX2QjVNnWpd8pRGfzsT1fSP274HMqNgd1Y5KLgWaUzmZjxL/xOVoAU/OFTHVJB72K RjOWtA9/SpQ+TN3K88ICE2FvobXATIZJAVlDv4pD+YaMqPcDMSgC3UyNe7c+t+/qlNGj xV+g== X-Gm-Message-State: AHQUAuaZ2lwo6HsaD7/fGvcmrhNOkPjg2YM9qpAHT9419H0cUc/ztFnq kFePiRSVBPruRaie9wszwBYGp5k4+ncRaA== X-Google-Smtp-Source: AHgI3IaJJJCaJnb3nBdmiok/OY/Dzvtbqss67Gkjp6n7Qt4vOLHvP0OwGNzJB/nrtH1+wp51U4Qezw== X-Received: by 2002:a24:3554:: with SMTP id k81mr1017081ita.41.1550808184415; Thu, 21 Feb 2019 20:03:04 -0800 (PST) From: dana Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: [PATCH] Completion: Fix _pick_variant checks for GNU, improve _getent Message-Id: <1E0D504D-11CF-4269-B21F-2F07EF7BEBFB@dana.is> Date: Thu, 21 Feb 2019 22:03:03 -0600 To: zsh workers X-Mailer: Apple Mail (2.3445.9.1) I noticed that GNU getent isn't detected correctly due to an out-of-date _pick_variant pattern. I've fixed that and a few others by changing = EGLIBC to just GLIBC. I've also added 'Free Soft' where it wasn't present, just in = case Since i was there, i partially fixed `getent -s` completion as well dana diff --git a/Completion/Unix/Command/_getent = b/Completion/Unix/Command/_getent index 7f4e8bc9c..0fb9a0af4 100644 --- a/Completion/Unix/Command/_getent +++ b/Completion/Unix/Command/_getent @@ -5,24 +5,28 @@ local services databases keys local -a args typeset -A opt_args =20 -if _pick_variant -r is_gnu gnu=3D'(GNU|EGLIBC|Gentoo)' unix --version; = then +if _pick_variant -r is_gnu gnu=3D'(Free Soft|GNU|GLIBC|Gentoo)' unix = --version; then args+=3D( '(- 1 *)'{-\?,--help}'[display help information]' '(- 1 *)--usage[display a short usage message]' '(- 1 *)'{-V,--version}'[display version information]' - {-s,--service=3D}'[specify service configuration to = use]:service:->services' + '*'{-s+,--service=3D}'[specify service configuration to use]: = :->services' '(-i --no-idn)'{-i,--no-idn}'[disable IDN encoding]' ) fi =20 -_arguments -C "$args[@]" \ +_arguments -s -S -C "$args[@]" \ '1:database:->databases' \ '*:key:->keys' && ret=3D0 =20 case $state in services) - services=3D( /lib/libnss*(-.:fr:t:s/libnss_//) ) - _wanted services expl service compadd ${services%-*} && ret=3D0 + # @todo GNU getent supports both `-s svc` and `-s db:svc`; we only = complete + # the former here + services=3D( = {,/usr}/lib/{,*-linux-gnu/}libnss_*(N-.:fr:t:s/libnss_//) ) + _wanted services expl 'service or database:service' \ + compadd ${(u)services%-*} \ + && ret=3D0 ;; databases) if [[ $is_gnu =3D gnu ]]; then diff --git a/Completion/Unix/Command/_iconv = b/Completion/Unix/Command/_iconv index d040be756..e6daad938 100644 --- a/Completion/Unix/Command/_iconv +++ b/Completion/Unix/Command/_iconv @@ -2,7 +2,7 @@ =20 local expl curcontext=3D"$curcontext" state line variant ret=3D1 =20 -if _pick_variant -r variant libiconv=3D'GNU*libiconv' = glibc=3D'(GNU*libc|EGLIBC|Gentoo)' unix --version; then +if _pick_variant -r variant libiconv=3D'GNU*libiconv' glibc=3D'(Free = Soft|GNU*libc|GLIBC|Gentoo)' unix --version; then local -a args local exargs=3D"-l --list -? --help --usage --version -V" =20 diff --git a/Completion/Unix/Command/_ldd b/Completion/Unix/Command/_ldd index 1de1659a5..3c7b088df 100644 --- a/Completion/Unix/Command/_ldd +++ b/Completion/Unix/Command/_ldd @@ -1,6 +1,6 @@ #compdef ldd =20 -if _pick_variant gnu=3D'(Free Soft|GNU|EGLIBC|Gentoo)' unix --version; = then +if _pick_variant gnu=3D'(Free Soft|GNU|GLIBC|Gentoo)' unix --version; = then args=3D( '(- *)--version[display version information]' '(- *)--help[display help information]' diff --git a/Completion/Unix/Command/_locale = b/Completion/Unix/Command/_locale index 59e04a282..a7fd88f65 100644 --- a/Completion/Unix/Command/_locale +++ b/Completion/Unix/Command/_locale @@ -3,7 +3,7 @@ local curcontext=3D"$curcontext" state state_descr line expl ret=3D1 typeset -A opt_args; local -a specs aopts =20 -if _pick_variant gnu=3D'(GNU|EGLIBC)' unix --version; then +if _pick_variant gnu=3D'(Free Soft|GNU|GLIBC)' unix --version; then =20 local exargs=3D"-? --help --usage -V --version" =20 diff --git a/Completion/Unix/Command/_localedef = b/Completion/Unix/Command/_localedef index 4d4b4bbe3..57637e3ec 100644 --- a/Completion/Unix/Command/_localedef +++ b/Completion/Unix/Command/_localedef @@ -3,7 +3,7 @@ local curcontext=3D"$curcontext" state line expl ret=3D1 typeset -A opt_args =20 -if _pick_variant gnu=3D'(GNU|EGLIBC)' unix --version; then +if _pick_variant gnu=3D'(Free Soft|GNU|GLIBC)' unix --version; then =20 local exargs=3D"-? --help --usage -V --version" _arguments -A "-*" -C -S -s \