From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 646 invoked by alias); 13 Jun 2018 01:56:17 -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: 42992 Received: (qmail 13566 invoked by uid 1010); 13 Jun 2018 01:56:17 -0000 X-Qmail-Scanner-Diagnostics: from mail-io0-f170.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.223.170):SA:0(-1.9/5.0):. Processed in 1.935116 secs); 13 Jun 2018 01:56:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_PASS,T_DKIMWL_WL_MED,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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=0gTEnuasTCFcnZtx9sw2Yj/wsHKprtMXffIm1yRPIYc=; b=A3Cg4RrbSr1I2pkQA2T5pmMgbMR2irCJcsA+7RLVE6I6GCfiI272G2MLJMincJ2Om2 vvAnFWDfG6/l4AQlXRxQwq7Pp+cVmxByL27VF8xV5++TXMlU0LL5sH1W8HEOwT/pI4zO m4pZuaAmo+Mpt9IKKQoUMnjpJdMdm7x+4pZYAFMsFESjkYHcfOOLXrqpPZjtAXy35rh8 AUigpYVXeLRB0Wkbi6/HMDtVn1bEb7jE2RcG/6tn4qv0Ks4vqzXxQ21lYYnyPMByFPyG Mm5JyJB1JJ40OfwV4DSLmx4CXqwvZAvPruXJraGIGa8SqCnA9tRamCFVBbDi0pcMrO1/ LBMg== 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=0gTEnuasTCFcnZtx9sw2Yj/wsHKprtMXffIm1yRPIYc=; b=o3ScD5lxYygUWQQ+AEyiugDjEJK/7JmNUlIFY3b6XP2ZhYrigtxrAOggzZE2E6tkpQ xHNa0QCUxJA6EzJQnP8hbt7Vs9oAhyUHxAgh2bpnt07vcaC7BwjoLESMhmRoyVbbp5N+ Ghv/YnNEtwX0Eb3Cco0nmiV+3+zmfEPKaAiIYKxIsHL6VEpkKvEsT9LOOuaeNaHQxZwS HmopmQ3AbXFrMJoxYVaM0o/hC6dNSzTmHDQ4QjL9t0NMfwRXkN2dHDWI3tswkGGJZKkG samRvsgQ6ajufZgxtFUdEIlx7bJBAeP6y4HgEo9Xsdh0Ds++cJDSkJEhxPaEJz2FLGb8 K5cg== X-Gm-Message-State: APt69E2yaSPASsU0A26WrgSseFx9221PODjwe+mqUodI6SSNuU/DrW+b a7BUfcJWZ7DrBoRPQlra01k6W4HhIAQ= X-Google-Smtp-Source: ADUXVKLtSqGw892ezd729rlX09qRI8RZDz1OmMY3K/dJaNiUsXWzAjMwMtNNXFAwcgBvMUygiS+LjA== X-Received: by 2002:a5e:d703:: with SMTP id v3-v6mr3087690iom.78.1528854972323; Tue, 12 Jun 2018 18:56:12 -0700 (PDT) From: dana Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: [PATCH] Completion: Misc. _call_program fixes Message-Id: Date: Tue, 12 Jun 2018 20:56:11 -0500 To: Zsh workers X-Mailer: Apple Mail (2.3445.6.18) Hi there, This addresses some minor feedback regarding my disuse of _call_program = in the Darwin functions i added way back in January =E2=80=94 see workers # = 42235. It also fixes a mistake that those changes made me realise i'd made in = _bash =E2=80=94 if $words[1] needs quoted for eval, we should have already got it that = way from the command line. dana diff --git a/Completion/Darwin/Command/_nvram = b/Completion/Darwin/Command/_nvram index 8158eb9d2..8853b0bee 100644 --- a/Completion/Darwin/Command/_nvram +++ b/Completion/Darwin/Command/_nvram @@ -15,7 +15,7 @@ _arguments -s : \ && ret=3D0 =20 [[ $state =3D=3D variables-* ]] && { - tmp=3D( ${${(f)"$( command $service -p )"}%%[[:space:]]*} ) + tmp=3D( ${${(f)"$( _call_program variables $words[1] -p = )"}%%[[:space:]]*} ) =20 [[ $state =3D=3D variables-rw ]] && tmp=3D( ${^tmp}'::NVRAM variable value' ) diff --git a/Completion/Darwin/Command/_osascript = b/Completion/Darwin/Command/_osascript index 5e4a5f70c..5e6cebab5 100644 --- a/Completion/Darwin/Command/_osascript +++ b/Completion/Darwin/Command/_osascript @@ -18,7 +18,7 @@ case $state in # but adding the output of osalang makes this future-proof _values 'script language' \ AppleScript JavaScript 'Generic Scripting System' \ - ${(f)"$( command osalang 2> /dev/null )"} \ + ${(f)"$( _call_program languages command osalang )"} \ && ret=3D0 ;; modifiers) diff --git a/Completion/Darwin/Command/_say = b/Completion/Darwin/Command/_say index d687cfa11..1459c7372 100644 --- a/Completion/Darwin/Command/_say +++ b/Completion/Darwin/Command/_say @@ -28,9 +28,9 @@ case $state in # also, not every file format supports bit-rate values (( $+opt_args[--file-format] )) && { tmp=3D( ${(f)"$( - command $service \ + _call_program bit-rates $words[1] \ --file-format=3D${opt_args[--file-format]##*:} \ - --bit-rate=3D'?' 2> /dev/null + --bit-rate=3D'\?' )"} ) tmp=3D( ${tmp//[[:space:]]##/} ) } @@ -46,9 +46,9 @@ case $state in _message 'data format' && ret=3D0 else tmp=3D( ${(f)"$( - command $service \ + _call_program data-formats $words[1] \ --file-format=3D${opt_args[--file-format]##*:} \ - --data-format=3D'?' 2> /dev/null + --data-format=3D'\?' )"} ) tmp=3D( ${tmp//:/\\:} ) tmp=3D( ${^tmp/[[:space:]]##/[}\] ) @@ -56,13 +56,13 @@ case $state in fi ;; devices) - tmp=3D( ${(f)"$( command $service -a '?' 2> /dev/null )"} ) + tmp=3D( ${(f)"$( _call_program devices $words[1] -a '\?' )"} ) tmp=3D( ${tmp##[[:space:]]#[0-9]##[[:space:]]##} ) tmp=3D( ${tmp//:/\\:} ) _values 'audio device name or ID' $tmp && ret=3D0 ;; file-formats) - tmp=3D( ${(f)"$( command $service --file-format=3D'?' 2> /dev/null = )"} ) + tmp=3D( ${(f)"$( _call_program file-formats $words[1] = --file-format=3D'\?' )"} ) tmp=3D( ${tmp%%[[:space:]]##\(.*} ) tmp=3D( ${tmp//:/\\:} ) tmp=3D( ${^tmp/[[:space:]]##/[}\] ) @@ -76,7 +76,7 @@ case $state in && ret=3D0 ;; voices) - tmp=3D( ${(f)"$( command $service -v '?' 2> /dev/null )"} ) + tmp=3D( ${(f)"$( _call_program voices $words[1] -v '\?' )"} ) tmp=3D( ${tmp%%[[:space:]](#c2,)*} ) _values voice $tmp && ret=3D0 ;; diff --git a/Completion/Darwin/Command/_scselect = b/Completion/Darwin/Command/_scselect index 79df2f981..ff7d2610d 100644 --- a/Completion/Darwin/Command/_scselect +++ b/Completion/Darwin/Command/_scselect @@ -13,7 +13,7 @@ _arguments -s -S : \ # For some reason scselect expects location names to be encoded in = Mac OS # Roman; in order to prevent completed arguments from breaking the = tool, we'll # insert the UUID instead if the name would contain incompatible = characters - tmp=3D( ${(f)"$( command $service 2> /dev/null )"} ) + tmp=3D( ${(f)"$( _call_program locations $words[1] )"} ) tmp=3D( ${tmp[2,-1]} ) tmp=3D( ${tmp##[*[:space:]]##} ) tmp=3D( ${tmp//:/\\:} ) diff --git a/Completion/Unix/Command/_bash = b/Completion/Unix/Command/_bash index 260ca64fb..cc219f788 100644 --- a/Completion/Unix/Command/_bash +++ b/Completion/Unix/Command/_bash @@ -71,12 +71,12 @@ case $state in fi ;; set-options) - tmp=3D( ${(f)"$( _call_program set-options ${(q-)cmd} -c '"shopt = -o"' )"} ) + tmp=3D( ${(f)"$( _call_program set-options $cmd -c '"shopt -o"' )"} = ) tmp=3D( ${tmp%%[[:space:]]*} ) _values -w '`set` option' $tmp && ret=3D0 ;; shopt-options) - tmp=3D( ${(f)"$( _call_program shopt-options ${(q-)cmd} -c shopt = )"} ) + tmp=3D( ${(f)"$( _call_program shopt-options $cmd -c shopt )"} ) tmp=3D( ${tmp%%[[:space:]]*} ) _values -w '`shopt` option' $tmp && ret=3D0 ;;