2 # Copyright © 2020 František Kučera (Frantovo.cz, GlobalCode.info)
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, version 3 of the License.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 _alt2xml_completion() {
20 w0=${COMP_WORDS[COMP_CWORD]}
21 w1=${COMP_WORDS[COMP_CWORD-1]}
22 w2=${COMP_WORDS[COMP_CWORD-2]}
23 w3=${COMP_WORDS[COMP_CWORD-3]}
37 if [[ "$w1" == "--input-file" ]]; then compopt -o default; COMPREPLY=()
38 elif [[ "$w1" == "--system-id" && "x$w0" == "x" ]]; then COMPREPLY=("''")
39 elif [[ "$w1" == "--input-url" && "x$w0" == "x" ]]; then COMPREPLY=("''")
40 elif [[ "$w1" == "--reader-property" && "x$w0" == "x" ]]; then COMPREPLY=("''")
41 elif [[ "$w2" == "--reader-property" && "x$w0" == "x" ]]; then COMPREPLY=("''")
42 elif [[ "$w1" == "--reader-feature" && "x$w0" == "x" ]]; then COMPREPLY=("''")
43 elif [[ "$w2" == "--reader-feature" && "x$w0" == "x" ]]; then COMPREPLY=("''")
44 elif [[ "$w1" == "--reader-namespace-aware" ]]; then COMPREPLY=($(compgen -W "${BOOLEAN[*]}" -- "$w0"))
45 elif [[ "$w1" == "--action" ]]; then COMPREPLY=($(compgen -W "${ACTION[*]}" -- "$w0"))
46 elif [[ "$w1" == "--action-property" && "x$w0" == "x" ]]; then COMPREPLY=("''")
47 elif [[ "$w2" == "--action-property" && "x$w0" == "x" ]]; then COMPREPLY=("''")
48 elif [[ "$w1" == "--" && "x$w0" == "x" ]]; then COMPREPLY=("''")
57 "--reader-namespace-aware"
62 COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0"))
66 complete -F _alt2xml_completion alt2xml