-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add -s auto-complete option #3523
Conversation
Add -s auto-complete option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you. 👍
Could you also add it to the zsh completion script?
app/data/bash-completion/scrcpy
Outdated
@@ -93,6 +93,11 @@ _scrcpy() { | |||
COMPREPLY=($(compgen -W 'verbose debug info warn error' -- "$cur")) | |||
return | |||
;; | |||
-s|--serial) | |||
# Use 'adb devices' to list serial numbers. | |||
COMPREPLY=($(compgen -W "$(adb devices | awk '/(device|recovery|sideload)$/{print $1}')" -- ${cur} ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that scrcpy may not work in recovery or sideload state, so maybe adb devices |awk '/device$/{print $1}'
is sufficient.
since scrcpy don't work in sideload and recovery options, I've removed them.
@@ -95,7 +95,7 @@ _scrcpy() { | |||
;; | |||
-s|--serial) | |||
# Use 'adb devices' to list serial numbers. | |||
COMPREPLY=($(compgen -W "$(adb devices | awk '/(device|recovery|sideload)$/{print $1}')" -- ${cur} ) ) | |||
COMPREPLY=($(compgen -W "$(adb devices | awk '/device$/{print $1}')" -- ${cur} ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if the ADB
environment variable is set, this adb should be used instead.
"${ADB:-adb}" devices | awk …
Add -s autocompletion for zsh
Ok. I've added a similar solution to the zsh completion. :) |
Thank you 👍 I rebased your commits onto
I pushed to branch |
Checked. Many thanks 👍 :) |
Thanks 👍 Merged into |
Add -s auto-complete option.
Commented at the following issue: #3522