Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

adb pull and push remote completion



Hello,

Here's a feature request, that may or may not be supposed by the current
adb function.

In the pull or push command do remote completion of the files on the
device. The following zsh commands provides almost the functionality,
(except for "leaving" the current argument, instead of staying at it for
further completion):

function -K adblist {
  read -l cmdline;
  args=("${(@s/ /)cmdline}")

  if [[ ( $args[2] == "pull" && $#args -eq 3 )
        || ( $args[2] == "push" && $#args -eq 4) ]]; then
    reply=(`adb shell ls -a1d $1\* 2&>/dev/null`)
  else
    reply=(`ls -a1d $1*`)
  fi
}
compctl -K adblist adb

Regards,
Dov


Messages sorted by: Reverse Date, Date, Thread, Author