From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5659 invoked by alias); 26 Dec 2017 00:29:20 -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: 42168 Received: (qmail 3741 invoked by uid 1010); 26 Dec 2017 00:29:20 -0000 X-Qmail-Scanner-Diagnostics: from rcpt-mqugw.biglobe.ne.jp 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(133.208.100.2):SA:0(-2.6/5.0):. Processed in 3.668328 secs); 26 Dec 2017 00:29:20 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: takimoto-j@kba.biglobe.ne.jp X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Biglobe-Sender: From: "Jun T." Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [PATCH] avoid localized output from external commands in a few completion Message-Id: <42959CB1-DB49-474F-86DA-DD4C08D1CE43@kba.biglobe.ne.jp> Date: Tue, 26 Dec 2017 08:40:06 +0900 To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.3273) X-Biglobe-Spnum: 62485 In some recent Linux distributions, output from commands like 'nm --help' is localized and can't be analyzed correctly by completion scripts. We need to reset LC_MESSAGES. diff --git a/Completion/Linux/Command/_lsblk = b/Completion/Linux/Command/_lsblk index f37305445..f6bf9250d 100644 --- a/Completion/Linux/Command/_lsblk +++ b/Completion/Linux/Command/_lsblk @@ -44,7 +44,7 @@ case $state in ;| column*) values=3D( - ${${${${(f)"$(_call_program columns lsblk = -h)"}[(r)Available*,-3]## #}[2,-1]//:/\\:}/ /:} + ${${${${(f)"$(_call_program columns LC_MESSAGES=3DC lsblk = -h)"}[(r)Available*,-3]## #}[2,-1]//:/\\:}/ /:} ) _describe -t fields column values -M 'm:{a-z}=3D{A-Z}' $suf -F = dedup && ret=3D0 ;; diff --git a/Completion/Unix/Command/_nm b/Completion/Unix/Command/_nm index 146a69e8a..b195a66ef 100644 --- a/Completion/Unix/Command/_nm +++ b/Completion/Unix/Command/_nm @@ -64,7 +64,7 @@ if _pick_variant -r variant binutils=3DGNU = elftoolchain=3Delftoolchain elfutils=3Delfu '--plugin[load specified plugin]:plugin' '--special-syms[include special symbols in the output]' '--synthetic[display synthetic symbols as well]' - "--target=3D[target object = format]:targets:(${${(@M)${(f)$(_call_program targets nm = --help)}:#*supported targets:*}##*: })" + "--target=3D[target object = format]:targets:(${${(@M)${(f)$(_call_program targets LC_MESSAGES=3DC nm = --help)}:#*supported targets:*}##*: })" '--with-symbol-versions[display version strings after symbol = names]' ) ;; diff --git a/Completion/Unix/Command/_objdump = b/Completion/Unix/Command/_objdump index e012b4cbc..9744d3177 100644 --- a/Completion/Unix/Command/_objdump +++ b/Completion/Unix/Command/_objdump @@ -92,13 +92,13 @@ case "$state" in _values -s , "dwarf section" rawline decodedline info abbrev = pubnames aranges macro frames frames-interp str loc Ranges pubtypes = gdb_index trace_info trace_abbrev trace_aranges addr cu_index ;; bfdname) - _values "object format" "${(z)${(@M)${(f)$(_call_program targets = objdump --help)}##* supported targets:*}##*: }" + _values "object format" "${(z)${(@M)${(f)$(_call_program targets = LC_MESSAGES=3DC objdump --help)}##* supported targets:*}##*: }" ;; machine) - _values "machine architecture" = "${(@)${(z)${(@M)${(f)$(_call_program targets objdump --help)}##* = supported architectures:*}##*: }//:/\\:}" + _values "machine architecture" = "${(@)${(z)${(@M)${(f)$(_call_program targets LC_MESSAGES=3DC objdump = --help)}##* supported architectures:*}##*: }//:/\\:}" ;; disassembler_options) - _values -s , "disassembler options" "${(@)${(@)${(@M)${(f)${(ps.-M = switch.)$(_call_program targets objdump --help)}[2]}:# [^ ]*}# }%% *}" + _values -s , "disassembler options" "${(@)${(@)${(@M)${(f)${(ps.-M = switch.)$(_call_program targets LC_MESSAGES=3DC objdump --help)}[2]}:# = [^ ]*}# }%% *}" ;; esac =20 diff --git a/Completion/Unix/Command/_strip = b/Completion/Unix/Command/_strip index 0703c50e4..552c2839c 100644 --- a/Completion/Unix/Command/_strip +++ b/Completion/Unix/Command/_strip @@ -54,7 +54,7 @@ case $state in local expl declare -a bfdnames =20 - bfdnames=3D(${=3D${(M)${(f)"$(_call_program bfdnames strip = --help)"}:#strip: supported targets: *}#strip: supported targets: }) + bfdnames=3D(${=3D${(M)${(f)"$(_call_program bfdnames LC_MESSAGES=3DC = strip --help)"}:#strip: supported targets: *}#strip: supported targets: = }) _describe -t bfdnames 'bfd name' bfdnames && ret=3D0 ;; esac