# HG changeset patch # User František Kučera # Date 1607269258 -3600 # Node ID d6d710336e7c61a321b160ab33483486a1d045ad # Parent 84ff7c97bfdc586ac00b5d44ffc81f1cc0130673 add --parser-option 'root-name' 'custom-root-element-name': bash-completion.sh diff -r 84ff7c97bfdc -r d6d710336e7c bash-completion.sh --- 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=(