--- a/bash-completion.sh Sat Dec 05 20:17:27 2020 +0100
+++ b/bash-completion.sh Sun Dec 06 16:40:58 2020 +0100
@@ -59,6 +59,12 @@
"http://docbook.org/ns/docbook"
)
+ # TODO: introspection: after moving to alt2xml the available options and their values should be provided by the parser
+
+ PARSER_OPTIONS=(
+ "root-name"
+ );
+
if [[ "$w1" == "--relation" && "x$w0" == "x" ]]; then COMPREPLY=("''")
elif [[ "$w1" == "--records" && "x$w0" == "x" ]]; then COMPREPLY=("'/'")
@@ -77,8 +83,8 @@
elif [[ "$w2" == "--raw-xml-attribute-wrapper" && "x$w0" == "x" ]]; then COMPREPLY=("''")
elif [[ "$w3" == "--raw-xml-attribute-wrapper" && "x$w0" == "x" ]]; then COMPREPLY=("''")
- elif [[ "$w1" == "--parser-option" ]]; then COMPREPLY=("''")
- elif [[ "$w2" == "--parser-option" && "x$w0" == "x" ]]; then COMPREPLY=("''")
+ elif [[ "$w1" == "--parser-option" ]]; then COMPREPLY=($(compgen -W "${PARSER_OPTIONS[*]}" -- "$w0"))
+ elif [[ "$w2" == "--parser-option" && "x$w0" == "x" ]]; then COMPREPLY=("''")
else
OPTIONS=(