From 3e3756a323c947678daa753cd1b8e0b110a833d1 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Tue, 21 Feb 2023 19:48:28 +0100 Subject: [PATCH] Add auto-completion for --codec option Add missing command to bash and zsh completion scripts. --- app/data/bash-completion/scrcpy | 5 +++++ app/data/zsh-completion/_scrcpy | 1 + 2 files changed, 6 insertions(+) diff --git a/app/data/bash-completion/scrcpy b/app/data/bash-completion/scrcpy index 0d3a2559..61573770 100644 --- a/app/data/bash-completion/scrcpy +++ b/app/data/bash-completion/scrcpy @@ -3,6 +3,7 @@ _scrcpy() { local opts=" --always-on-top -b --bit-rate= + --codec= --codec-options= --crop= -d --select-usb @@ -64,6 +65,10 @@ _scrcpy() { _init_completion -s || return case "$prev" in + --codec) + COMPREPLY=($(compgen -W 'h264 h265 av1' -- "$cur")) + return + ;; --lock-video-orientation) COMPREPLY=($(compgen -W 'unlocked initial 0 1 2 3' -- "$cur")) return diff --git a/app/data/zsh-completion/_scrcpy b/app/data/zsh-completion/_scrcpy index 56c13fd0..c57111cc 100644 --- a/app/data/zsh-completion/_scrcpy +++ b/app/data/zsh-completion/_scrcpy @@ -10,6 +10,7 @@ local arguments arguments=( '--always-on-top[Make scrcpy window always on top \(above other windows\)]' {-b,--bit-rate=}'[Encode the video at the given bit-rate]' + '--codec=[Select the video codec]:codec:(h264 h265 av1)' '--codec-options=[Set a list of comma-separated key\:type=value options for the device encoder]' '--crop=[\[width\:height\:x\:y\] Crop the device screen on the server]' {-d,--select-usb}'[Use USB device]'