--- a/bash-completion.sh Sat May 15 18:18:10 2021 +0200
+++ b/bash-completion.sh Sun May 16 17:33:35 2021 +0200
@@ -33,11 +33,17 @@
"value"
)
- if [[ "$w1" == "--relation" && "x$w0" == "x" ]]; then COMPREPLY=("'.*'")
- elif [[ "$w1" == "--attribute" && "x$w0" == "x" ]]; then COMPREPLY=("'.*'")
- elif [[ "$w1" == "--value" && "x$w0" == "x" ]]; then COMPREPLY=("''")
- elif [[ "$w1" == "--replacement" && "x$w0" == "x" ]]; then COMPREPLY=("''")
- elif [[ "$w1" == "--modify" ]]; then COMPREPLY=($(compgen -W "${ENTITY_VALUES[*]}" -- "$w0"))
+ MODIFY_TARGETS=(
+ "relation-name"
+ "attribute-name"
+ "value"
+ )
+
+ if [[ "$w1" == "--relation" && "x$w0" == "x" ]]; then COMPREPLY=("'.+'")
+ elif [[ "$w1" == "--attribute" && "x$w0" == "x" ]]; then COMPREPLY=("'.+'")
+ elif [[ "$w1" == "--value" && "x$w0" == "x" ]]; then COMPREPLY=("'.+'")
+ elif [[ "$w1" == "--replacement" && "x$w0" == "x" ]]; then COMPREPLY=("'\$0'")
+ elif [[ "$w1" == "--modify" ]]; then COMPREPLY=($(compgen -W "${MODIFY_TARGETS[*]}" -- "$w0"))
elif [[ "$w1" == "--case-sensitive" ]]; then COMPREPLY=($(compgen -W "${ENTITY_VALUES[*]}" -- "$w0"))
elif [[ "$w2" == "--case-sensitive" ]]; then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
elif [[ "$w1" == "--invert-match" ]]; then COMPREPLY=($(compgen -W "${ENTITY_VALUES[*]}" -- "$w0"))