scripts/bash_completion.pl
branchv_0
changeset 221 e38910065d55
parent 220 0bc544b38cfa
child 222 5ffeb18b6f85
equal deleted inserted replaced
220:0bc544b38cfa 221:e38910065d55
    61 	fi
    61 	fi
    62 }
    62 }
    63 
    63 
    64 _sql_dk_bash_completion_formatter_property_choice() {
    64 _sql_dk_bash_completion_formatter_property_choice() {
    65 	local property="${COMP_WORDS[COMP_CWORD-1]}";
    65 	local property="${COMP_WORDS[COMP_CWORD-1]}";
    66 	echo true;
    66 	local formatter_dir='.$formatterPropertiesDir.'/$formatter
    67 	echo false;
    67 	local property_choices_file=$formatter_dir/$property/choices;
    68 	echo "TODO_$property";
    68 	if [ -f $property_choices_file ]; then
    69 	# TODO: find choices for the property  
    69 		cat $property_choices_file;
       
    70 	fi
    70 }
    71 }
    71 
    72 
    72 _sql_dk_bash_completion() {
    73 _sql_dk_bash_completion() {
    73 	local cur prev formatter
    74 	local cur prev formatter
    74 
    75 
   108 		return 0;
   109 		return 0;
   109 		;;
   110 		;;
   110 	esac;
   111 	esac;
   111 	
   112 	
   112 	if [ "x${COMP_WORDS[COMP_CWORD-2]}" == "x--formatter-property" ]; then
   113 	if [ "x${COMP_WORDS[COMP_CWORD-2]}" == "x--formatter-property" ]; then
       
   114 		formatter=$( _sql_dk_bash_completion_find_formatter "${COMP_WORDS[@]}" );
   113 		COMPREPLY=( $( compgen -W "$(_sql_dk_bash_completion_formatter_property_choice )" -- $cur ) ); 
   115 		COMPREPLY=( $( compgen -W "$(_sql_dk_bash_completion_formatter_property_choice )" -- $cur ) ); 
   114 		return 0;
   116 		return 0;
   115 	fi
   117 	fi
   116 
   118 
   117 	COMPREPLY=( $( compgen -W "
   119 	COMPREPLY=( $( compgen -W "