diff --git a/tests/misc/test-gstreamer-completion.sh b/tests/misc/test-gstreamer-completion.sh index 0f613678cd..cb2e29c2c9 100755 --- a/tests/misc/test-gstreamer-completion.sh +++ b/tests/misc/test-gstreamer-completion.sh @@ -39,9 +39,12 @@ test_gst_inspect_completion --ver -- --version test_gst_inspect_completion --gst-debug-le -- --gst-debug-level test_gst_inspect_completion --gst-debug-level '' -- 0 1 2 3 4 5 test_gst_inspect_completion --gst-debug-level = -- 0 1 2 3 4 5 +test_gst_inspect_completion --gst-debug-level= -- 0 1 2 3 4 5 +test_gst_inspect_completion --gst-debug-level=4 -- 4 test_gst_inspect_completion coreel -- coreelements test_gst_inspect_completion fake -- fakesrc fakesink test_gst_inspect_completion --version --gst-debug-level = 2 fake -- fakesrc fakesink +test_gst_inspect_completion --gst-debug-level=2 fake -- fakesrc fakesink test_gst_launch_completion() { @@ -66,13 +69,27 @@ test_gst_launch_completion --mes -- --messages test_gst_launch_completion --gst-debug-le -- --gst-debug-level test_gst_launch_completion --gst-debug-level '' -- 0 1 2 3 4 5 test_gst_launch_completion --gst-debug-level = -- 0 1 2 3 4 5 +test_gst_launch_completion --gst-debug-level= -- 0 1 2 3 4 5 +test_gst_launch_completion --gst-debug-level=4 -- 4 test_gst_launch_completion fak -- fakesrc fakesink test_gst_launch_completion --messages fak -- fakesrc fakesink test_gst_launch_completion --messages --eos-on-shutdown fak -- fakesrc +test_gst_launch_completion --gst-debug-level = 4 fak -- fakesrc +test_gst_launch_completion --gst-debug-level=4 fak -- fakesrc test_gst_launch_completion fakesrc '' -- name= is-live= format= ! test_gst_launch_completion fakesrc is-live -- is-live= test_gst_launch_completion fakesrc is-live = -- true false test_gst_launch_completion fakesrc format = -- bytes time buffers percent +test_gst_launch_completion fakesrc format= -- bytes time buffers percent +test_gst_launch_completion fakesrc format=by -- bytes +test_gst_launch_completion fakesrc format= '' -- bytes time buffers percent +test_gst_launch_completion fakesrc format= by -- bytes +test_gst_launch_completion fakesrc is-live = true '' -- name= format= ! +test_gst_launch_completion fakesrc is-live = true for -- format= +test_gst_launch_completion fakesrc is-live=true '' -- name= format= ! +test_gst_launch_completion fakesrc is-live=true for -- format= +test_gst_launch_completion fakesrc is-live = true format = -- bytes time +test_gst_launch_completion fakesrc is-live=true format= -- bytes time test_gst_launch_parse() { @@ -109,12 +126,16 @@ test_gst_launch_parse --mes -- option '' '' '' test_gst_launch_parse --messages -- option '' '' '' test_gst_launch_parse --gst-debug-level '' -- optionval --gst-debug-level '' '' test_gst_launch_parse --gst-debug-level = -- optionval --gst-debug-level '' '' +test_gst_launch_parse --gst-debug-level= -- optionval --gst-debug-level '' '' +test_gst_launch_parse --gst-debug-level=5 -- optionval --gst-debug-level '' '' test_gst_launch_parse fak -- element '' '' '' test_gst_launch_parse --messages fak -- element '' '' '' test_gst_launch_parse --gst-debug-level = 5 fak -- element '' '' '' test_gst_launch_parse fakesrc '' -- property '' fakesrc '' test_gst_launch_parse fakesrc is-l -- property '' fakesrc '' test_gst_launch_parse fakesrc is-live = -- propertyval '' fakesrc is-live +test_gst_launch_parse fakesrc is-live= -- propertyval '' fakesrc is-live +test_gst_launch_parse fakesrc is-live=b -- propertyval '' fakesrc is-live test_gst_launch_parse fakesrc is-live = true form -- property '' 'fakesrc' '' test_gst_launch_parse fakesrc is-live = true ! -- ! '' '' '' test_gst_launch_parse fakesrc is-live = true ! fakesi -- element '' '' '' diff --git a/tools/gstreamer-completion b/tools/gstreamer-completion index b262b301da..ecbb522266 100644 --- a/tools/gstreamer-completion +++ b/tools/gstreamer-completion @@ -7,6 +7,7 @@ _gst_inspect() { local cur cword prev words _gst_init_completion [[ "$cur" == "=" ]] && cur= + [[ "$cur" =~ -.*=*$ ]] && prev="${cur%%=*}" cur="${cur#*=}" _gst_common_options || return @@ -137,6 +138,7 @@ _gst_launch_parse() { next="${words[i]}" # Note that COMP_WORDBREAKS by default includes "=" and ":". case "$state,$next" in + start,-*=*) curtype=optionval option="${next%%=*}" state=start;; start,-*) curtype=option option="$next" state=option;; start,) curtype=option-or-element;; start,*) curtype=element element="$next" state=element;; @@ -149,13 +151,17 @@ _gst_launch_parse() { option=,*) curtype=optionval state=start;; element,\!) curtype='!' state='!';; \!,*) curtype=element element="$next" state=element;; + element,*=) + curtype=propertyval property="${next%=}" state=property=;; + element,*=*) + curtype=propertyval property="${next%%=*}" state=element;; element,*) curtype=property property="$next" state=property;; property,=) curtype=propertyval state=property=;; property=,*) curtype=propertyval state=element;; esac i=$((i + 1)) done - [[ "$cur" == "=" ]] && cur="" + cur="${cur#*=}" } _gst_takes_arg() {