From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26044 invoked by alias); 27 Jul 2011 09:11:21 -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: 29618 Received: (qmail 1350 invoked from network); 27 Jul 2011 09:11:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) 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.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.161.44 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer; bh=TVS2WCpq8AvE5iFgQCV/7H0/sTb+3X80lu4tMaU4SC0=; b=bLXZ4gPXNWjo5WZu+MhyPkfUZ4XNPViegJiceGX55G9qqNFmz+0DO3Er6UXWPVlNIW dDCp1QJcNgzUA4okIhF4mXzPnqvwJXwlOi2sZrHMyw6vZ8N9OLl2nXSywkmOTJNa1v4b yY3TObdMXJJS4AzWoEQrnyd8Px0cgifOkQPO4= From: Mikael Magnusson To: zsh-workers@zsh.org Subject: PATCH: fix some syntax depending on shortloops Date: Wed, 27 Jul 2011 11:11:00 +0200 Message-Id: <1311757860-30180-1-git-send-email-mikachu@gmail.com> X-Mailer: git-send-email 1.7.5.4 Shortloops isn't in _comp_options so completions can't depend on it being set. I discovered these two after updating my root .zshrc. I haven't tested _ethtool but it should be fine, it looks like it just had broken syntax that happened to work with shortloops set. --- Completion/Linux/Command/_ethtool | 8 ++++---- Completion/Zsh/Type/_file_descriptors | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Completion/Linux/Command/_ethtool b/Completion/Linux/Command/_ethtool index a01d388..5d60774 100644 --- a/Completion/Linux/Command/_ethtool +++ b/Completion/Linux/Command/_ethtool @@ -3,9 +3,9 @@ local -a cmds if [[ $CURRENT -ge 4 ]]; then - case $words[CURRENT-1]; in + case $words[CURRENT-1] in rx|tx) - if [[ $words[2] = '-G' ]] && _message -e n 'number of ring entries' || _wanted -x onoff expl 'enabled' compadd off on + [[ $words[2] = '-G' ]] && _message -e n 'number of ring entries' || _wanted -x onoff expl 'enabled' compadd off on ;; autoneg|adaptive-rx|adaptive-tx|raw|hex|sg|tso|ufo|gso) _wanted -x onoff expl 'enabled' compadd off on @@ -55,7 +55,7 @@ if [[ $CURRENT -ge 4 ]]; then _wanted files expl 'raw register dump files' _files ;; *) - case $words[2]; in + case $words[2] in -A|--pause) _values -S ' ' -w 'pause options' \ 'autoneg[specify if pause autonegotiation is enabled]' \ @@ -111,7 +111,7 @@ if [[ $CURRENT -ge 4 ]]; then 'gso[specify if generic segmentation offload is enabled]' ;; -p|--identify) - if [[ $CURRENT -eq 4 ]] && _message -e length 'seconds' + [[ $CURRENT -eq 4 ]] && _message -e length 'seconds' ;; -t|--test) _values -S ' ' -w 'selftest option' \ diff --git a/Completion/Zsh/Type/_file_descriptors b/Completion/Zsh/Type/_file_descriptors index 1dac47f..3e251b7 100644 --- a/Completion/Zsh/Type/_file_descriptors +++ b/Completion/Zsh/Type/_file_descriptors @@ -13,7 +13,9 @@ if zstyle -T ":completion:${curcontext}:" verbose && [[ -h /proc/$$/fd/$fds[1] ] list+=( "$i $sep ${link[1]}" ) done elif (( $+commands[readlink] )); then - for i in "${fds[@]}"; list+=( "$i $sep $(readlink /proc/$$/fd/$i)" ) + for i in "${fds[@]}"; do + list+=( "$i $sep $(readlink /proc/$$/fd/$i)" ) + done else for i in "${fds[@]}"; do list+=( "$i $sep $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" ) -- 1.7.5.4