bash-completion.sh
branchv_0
changeset 47 428c278af4be
parent 37 3de41719d7eb
child 54 bc6e11cccdf4
equal deleted inserted replaced
46:85e6dc1853ee 47:428c278af4be
    31 		"string"
    31 		"string"
    32 		"integer"
    32 		"integer"
    33 		"boolean"
    33 		"boolean"
    34 	)
    34 	)
    35 
    35 
    36 	DATA_SOURCE_URL=(
    36 	DATA_SOURCE_STRING=(
    37 		"Driver=SQLite3;Database=file::memory:"
    37 		"Driver=SQLite3;Database=file::memory:"
    38 		"Driver=SQLite3;Database=file:temp-relpipe.sqlite"
    38 		"Driver=SQLite3;Database=file:temp-relpipe.sqlite"
    39 		"Driver=SQLite3;Database=file:/tmp/relpipe.sqlite"
    39 		"Driver=SQLite3;Database=file:/tmp/relpipe.sqlite"
    40 	)
    40 	)
    41 
    41 
    46 	elif [[ "$w1" == "--parameter"     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    46 	elif [[ "$w1" == "--parameter"     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    47 	elif [[ "$w1" == "--copy"          && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
    47 	elif [[ "$w1" == "--copy"          && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
    48 	elif [[ "$w1" == "--copy-renamed"  && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
    48 	elif [[ "$w1" == "--copy-renamed"  && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
    49 	elif [[ "$w2" == "--copy-renamed"  && "x$w0" == "x" ]];    then COMPREPLY=("'copy_of_\$0'")
    49 	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"))
    50 	elif [[ "$w1" == "--data-source-name"               ]];    then COMPREPLY=($(compgen -W "$(_relpipe_tr_sql_completion_dsn)" -- "$w0"))
    51 	elif [[ "$w1" == "--data-source-url"                ]];    then COMPREPLY=($(compgen -W "${DATA_SOURCE_URL[*]}" -- "$w0"))
    51 	elif [[ "$w1" == "--data-source-string"             ]];    then COMPREPLY=($(compgen -W "${DATA_SOURCE_STRING[*]}" -- "$w0"))
    52 	else
    52 	else
    53 		OPTIONS=(
    53 		OPTIONS=(
    54 			"--relation"
    54 			"--relation"
    55 			"--type-cast"
    55 			"--type-cast"
    56 			"--parameter"
    56 			"--parameter"
    57 			"--copy"
    57 			"--copy"
    58 			"--copy-renamed"
    58 			"--copy-renamed"
    59 			"--list-data-sources"
    59 			"--list-data-sources"
    60 			"--data-source-name"
    60 			"--data-source-name"
    61 			"--data-source-url"
    61 			"--data-source-string"
    62 		)
    62 		)
    63 		COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0"))
    63 		COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0"))
    64 	fi
    64 	fi
    65 }
    65 }
    66 
    66