2015-02-20 21:04:22 +00:00
|
|
|
|
# GStreamer
|
|
|
|
|
# Copyright (C) 2015 Mathieu Duponchelle <mathieu.duponchelle@opencreed.com>
|
|
|
|
|
#
|
|
|
|
|
# bash/zsh completion support for common gstreamer options
|
|
|
|
|
#
|
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU Library General Public
|
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
|
# version 2 of the License, or (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# This library is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
# Library General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU Library General Public
|
|
|
|
|
# License along with this library; if not, write to the
|
|
|
|
|
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
|
# Boston, MA 02110-1301, USA.
|
|
|
|
|
|
2017-04-04 17:42:50 +00:00
|
|
|
|
_GST_HELPER="@GST_COMPLETION_HELPER_INSTALLED@"
|
|
|
|
|
if [[ ! -x "$_GST_HELPER" ]]
|
|
|
|
|
then
|
|
|
|
|
helper="$(pkg-config --variable=helpersdir gstreamer-@GST_API_VERSION@)/gst-completion-helper"
|
|
|
|
|
|
|
|
|
|
if [ -x "$helper" ]
|
|
|
|
|
then
|
|
|
|
|
_GST_HELPER=$helper
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2015-03-18 18:38:15 +00:00
|
|
|
|
___gst_debug_level () { _gst_mandatory_argument; }
|
|
|
|
|
___gst_debug () { _gst_mandatory_argument; }
|
|
|
|
|
___gst_debug_color_mode () { _gst_mandatory_argument; }
|
|
|
|
|
___gst_plugin_path () { _gst_mandatory_argument; }
|
|
|
|
|
___gst_plugin_load () { _gst_mandatory_argument; }
|
2015-02-20 21:04:22 +00:00
|
|
|
|
|
2017-04-04 17:42:50 +00:00
|
|
|
|
_gst_all_arguments ()
|
|
|
|
|
{
|
2017-04-04 20:28:45 +00:00
|
|
|
|
COMPREPLY=( $(compgen -W "$($1 --help-all | grep "^ -" | grep -oh '[[:graph:]]*--[[:graph:]]*\|-[[:alpha:]],' | cut -d'=' -f1 | cut -d',' -f1)" -- $cur) )
|
2017-04-04 17:42:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-03-18 18:38:15 +00:00
|
|
|
|
_gst_mandatory_argument ()
|
2015-02-20 21:04:22 +00:00
|
|
|
|
{
|
2017-04-04 17:42:50 +00:00
|
|
|
|
__app=$1
|
|
|
|
|
if [[ -z $__app ]]
|
|
|
|
|
then
|
|
|
|
|
__app=gst-launch-1.0
|
|
|
|
|
fi
|
|
|
|
|
|
2015-02-20 21:04:22 +00:00
|
|
|
|
if [[ "$prev" != "$command" ]]
|
|
|
|
|
then
|
2017-04-04 17:42:50 +00:00
|
|
|
|
_gst_all_arguments $__app
|
2015-02-20 21:04:22 +00:00
|
|
|
|
else
|
|
|
|
|
COMPREPLY=("$cur")
|
|
|
|
|
fi
|
|
|
|
|
}
|