From 5f664e2a1d8c53375818f959e972291a539c77a1 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Tue, 18 Jul 2023 10:50:09 +0200 Subject: [PATCH] bash-completion: do not complete removed options --- etc/mpv.bash-completion | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/etc/mpv.bash-completion b/etc/mpv.bash-completion index f33caf60e0..c08010ae7c 100644 --- a/etc/mpv.bash-completion +++ b/etc/mpv.bash-completion @@ -73,9 +73,12 @@ _mpv_get_args() } # This regex detects special options where we don't want an '=' appended -_mpv_special_regex='Flag.*\[not in config files\]|Print' -_mpv_regular_options=($(echo "$_mpv_options" | grep -v -E "$_mpv_special_regex" |awk '{print "\\"$1;}' | grep '\--')) -_mpv_special_options=($(echo "$_mpv_options" | grep -E "$_mpv_special_regex" |awk '{print "\\"$1;}' | grep '\--')) +_mpv_special_regex='\s(Flag.*\[not in config files\]|Print)' +_mpv_skip_regex='\sremoved \[deprecated\]' +_mpv_regular_options=($(echo "$_mpv_options" | grep -vE "$_mpv_skip_regex" | \ + grep -vE "$_mpv_special_regex" | awk '{print "\\"$1;}' | grep '\--')) +_mpv_special_options=($(echo "$_mpv_options" | grep -vE "$_mpv_skip_regex" | \ + grep -E "$_mpv_special_regex" | awk '{print "\\"$1;}' | grep '\--')) _mpv() {