zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: fix some syntax depending on shortloops
@ 2011-07-27  9:11 Mikael Magnusson
  2011-07-27  9:48 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Magnusson @ 2011-07-27  9:11 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: fix some syntax depending on shortloops
  2011-07-27  9:11 PATCH: fix some syntax depending on shortloops Mikael Magnusson
@ 2011-07-27  9:48 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2011-07-27  9:48 UTC (permalink / raw)
  To: zsh-workers

On Wed, 27 Jul 2011 11:11:00 +0200
Mikael Magnusson <mikachu@gmail.com> wrote:
> 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 wonder if there's some mileage in that case in explicitly turning it
off to level the playing field.  I think the only effect would be user
code that's not part of the normal system e.g. evals in zstyles would
pick this up.  Ideally this should be in a sandbox (but don't hold your
breath).

> 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.

Yes, that just looked plain wrong.

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-27 10:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-27  9:11 PATCH: fix some syntax depending on shortloops Mikael Magnusson
2011-07-27  9:48 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).