ges-launch: Prefix clip, transition and effect instruction with a +

Slightly changing the CLI so that we have indicators of the timeline
commands adding new objects.
This commit is contained in:
Thibault Saunier 2015-03-13 12:02:30 +00:00
parent 20d94bea13
commit 663824d20f
3 changed files with 12 additions and 11 deletions

View file

@ -75,7 +75,7 @@ _ges_effect () {
then then
_mandatory__argument _mandatory__argument
else else
COMPREPLY=( $(compgen -W "duration= start= layer= $(ges-launch-1.0 help all | egrep '^ [a-zA-Z0-9]')" -- $cur) ) COMPREPLY=( $(compgen -W "duration= start= layer= $(ges-launch-1.0 help all | egrep '^ +')" -- $cur) )
fi fi
} }
@ -84,7 +84,7 @@ _ges_list_options () {
} }
_ges_list_commands () { _ges_list_commands () {
COMPREPLY=( $(compgen -W "$(ges-launch-1.0 help all | egrep '^ [a-zA-Z0-9]')" -- $cur) ) COMPREPLY=( $(compgen -W "$(ges-launch-1.0 help all | egrep '^ +')" -- $cur) )
} }
_ges_list_properties () { _ges_list_properties () {
@ -93,10 +93,10 @@ _ges_list_properties () {
if [[ "$real_command" == "" ]] if [[ "$real_command" == "" ]]
then then
_mandatory__argument _mandatory__argument
elif [[ "$real_command" == "clip" ]] elif [[ "$real_command" == "+clip" ]]
then then
COMPREPLY=( $(compgen -W "set-alpha set-posx set-posy set-width set-height set-volume set-mute" -- $cur) ) COMPREPLY=( $(compgen -W "set-alpha set-posx set-posy set-width set-height set-volume set-mute" -- $cur) )
elif [[ "$real_command" == "effect" ]] elif [[ "$real_command" == "+effect" ]]
then then
COMPREPLY=() COMPREPLY=()
effect_bin_description="${effect_bin_description//\"/ }" effect_bin_description="${effect_bin_description//\"/ }"
@ -134,7 +134,7 @@ __ges_main ()
{ {
local i=1 c=1 command function_exists completion_func commands real_command effect_bin_description local i=1 c=1 command function_exists completion_func commands real_command effect_bin_description
commands=($(ges-launch-1.0 help all | egrep '^ [a-zA-Z0-9]')) commands=($(ges-launch-1.0 help all | egrep '^ +'))
real_command="" real_command=""
effect_bin_description="" effect_bin_description=""
@ -154,7 +154,7 @@ __ges_main ()
then then
real_command="$var" real_command="$var"
command="$var" command="$var"
if [[ "$var" == "effect" ]] if [[ "$var" == "+effect" ]]
then then
effect_bin_description="${COMP_WORDS[i+1]}" effect_bin_description="${COMP_WORDS[i+1]}"
fi fi
@ -165,7 +165,8 @@ __ges_main ()
if [[ "$command" == "--gst"* ]]; then if [[ "$command" == "--gst"* ]]; then
completion_func="_${command//-/_}" completion_func="_${command//-/_}"
else else
completion_func="_ges_${command//-/_}" completion_func="_ges_${command//-|+/_}"
completion_func="${completion_func//+/}"
fi fi
declare -f $completion_func >/dev/null 2>&1 declare -f $completion_func >/dev/null 2>&1

View file

@ -121,7 +121,7 @@ ges_structure_parser_parse_symbol (GESStructureParser * self,
{ {
_finish_structure (self); _finish_structure (self);
while (*symbol == ' ') while (*symbol == ' ' || *symbol == '+')
symbol++; symbol++;
self->add_comma = FALSE; self->add_comma = FALSE;

View file

@ -10,9 +10,9 @@
%option never-interactive %option never-interactive
%option noinput %option noinput
CLIP [ ]+clip[ ]+ CLIP [ ]+\+clip[ ]+
TRANSITION [ ]+transition[ ]+ TRANSITION [ ]+\+transition[ ]+
EFFECT [ ]+effect[ ]+ EFFECT [ ]+\+effect[ ]+
SETTER [ ]+set-[^ ]+[ ]+ SETTER [ ]+set-[^ ]+[ ]+