zsh-workers
 help / color / mirror / code / Atom feed
From: Dov Grobgeld <dov.grobgeld@gmail.com>
To: zsh-workers@zsh.org
Subject: adb pull and push remote completion
Date: Wed, 25 Jan 2017 11:41:22 +0200	[thread overview]
Message-ID: <CA++fsGGqSeshsuHinzJaKc3jRGooeLY1ow1Rcmf3Dw3vNREFpw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

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

             reply	other threads:[~2017-01-25  9:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25  9:41 Dov Grobgeld [this message]
     [not found] ` <CA+mcLN77BVXV26R+NavQfDX8yCjV1CGjzKQx7LZd-E9ZYSE5rw@mail.gmail.com>
2017-02-21 13:20   ` Fwd: " Julien Nicoulaud
2017-02-21 17:23     ` Oliver Kiddle
2017-02-21 17:32       ` Julien Nicoulaud

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA++fsGGqSeshsuHinzJaKc3jRGooeLY1ow1Rcmf3Dw3vNREFpw@mail.gmail.com \
    --to=dov.grobgeld@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).