Add -s auto-completion for bash

Fixes #3522 <https://github.com/Genymobile/scrcpy/pull/3522>
PR #3523 <https://github.com/Genymobile/scrcpy/pull/3523>

Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
Anima C13 2022-10-07 11:23:59 -03:00 committed by Romain Vimont
parent 40644994e8
commit 1bfbadef96

View file

@ -93,6 +93,11 @@ _scrcpy() {
COMPREPLY=($(compgen -W 'verbose debug info warn error' -- "$cur")) COMPREPLY=($(compgen -W 'verbose debug info warn error' -- "$cur"))
return return
;; ;;
-s|--serial)
# Use 'adb devices' to list serial numbers
COMPREPLY=($(compgen -W "$("${ADB:-adb}" devices | awk '$2 == "device" {print $1}')" -- ${cur}))
return
;;
-b|--bitrate \ -b|--bitrate \
|--codec-options \ |--codec-options \
|--crop \ |--crop \
@ -103,7 +108,6 @@ _scrcpy() {
|-m|--max-size \ |-m|--max-size \
|-p|--port \ |-p|--port \
|--push-target \ |--push-target \
|-s|--serial \
|--tunnel-host \ |--tunnel-host \
|--tunnel-port \ |--tunnel-port \
|--v4l2-buffer \ |--v4l2-buffer \