zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Fix "35531: fallback on file completion"
@ 2016-03-18 16:08 Mikael Magnusson
  2016-03-18 16:11 ` Mikael Magnusson
  2016-03-18 23:20 ` Oliver Kiddle
  0 siblings, 2 replies; 6+ messages in thread
From: Mikael Magnusson @ 2016-03-18 16:08 UTC (permalink / raw)
  To: zsh-workers

The above commit just changed a bunch of stuff without testing, the
result was that the completer didn't work. It now works, to an extent.

The one remaining caveat is that if you enter a subcommand the completer
doesn't recognize, it will go on to offer subcommands instead of falling
back to _default. I'm not sure what it's trying to do with the
"sanitize context" stuff, or "shift words" etc which just makes the rest
of the code not know where it is, but I don't care enough to rewrite it.
---
 ChangeLog                    |  2 --
 Completion/Unix/Command/_adb | 74 +++++++++++++++++++++++++-------------------
 2 files changed, 43 insertions(+), 33 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index be61bd0..aa5a716 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2659,8 +2659,6 @@
 
 2015-06-19  Oliver Kiddle  <opk@zsh.org>
 
-	* 35531: Completion/Unix/Command/_adb: fallback on file completion
-
 	* 35527: Completion/Unix/Type/_email_addresses,
 	Completion/Zsh/Command/_fc, Completion/Zsh/Command/_zpty:
 	use list-separator style in cases where separator was hardcoded
diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb
index 88aca24..5ad2f5d 100644
--- a/Completion/Unix/Command/_adb
+++ b/Completion/Unix/Command/_adb
@@ -37,34 +37,45 @@ _adb() {
 
   local -a ALL_ADB_COMMANDS
   ALL_ADB_COMMANDS=(
+          "backup"
+          "bugreport"
           "connect"
+          "devices"
+          "disable-verity"
           "disconnect"
-          "shell"
-          "wait-for-device"
-          "push"
-          "pull"
-          "logcat"
-          "jdwp"
-          "bugreport"
-          "version"
+          "emu"
+          "enable-verity"
           "forward"
-          "install"
-          "uninstall"
+          "get-devpath"
+          "get-serialno"
+          "get-state"
           "help"
-          "start-server"
+          "install"
+          "install-multiple"
+          "jdwp"
+          "keygen"
           "kill-server"
-          "devices"
-          "get-state"
-          "get-serialno"
-          "status-window"
-          "remount"
+          "logcat"
+          "ppp"
+          "pull"
+          "push"
           "reboot"
           "reboot-bootloader"
+          "remount"
+          "restore"
+          "reverse"
           "root"
-          "usb"
-          "tcpip"
+          "shell"
           "sideload"
-          "ppp"
+          "start-server"
+          "status-window"
+          "sync"
+          "tcpip"
+          "uninstall"
+          "unroot"
+          "usb"
+          "version"
+          "wait-for-device"
   )
 
   (( $+functions[_adb_device_specification] )) && _adb_device_specification
@@ -77,7 +88,7 @@ _adb() {
 	'(   -e -s)-d[device]' \
 	'(-d    -s)-e[emulator]' \
 	'1:"options":_adb_options_handler' \
-	'*: : _default'
+  '*: : _default'
       
       return;
   }
@@ -100,28 +111,29 @@ _adb_dispatch_command () {
   fi
 
   case ${curcontext} in
-    (*:adb-shell)
+    (*:adb:shell)
       (( $+functions[_adb_dispatch_shell] )) && _adb_dispatch_shell
       ;;
-    (*:adb-connect|*:adb-disconnect)
+    (*:adb:connect|*:adb:disconnect)
       (( $+functions[_adb_dispatch_connection_handling] )) && _adb_dispatch_connection_handling
       ;;
-    (*:adb-logcat)
+    (*:adb:logcat)
       (( $+functions[_adb_dispatch_logcat] )) && _adb_dispatch_logcat
       ;;
-    (*:adb-push)
+    (*:adb:push)
       (( $+functions[_adb_dispatch_push] )) && _adb_dispatch_push
       ;;
-    (*:adb-pull)
+    (*:adb:pull)
       (( $+functions[_adb_dispatch_pull] )) && _adb_dispatch_pull
       ;;
-    (*:adb-install)
+    (*:adb:install)
       (( $+functions[_adb_dispatch_install] )) && _adb_dispatch_install
       ;;
-    (*:adb-uninstall)
+    (*:adb:uninstall)
       (( $+functions[_adb_dispatch_uninstall] )) && _adb_dispatch_uninstall
       ;;
-    (*:adb-*)
+    (*:adb:(${(~j:|:)ALL_ADB_COMMANDS}))
+      # subcommand not handled
       _default
       ;;
     (*)
@@ -147,7 +159,7 @@ _adb_sanitize_context () {
   done
   ##expand unquoted to remove sparse elements
   mywords=( ${mywords[@]} )
-  (( $#mywords )) && curcontext="${curcontext%:*}-${mywords[-1]}:"
+  curcontext="${curcontext}${mywords[-1]}"
 }
 
 (( $+functions[_adb_device_specification] )) ||
@@ -377,9 +389,9 @@ _adb_dispatch_connection_handling () {
   fi
 }
 
-(( $+functions[_adb_check_log_redirect] )) ||
+(( $+functions[adb_check_log_redirect] )) ||
 _adb_check_log_redirect () {
-  LOG_REDIRECT=${$(adb ${=ADB_DEVICE_SPECIFICATION} shell getprop log.redirect-stdio 2>/dev/null)//
+  LOG_REDIRECT=${$(adb ${=ADB_DEVICE_SPECIFICATION} shell getprop log.redirect-stdio)//
 /}
   [[ ${LOG_REDIRECT[1,4]} == "true" ]] &&  _message -r "Notice: stdio log redirection enabled on the device, so some completions will not work"
 }
-- 
2.6.1


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

* Re: PATCH: Fix "35531: fallback on file completion"
  2016-03-18 16:08 PATCH: Fix "35531: fallback on file completion" Mikael Magnusson
@ 2016-03-18 16:11 ` Mikael Magnusson
  2016-03-18 23:20 ` Oliver Kiddle
  1 sibling, 0 replies; 6+ messages in thread
From: Mikael Magnusson @ 2016-03-18 16:11 UTC (permalink / raw)
  To: zsh workers

On Fri, Mar 18, 2016 at 5:08 PM, Mikael Magnusson <mikachu@gmail.com> wrote:
> The above commit just changed a bunch of stuff without testing, the
> result was that the completer didn't work. It now works, to an extent.
>
> The one remaining caveat is that if you enter a subcommand the completer
> doesn't recognize, it will go on to offer subcommands instead of falling
> back to _default. I'm not sure what it's trying to do with the
> "sanitize context" stuff, or "shift words" etc which just makes the rest
> of the code not know where it is, but I don't care enough to rewrite it.
> ---
>  ChangeLog                    |  2 --

I apparently squashed my fixes into the revert commit a bit too
hastily as well :).

-- 
Mikael Magnusson


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

* Re: PATCH: Fix "35531: fallback on file completion"
  2016-03-18 16:08 PATCH: Fix "35531: fallback on file completion" Mikael Magnusson
  2016-03-18 16:11 ` Mikael Magnusson
@ 2016-03-18 23:20 ` Oliver Kiddle
  2016-03-19  1:13   ` Mikael Magnusson
  1 sibling, 1 reply; 6+ messages in thread
From: Oliver Kiddle @ 2016-03-18 23:20 UTC (permalink / raw)
  To: zsh-workers

Mikael Magnusson wrote:
> The above commit just changed a bunch of stuff without testing, the
> result was that the completer didn't work. It now works, to an extent.

Specifically, in what way didn't it work?

Testing will have been limited because I don't have any device adb could
connect to (still using an ancient Nokia) and I don't typically use or
install it. There's a different adb command on Solaris which is perhaps
why I was annoyed at it not falling back to default file completion.

> The one remaining caveat is that if you enter a subcommand the completer
> doesn't recognize, it will go on to offer subcommands instead of falling
> back to _default. I'm not sure what it's trying to do with the
> "sanitize context" stuff, or "shift words" etc which just makes the rest
> of the code not know where it is, but I don't care enough to rewrite it.

The "sanitize context" stuff was because it was putting the sub-command
into the wrong component of $curcontext. Completion contexts are
supposed to be:
  :completion:<function>:<completer>:<command>:<arg>:<tag>

We typically put subcommands into <command> by changing it to
<command>-<subcommand>. If you use a colon instead of a dash, the
subcommand will be in <arg> and thereafter, everything gets messed up.

> -(( $+functions[_adb_check_log_redirect] )) ||
> +(( $+functions[adb_check_log_redirect] )) ||
>  _adb_check_log_redirect () {

Are you sure you want to back that out?
I'm not actually fond of these guards on function definitions myself
because they prevent the function from being reloaded when the
underlying file in $fpath is modified and reloaded. I only use them in
cases where it seems likely that someone would want to override the
function.

> -  LOG_REDIRECT=${$(adb ${=ADB_DEVICE_SPECIFICATION} shell getprop log.redirect-stdio 2>/dev/null)//
> +  LOG_REDIRECT=${$(adb ${=ADB_DEVICE_SPECIFICATION} shell getprop log.redirect-stdio)//
>  /}

This should really be using _call_program but I'm sure I redirected
stderr for a reason. It was probably spewing out errors to the terminal
because it couldn't find an attached device.

I also don't really like _adb being chatty with lots of _message -r
calls. I tend to prefer completion functions to just do the best they
can of generating matches and otherwise keep quiet.

Oliver


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

* Re: PATCH: Fix "35531: fallback on file completion"
  2016-03-18 23:20 ` Oliver Kiddle
@ 2016-03-19  1:13   ` Mikael Magnusson
  2016-03-19  5:56     ` Oliver Kiddle
  0 siblings, 1 reply; 6+ messages in thread
From: Mikael Magnusson @ 2016-03-19  1:13 UTC (permalink / raw)
  To: Oliver Kiddle; +Cc: zsh workers

On Sat, Mar 19, 2016 at 12:20 AM, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
> Mikael Magnusson wrote:
>> The above commit just changed a bunch of stuff without testing, the
>> result was that the completer didn't work. It now works, to an extent.
>
> Specifically, in what way didn't it work?

Every completion after "adb anything <tab>" only completed files.

> Testing will have been limited because I don't have any device adb could
> connect to (still using an ancient Nokia) and I don't typically use or
> install it. There's a different adb command on Solaris which is perhaps
> why I was annoyed at it not falling back to default file completion.
>
>> The one remaining caveat is that if you enter a subcommand the completer
>> doesn't recognize, it will go on to offer subcommands instead of falling
>> back to _default. I'm not sure what it's trying to do with the
>> "sanitize context" stuff, or "shift words" etc which just makes the rest
>> of the code not know where it is, but I don't care enough to rewrite it.
>
> The "sanitize context" stuff was because it was putting the sub-command
> into the wrong component of $curcontext. Completion contexts are
> supposed to be:
>   :completion:<function>:<completer>:<command>:<arg>:<tag>
>
> We typically put subcommands into <command> by changing it to
> <command>-<subcommand>. If you use a colon instead of a dash, the
> subcommand will be in <arg> and thereafter, everything gets messed up.
>
>> -(( $+functions[_adb_check_log_redirect] )) ||
>> +(( $+functions[adb_check_log_redirect] )) ||
>>  _adb_check_log_redirect () {
>
>> -  LOG_REDIRECT=${$(adb ${=ADB_DEVICE_SPECIFICATION} shell getprop log.redirect-stdio 2>/dev/null)//
>> +  LOG_REDIRECT=${$(adb ${=ADB_DEVICE_SPECIFICATION} shell getprop log.redirect-stdio)//
>>  /}
>
> This should really be using _call_program but I'm sure I redirected
> stderr for a reason. It was probably spewing out errors to the terminal
> because it couldn't find an attached device.
>
> Are you sure you want to back that out?

No, I removed those hunks from the commit before pushing, included in
the sent diff by mistake.

> I'm not actually fond of these guards on function definitions myself
> because they prevent the function from being reloaded when the
> underlying file in $fpath is modified and reloaded. I only use them in
> cases where it seems likely that someone would want to override the
> function.
>
> I also don't really like _adb being chatty with lots of _message -r
> calls. I tend to prefer completion functions to just do the best they
> can of generating matches and otherwise keep quiet.

Yeah, there's some really questionable code in there, and lots of
superfluous double quotes that end up in displayed descriptions. (like
for i in $(ls -d /*)). Someone just complained earlier that the
completer broke, and since reverting this commit fixed it, I spent
some time to get file completion after unhandled subcommands and
working completion after handled subcommands. I didn't really spend
any time looking into why the changed code didn't work, sorry. If you
have any theories about it, I'd be happy to try them out though.

-- 
Mikael Magnusson


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

* Re: PATCH: Fix "35531: fallback on file completion"
  2016-03-19  1:13   ` Mikael Magnusson
@ 2016-03-19  5:56     ` Oliver Kiddle
  2016-03-19 12:36       ` PATCH: _adb: fix remote file completion + various fixes Mikael Magnusson
  0 siblings, 1 reply; 6+ messages in thread
From: Oliver Kiddle @ 2016-03-19  5:56 UTC (permalink / raw)
  To: zsh workers

Mikael Magnusson wrote:
> > Mikael Magnusson wrote:
> >> The above commit just changed a bunch of stuff without testing, the
> >> result was that the completer didn't work. It now works, to an extent.
> >
> > Specifically, in what way didn't it work?
>
> Every completion after "adb anything <tab>" only completed files.

I think the problem was a missing trailing colon when matching
$curcontext. The following patch is against the original before your
commit. Given that you squashed the backout and new changes together,
would you mind merging this. Again, my only testing first involves
hacking it to continue when it doesn't find adb working.

> >> The one remaining caveat is that if you enter a subcommand the completer
> >> doesn't recognize, it will go on to offer subcommands instead of falling
> >> back to _default. I'm not sure what it's trying to do with the

_default is nearly always the best option with unrecognised subcommands.
In the past, we've had various approaches such as _message which might
be helpful if a user has mistyped a sub-command but _default is
consistent with how we handle top-level commands for which there is no
completion and is the most graceful fallback when new subcommands have
been added since the function was written. It'd also be more graceful in
the case of adb on Solaris, though we should probably just stuff an if
condition of [[ $OSTYPE = solaris* ]] in the top.

> Yeah, there's some really questionable code in there, and lots of
> superfluous double quotes that end up in displayed descriptions. (like
> for i in $(ls -d /*)). Someone just complained earlier that the

Yuk. We could do better when it comes to code-reviewing new functions
while the original author is still around. Complaining about everything
before we get past the first dozen lines isn't really going to be
encouraging, however. In this case, the local variables should be moved
inside adb() otherwise they are only local the first time. setopt
nonomatch should not be required, though it is hard to know why it is
there. Then we have a variable naming scheme that leaves me wondering if
stuff like ADB_DEVICE_SPECIFICATION is an environmenent variable with a
meaning to adb. The -l option should not be there: autoload +X _adb is
close if you want to see the result of autoloading. And it goes on...

But as I've apparently demonstrated, I'm not able to clean it up without
also accidentally breaking it in the process.

Oliver

diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb
index 88aca24..e6f7710 100644
--- a/Completion/Unix/Command/_adb
+++ b/Completion/Unix/Command/_adb
@@ -100,25 +100,25 @@ _adb_dispatch_command () {
   fi
 
   case ${curcontext} in
-    (*:adb-shell)
+    (*:adb-shell:)
       (( $+functions[_adb_dispatch_shell] )) && _adb_dispatch_shell
       ;;
-    (*:adb-connect|*:adb-disconnect)
+    (*:adb-connect:|*:adb-disconnect:)
       (( $+functions[_adb_dispatch_connection_handling] )) && _adb_dispatch_connection_handling
       ;;
-    (*:adb-logcat)
+    (*:adb-logcat:)
       (( $+functions[_adb_dispatch_logcat] )) && _adb_dispatch_logcat
       ;;
-    (*:adb-push)
+    (*:adb-push:)
       (( $+functions[_adb_dispatch_push] )) && _adb_dispatch_push
       ;;
-    (*:adb-pull)
+    (*:adb-pull:)
       (( $+functions[_adb_dispatch_pull] )) && _adb_dispatch_pull
       ;;
-    (*:adb-install)
+    (*:adb-install:)
       (( $+functions[_adb_dispatch_install] )) && _adb_dispatch_install
       ;;
-    (*:adb-uninstall)
+    (*:adb-uninstall:)
       (( $+functions[_adb_dispatch_uninstall] )) && _adb_dispatch_uninstall
       ;;
     (*:adb-*)


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

* PATCH: _adb: fix remote file completion + various fixes
  2016-03-19  5:56     ` Oliver Kiddle
@ 2016-03-19 12:36       ` Mikael Magnusson
  0 siblings, 0 replies; 6+ messages in thread
From: Mikael Magnusson @ 2016-03-19 12:36 UTC (permalink / raw)
  To: zsh-workers

Okay, this restores the dashes from 35531. I also went through and removed
all the superfluous (or most of anyway) double quotes in descriptions. I
also noticed while testing that remote folder completion 1) used the
same cache name as remote packages, so whichever you used first would
be the only one working for a while and 2) it was extremely slow. This
patch fixes both of those things also.

---
 Completion/Unix/Command/_adb | 75 ++++++++++++++++++--------------------------
 1 file changed, 30 insertions(+), 45 deletions(-)

diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb
index fa05226..c0a2bb2 100644
--- a/Completion/Unix/Command/_adb
+++ b/Completion/Unix/Command/_adb
@@ -87,7 +87,7 @@ _adb() {
 	'(-d -e   )-s[serial]: :_adb_device_serial' \
 	'(   -e -s)-d[device]' \
 	'(-d    -s)-e[emulator]' \
-	'1:"options":_adb_options_handler' \
+	'1:options:_adb_options_handler' \
 	'*: : _default'
       
       return;
@@ -111,37 +111,36 @@ _adb_dispatch_command () {
   fi
 
   case ${curcontext} in
-    (*:adb:shell)
+    (*:adb-shell:)
       (( $+functions[_adb_dispatch_shell] )) && _adb_dispatch_shell
       ;;
-    (*:adb:connect|*:adb:disconnect)
+    (*:adb-connect:|*:adb-disconnect:)
       (( $+functions[_adb_dispatch_connection_handling] )) && _adb_dispatch_connection_handling
       ;;
-    (*:adb:logcat)
+    (*:adb-logcat:)
       (( $+functions[_adb_dispatch_logcat] )) && _adb_dispatch_logcat
       ;;
-    (*:adb:push)
+    (*:adb-push:)
       (( $+functions[_adb_dispatch_push] )) && _adb_dispatch_push
       ;;
-    (*:adb:pull)
+    (*:adb-pull:)
       (( $+functions[_adb_dispatch_pull] )) && _adb_dispatch_pull
       ;;
-    (*:adb:install)
+    (*:adb-install:)
       (( $+functions[_adb_dispatch_install] )) && _adb_dispatch_install
       ;;
-    (*:adb:uninstall)
+    (*:adb-uninstall:)
       (( $+functions[_adb_dispatch_uninstall] )) && _adb_dispatch_uninstall
       ;;
-    (*:adb:(${(~j:|:)ALL_ADB_COMMANDS}))
-      # subcommand not handled
+    (*:adb-*)
       _default
       ;;
     (*)
       _arguments \
-	'(-d -e)-s["serial"]: :_adb_device_serial' \
-	'(-s -e)-d["device"]' \
-	'(-d -s)-e["emulator"]' \
-	'*:"options":_adb_options_handler'
+	'(-d -e)-s[serial]: :_adb_device_serial' \
+	'(-s -e)-d[device]' \
+	'(-d -s)-e[emulator]' \
+	'*:options:_adb_options_handler'
       ;;
   esac
 }
@@ -159,7 +158,7 @@ _adb_sanitize_context () {
   done
   ##expand unquoted to remove sparse elements
   mywords=( ${mywords[@]} )
-  curcontext="${curcontext}${mywords[-1]}"
+  (( $#mywords )) && curcontext="${curcontext%:*}-${mywords[-1]}:"
 }
 
 (( $+functions[_adb_device_specification] )) ||
@@ -203,7 +202,7 @@ _adb_dispatch_shell () {
       (( $+functions[_adb_package_manager_handler] )) && _adb_package_manager_handler
       ;;
     (*)
-      _arguments '*:adb_remote_folder:_adb_remote_folder'
+      _arguments '*: :_adb_remote_folder'
       ;;
   esac
 }
@@ -328,8 +327,8 @@ _adb_dispatch_uninstall () {
   fi
 
   _arguments \
-	'-k["keep data and cache"]' \
-        '*:"installed package":_adb_installed_packages'
+	'-k[keep data and cache]' \
+        '*:installed package:_adb_installed_packages'
 }
 
 (( $+functions[_adb_dispatch_install] )) ||
@@ -342,10 +341,10 @@ _adb_dispatch_install () {
   fi
 
   _arguments \
-	'-l["forward lock"]' \
-	'-r["reinstall"]' \
-	'-s["install on sd"]' \
-	'*:"select apk file":_path_files -g "*(/)|*.apk"'
+	'-l[forward lock]' \
+	'-r[reinstall]' \
+	'-s[install on sd]' \
+	'*:apk file:_path_files -g "*(/)|*.apk"'
 }
 
 (( $+functions[_adb_dispatch_push] )) ||
@@ -357,9 +356,9 @@ _adb_dispatch_push () {
   fi 
   if [[ ${#words} -gt 2 ]]
   then
-    _arguments '*:adb_remote_folder:_adb_remote_folder'
+    _arguments '*: :_adb_remote_folder'
   else
-    _arguments '*:"local file/folder":_files'
+    _arguments '*:local file/folder:_files'
   fi
 }
 
@@ -372,9 +371,9 @@ _adb_dispatch_pull () {
   fi 
   if [[ ${#words} -gt 2 ]]
   then
-    _arguments '*:"local file/folder":_files'
+    _arguments '*:local file/folder:_files'
   else
-    _arguments '*:adb_remote_folder:_adb_remote_folder'
+    _arguments '*: :_adb_remote_folder'
   fi
 }
 
@@ -465,11 +464,6 @@ _adb_shell_commands_handler() {
   _wanted adb_shell_commands expl 'adb shell commands' compadd ls pm am mkdir rmdir rm cat 
 }
 
-(( $+functions[_adb_any_device_available] )) ||
-_adb_any_device_available() {
-  _any_device_available=${#$(adb devices | sed -n 's/^\([^[:space:]]*\)\t.*$/\1/p')}
-}
-
 (( $+functions[_adb_device_available] )) ||
 _adb_device_available() {
   [[ $(adb ${=ADB_DEVICE_SPECIFICATION} get-state 2>&1) == "device" ]] && return 0
@@ -478,22 +472,16 @@ _adb_device_available() {
 
 (( $+functions[_adb_full_folder_scan] )) ||
 _adb_full_folder_scan() {
-  local -a rv;
-  rv=( ${$(adb ${=ADB_DEVICE_SPECIFICATION} shell 'for i in $(ls -d /*)
+  filesystem_content=( ${${(f)"$(adb ${=ADB_DEVICE_SPECIFICATION} shell 'cd /;for i in *
       do
         case $i in
-          /proc|/sys|/acct)
+          proc|sys|acct)
             ;;
           *)
-            ls -R $i
+            find $i 2> /dev/null
             ;;
         esac
-      done' )//'$\r'/} )
-  for line in ${rv[@]};
-  do
-    [[ ${line[1]} == '/' ]] && folder="${line%:}" && adb_device_folders+=$folder && continue;
-    adb_device_folders+=$folder/$line;
-  done
+      done' )"}%$'\r'} )
 }
 
 (( $+functions[_adb_remote_folder] )) ||
@@ -503,14 +491,11 @@ _adb_remote_folder () {
   if [[ -z "$update_policy" ]]; then
     zstyle ":completion:${curcontext}:" cache-policy _adb_cache_policy_daily
   fi
-  local cacheid=package_cache_${$(adb ${=ADB_DEVICE_SPECIFICATION} get-serialno)}
+  local cacheid=folder_cache_${$(adb ${=ADB_DEVICE_SPECIFICATION} get-serialno)}
   typeset -a filesystem_content
   if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid"
   then
-    local -a adb_device_folders
     _adb_full_folder_scan
-    # remove any duplicates and the initial slash => should still remove bare folders from it when it has children
-    filesystem_content=( ${(u)adb_device_folders#/} )
     _store_cache "$cacheid" filesystem_content
   fi
   _adb_device_available && \
-- 
2.6.1


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

end of thread, other threads:[~2016-03-19 12:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-18 16:08 PATCH: Fix "35531: fallback on file completion" Mikael Magnusson
2016-03-18 16:11 ` Mikael Magnusson
2016-03-18 23:20 ` Oliver Kiddle
2016-03-19  1:13   ` Mikael Magnusson
2016-03-19  5:56     ` Oliver Kiddle
2016-03-19 12:36       ` PATCH: _adb: fix remote file completion + various fixes Mikael Magnusson

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