bash-completion.sh
branchv_0
changeset 24 884ece10575d
parent 18 76cbba3f7041
child 34 24c05e69d68f
--- a/bash-completion.sh	Fri Dec 13 22:19:41 2019 +0100
+++ b/bash-completion.sh	Sat Dec 14 14:00:36 2019 +0100
@@ -21,9 +21,16 @@
 	w1=${COMP_WORDS[COMP_CWORD-1]}
 	w2=${COMP_WORDS[COMP_CWORD-2]}
 
+	DATA_TYPE=(
+		"string"
+		"integer"
+		"boolean"
+	)
 
 	if   [[ "$w1" == "--relation"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
 	elif [[ "$w2" == "--relation"      && "x$w0" == "x" ]];    then COMPREPLY=('"SELECT * FROM "')
+	elif [[ "$w1" == "--type-cast"     && "x$w0" == "x" ]];    then COMPREPLY=("''")
+	elif [[ "$w2" == "--type-cast"                      ]];    then COMPREPLY=($(compgen -W "${DATA_TYPE[*]}" -- "$w0"))
 	elif [[ "$w1" == "--parameter"     && "x$w0" == "x" ]];    then COMPREPLY=("''")
 	elif [[ "$w1" == "--copy"          && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
 	elif [[ "$w1" == "--copy-renamed"  && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
@@ -33,6 +40,7 @@
 	else
 		OPTIONS=(
 			"--relation"
+			"--type-cast"
 			"--parameter"
 			"--copy"
 			"--copy-renamed"