From 17295138eb55cfa517b607c5ec67db2bb4f70b53 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 4 Apr 2017 16:20:17 -0400 Subject: [PATCH] completion: Fix listing commands Executing a single string does not work in this context. Fixed using a bash function instead. --- data/completions/ges-launch-1.0 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/data/completions/ges-launch-1.0 b/data/completions/ges-launch-1.0 index d5572b2d0a..90eee61bfe 100644 --- a/data/completions/ges-launch-1.0 +++ b/data/completions/ges-launch-1.0 @@ -30,7 +30,11 @@ fi . "$HELPERDIR"/gst HELPER="$_GST_HELPER" -GES_COMMAND_LIST="ges-launch-1.0 help | grep '^ +' | cut -d' ' -f3" + +_list_commands () +{ + ges-launch-1.0 help | grep '^ +' | cut -d' ' -f3 +} _ges___inspect_action_type () { @@ -67,7 +71,7 @@ _ges_clip () { then _gst_mandatory_argument else - COMPREPLY=( $(compgen -W "duration= inpoint= start= layer= $($GES_COMMAND_LIST)" -- $cur) ) + COMPREPLY=( $(compgen -W "duration= inpoint= start= layer= $(_list_commands)" -- $cur) ) fi } @@ -76,7 +80,7 @@ _ges_test_clip () { then _gst_mandatory_argument else - COMPREPLY=( $(compgen -W "duration= inpoint= start= layer= $($GES_COMMAND_LIST)" -- $cur) ) + COMPREPLY=( $(compgen -W "duration= inpoint= start= layer= $(_list_commands)" -- $cur) ) fi } @@ -85,7 +89,7 @@ _ges_effect () { then _gst_mandatory_argument else - COMPREPLY=( $(compgen -W "duration= start= layer= $($GES_COMMAND_LIST)" -- $cur) ) + COMPREPLY=( $(compgen -W "duration= start= layer= $(_list_commands)" -- $cur) ) fi } @@ -94,7 +98,7 @@ _ges_list_options () { } _ges_list_commands () { - COMPREPLY=( $(compgen -W "$($GES_COMMAND_LIST)" -- $cur) ) + COMPREPLY=( $(compgen -W "$(_list_commands)" -- $cur) ) } _ges_list_properties () { @@ -147,7 +151,7 @@ __ges_main () { local i=1 c=1 command function_exists completion_func commands real_command effect_bin_description - commands=($(ges-launch-1.0 help all | egrep '^ +')) + commands=($(_ges_list_command)) real_command="" effect_bin_description="" -- 2.34.1