bash-completion.sh
branchv_0
changeset 59 a1775ba6d056
parent 55 3a120e64bb37
equal deleted inserted replaced
58:a4907b207f0c 59:a1775ba6d056
    36 	BOOLEAN_VALUES=(
    36 	BOOLEAN_VALUES=(
    37 		"true"
    37 		"true"
    38 		"false"
    38 		"false"
    39 	)
    39 	)
    40 
    40 
       
    41 	ON_DUPLICATE_RELATION=(
       
    42 		"fail"
       
    43 		"insert"
       
    44 		# "extend"
       
    45 		# "drop"
       
    46 		# "skip"
       
    47 		# "rename-new"
       
    48 		# "rename-old"
       
    49 	)
       
    50 
    41 	DATA_SOURCE_STRING=(
    51 	DATA_SOURCE_STRING=(
    42 		"Driver=SQLite3;Database=file::memory:"
    52 		"Driver=SQLite3;Database=file::memory:"
    43 		"Driver=SQLite3;Database=file:temp-relpipe.sqlite"
    53 		"Driver=SQLite3;Database=file:temp-relpipe.sqlite"
    44 		"Driver=SQLite3;Database=file:/tmp/relpipe.sqlite"
    54 		"Driver=SQLite3;Database=file:/tmp/relpipe.sqlite"
    45 	)
    55 	)
    48 	elif [[ "$w2" == "--relation"      && "x$w0" == "x" ]];    then COMPREPLY=('"SELECT * FROM "')
    58 	elif [[ "$w2" == "--relation"      && "x$w0" == "x" ]];    then COMPREPLY=('"SELECT * FROM "')
    49 	elif [[ "$w1" == "--type-cast"     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    59 	elif [[ "$w1" == "--type-cast"     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    50 	elif [[ "$w2" == "--type-cast"                      ]];    then COMPREPLY=($(compgen -W "${DATA_TYPE[*]}" -- "$w0"))
    60 	elif [[ "$w2" == "--type-cast"                      ]];    then COMPREPLY=($(compgen -W "${DATA_TYPE[*]}" -- "$w0"))
    51 	elif [[ "$w1" == "--list-data-sources"              ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
    61 	elif [[ "$w1" == "--list-data-sources"              ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
    52 	elif [[ "$w1" == "--parameter"     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    62 	elif [[ "$w1" == "--parameter"     && "x$w0" == "x" ]];    then COMPREPLY=("''")
       
    63 	elif [[ "$w1" == "--on-duplicate-relation"          ]];    then COMPREPLY=($(compgen -W "${ON_DUPLICATE_RELATION[*]}" -- "$w0"))
    53 	elif [[ "$w1" == "--copy"          && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
    64 	elif [[ "$w1" == "--copy"          && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
    54 	elif [[ "$w1" == "--copy-renamed"  && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
    65 	elif [[ "$w1" == "--copy-renamed"  && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
    55 	elif [[ "$w2" == "--copy-renamed"  && "x$w0" == "x" ]];    then COMPREPLY=("'copy_of_\$0'")
    66 	elif [[ "$w2" == "--copy-renamed"  && "x$w0" == "x" ]];    then COMPREPLY=("'copy_of_\$0'")
    56 	elif [[ "$w1" == "--data-source-name"               ]];    then COMPREPLY=($(compgen -W "$(_relpipe_tr_sql_completion_dsn)" -- "$w0"))
    67 	elif [[ "$w1" == "--data-source-name"               ]];    then COMPREPLY=($(compgen -W "$(_relpipe_tr_sql_completion_dsn)" -- "$w0"))
    57 	elif [[ "$w1" == "--data-source-string"             ]];    then COMPREPLY=($(compgen -W "${DATA_SOURCE_STRING[*]}" -- "$w0"))
    68 	elif [[ "$w1" == "--data-source-string"             ]];    then COMPREPLY=($(compgen -W "${DATA_SOURCE_STRING[*]}" -- "$w0"))
    58 	else
    69 	else
    59 		OPTIONS=(
    70 		OPTIONS=(
    60 			"--relation"
    71 			"--relation"
    61 			"--type-cast"
    72 			"--type-cast"
    62 			"--parameter"
    73 			"--parameter"
       
    74 			"--on-duplicate-relation"
    63 			"--copy"
    75 			"--copy"
    64 			"--copy-renamed"
    76 			"--copy-renamed"
    65 			"--list-data-sources"
    77 			"--list-data-sources"
    66 			"--data-source-name"
    78 			"--data-source-name"
    67 			"--data-source-string"
    79 			"--data-source-string"