scripts/bash_completion.pl
branchv_0
changeset 221 e38910065d55
parent 220 0bc544b38cfa
child 222 5ffeb18b6f85
     1.1 --- a/scripts/bash_completion.pl	Sun Aug 16 01:25:01 2015 +0200
     1.2 +++ b/scripts/bash_completion.pl	Sun Aug 16 01:40:44 2015 +0200
     1.3 @@ -63,10 +63,11 @@
     1.4  
     1.5  _sql_dk_bash_completion_formatter_property_choice() {
     1.6  	local property="${COMP_WORDS[COMP_CWORD-1]}";
     1.7 -	echo true;
     1.8 -	echo false;
     1.9 -	echo "TODO_$property";
    1.10 -	# TODO: find choices for the property  
    1.11 +	local formatter_dir='.$formatterPropertiesDir.'/$formatter
    1.12 +	local property_choices_file=$formatter_dir/$property/choices;
    1.13 +	if [ -f $property_choices_file ]; then
    1.14 +		cat $property_choices_file;
    1.15 +	fi
    1.16  }
    1.17  
    1.18  _sql_dk_bash_completion() {
    1.19 @@ -110,6 +111,7 @@
    1.20  	esac;
    1.21  	
    1.22  	if [ "x${COMP_WORDS[COMP_CWORD-2]}" == "x--formatter-property" ]; then
    1.23 +		formatter=$( _sql_dk_bash_completion_find_formatter "${COMP_WORDS[@]}" );
    1.24  		COMPREPLY=( $( compgen -W "$(_sql_dk_bash_completion_formatter_property_choice )" -- $cur ) ); 
    1.25  		return 0;
    1.26  	fi