gstreamer/tools/gstreamer-completion
David Schleef 2dacd269fc tools/gstreamer-completion: Replacement for gst-complete written in sh and sed. Only completes names of features, bu...
Original commit message from CVS:
* tools/gstreamer-completion:
Replacement for gst-complete written in sh and sed.  Only
completes names of features, but that's 90% of what I want
it for.  Properties are not available in registry.xml.  (Maybe
they should be...)
2005-12-25 03:45:45 +00:00

28 lines
543 B
Plaintext

#
# Put this in /etc/bash_completion.d/
#
_gst_launch()
{
local cur
: ${GST_REGISTRY:=~/.gstreamer-0.10/registry.xml}
: ${GST_COMPLETE:=~/.gstreamer-0.10/complete}
if [ ! -f "${GST_REGISTRY}" ] ; then
return 0
fi
if [ ! -f "${GST_COMPLETE}" \
-o "${GST_REGISTRY}" -nt "${GST_COMPLETE}" ] ; then
sed -n 's/^..<name>\(.*\)<\/name>/\1/ p' ${GST_REGISTRY} >${GST_COMPLETE}
fi
cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(grep ^$cur $GST_COMPLETE) )
return 0
}
complete -F _gst_launch -o default gst-launch