completion: Try to avoid parsing summary
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Tue, 4 Apr 2017 20:28:45 +0000 (16:28 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Tue, 4 Apr 2017 20:28:45 +0000 (16:28 -0400)
In GES, the summary refers to options that are only available when built
against gst-valdiate. Those where picked by our regex. This patch add a
initial grep to try and filter-out as best as possible the content to
which we will extract the command list.

data/bash-completion/helpers/gst.in

index 0acca06..42cfb26 100644 (file)
@@ -37,7 +37,7 @@ ___gst_plugin_load () { _gst_mandatory_argument; }
 
 _gst_all_arguments ()
 {
-       COMPREPLY=( $(compgen -W "$($1 --help-all | grep -oh '[[:graph:]]*--[[:graph:]]*\|-[[:alpha:]],' | cut -d'=' -f1 | cut -d',' -f1)" -- $cur) )
+       COMPREPLY=( $(compgen -W "$($1 --help-all | grep "^  -" | grep -oh '[[:graph:]]*--[[:graph:]]*\|-[[:alpha:]],' | cut -d'=' -f1 | cut -d',' -f1)" -- $cur) )
 }
 
 _gst_mandatory_argument ()