bash-completion.sh
branchv_0
changeset 54 bc6e11cccdf4
parent 47 428c278af4be
child 55 3a120e64bb37
equal deleted inserted replaced
53:cc6ffeba0fe5 54:bc6e11cccdf4
    31 		"string"
    31 		"string"
    32 		"integer"
    32 		"integer"
    33 		"boolean"
    33 		"boolean"
    34 	)
    34 	)
    35 
    35 
       
    36 	BOOLEAN_VALUES=(
       
    37 		"true"
       
    38 		"false"
       
    39 	)
       
    40 
    36 	DATA_SOURCE_STRING=(
    41 	DATA_SOURCE_STRING=(
    37 		"Driver=SQLite3;Database=file::memory:"
    42 		"Driver=SQLite3;Database=file::memory:"
    38 		"Driver=SQLite3;Database=file:temp-relpipe.sqlite"
    43 		"Driver=SQLite3;Database=file:temp-relpipe.sqlite"
    39 		"Driver=SQLite3;Database=file:/tmp/relpipe.sqlite"
    44 		"Driver=SQLite3;Database=file:/tmp/relpipe.sqlite"
    40 	)
    45 	)
    41 
    46 
    42 	if   [[ "$w1" == "--relation"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    47 	if   [[ "$w1" == "--relation"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    43 	elif [[ "$w2" == "--relation"      && "x$w0" == "x" ]];    then COMPREPLY=('"SELECT * FROM "')
    48 	elif [[ "$w2" == "--relation"      && "x$w0" == "x" ]];    then COMPREPLY=('"SELECT * FROM "')
    44 	elif [[ "$w1" == "--type-cast"     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    49 	elif [[ "$w1" == "--type-cast"     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    45 	elif [[ "$w2" == "--type-cast"                      ]];    then COMPREPLY=($(compgen -W "${DATA_TYPE[*]}" -- "$w0"))
    50 	elif [[ "$w2" == "--type-cast"                      ]];    then COMPREPLY=($(compgen -W "${DATA_TYPE[*]}" -- "$w0"))
       
    51 	elif [[ "$w1" == "--list-data-sources"              ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
    46 	elif [[ "$w1" == "--parameter"     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    52 	elif [[ "$w1" == "--parameter"     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    47 	elif [[ "$w1" == "--copy"          && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
    53 	elif [[ "$w1" == "--copy"          && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
    48 	elif [[ "$w1" == "--copy-renamed"  && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
    54 	elif [[ "$w1" == "--copy-renamed"  && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
    49 	elif [[ "$w2" == "--copy-renamed"  && "x$w0" == "x" ]];    then COMPREPLY=("'copy_of_\$0'")
    55 	elif [[ "$w2" == "--copy-renamed"  && "x$w0" == "x" ]];    then COMPREPLY=("'copy_of_\$0'")
    50 	elif [[ "$w1" == "--data-source-name"               ]];    then COMPREPLY=($(compgen -W "$(_relpipe_tr_sql_completion_dsn)" -- "$w0"))
    56 	elif [[ "$w1" == "--data-source-name"               ]];    then COMPREPLY=($(compgen -W "$(_relpipe_tr_sql_completion_dsn)" -- "$w0"))