Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Fwd: adb pull and push remote completion
- X-seq: zsh-workers 40603
- From: Julien Nicoulaud <julien.nicoulaud@xxxxxxxxx>
- To: Mailing-list zsh-workers <zsh-workers@xxxxxxx>
- Subject: Fwd: adb pull and push remote completion
- Date: Tue, 21 Feb 2017 14:20:55 +0100
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
- Cc: zsh-workers@xxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=shP7avSdjuMsa5Pl7fp3zUBm/PlCM39lu7FTvuWcnQM=; b=bOfddH3qqhCSJmlccYjURW0eBiiHkbhu1Guke87JuW1/4FcmvLVtOmPL5eT1ALMHLX btdsicq1djDAlulwa/qz1elruddoQPBEomGm+pF1JN3lJ4YAK06oEvNgg9bfSp7eCh53 kmW2d1qrGjoSYF/mUWupO9/RfQ4+yoLpg90FD6K4ZMNKfmVhO3ejn7QmZH5tZldCO9m4 muG/31Bowe+i3/j1YGje73Rr+Zw5GRyerY/E4tFQvFMSsi/qythz7ytpbHQr5EuZmVPh KjrTUc6Tjr0Rqn/WDRFnYeXYsrUAQnVAfbnK81KL9FAb1RD9q0aCtQRKzpyF30zy98UH dBug==
- In-reply-to: <CA+mcLN77BVXV26R+NavQfDX8yCjV1CGjzKQx7LZd-E9ZYSE5rw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CA++fsGGqSeshsuHinzJaKc3jRGooeLY1ow1Rcmf3Dw3vNREFpw@mail.gmail.com> <CA+mcLN77BVXV26R+NavQfDX8yCjV1CGjzKQx7LZd-E9ZYSE5rw@mail.gmail.com>
Hi Dov,
A while ago there was a compdef for adb in https://github.com/zsh-
users/zsh-completions, but we deleted it as there was one in zsh:
https://github.com/zsh-users/zsh-completions/blob/
e70e7f8941d7437a161e3e4bb93f06e9c712c4a4/src/_adb
I'm not sure which one is the better one, they probably need merging, but
anyway the one in zsh-completions could complete adb push/pull.
I hope this can be useful.
Cheers,
Julien
2017-01-25 10:41 GMT+01:00 Dov Grobgeld <dov.grobgeld@xxxxxxxxx>:
> 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