bash-completion.sh
author František Kučera <franta-hg@frantovo.cz>
Mon, 30 Nov 2020 00:12:16 +0100
branchv_0
changeset 32 e72546725c77
parent 31 c6527b45fbc2
child 33 c9a158da6c32
permissions -rw-r--r--
add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
# Relational pipes
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
# Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
#
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
# This program is free software: you can redistribute it and/or modify
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
# it under the terms of the GNU General Public License as published by
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
# the Free Software Foundation, version 3 of the License.
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
#
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
# This program is distributed in the hope that it will be useful,
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
# GNU General Public License for more details.
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
#
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
# You should have received a copy of the GNU General Public License
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
# along with this program. If not, see <http://www.gnu.org/licenses/>.
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
15
f4fb07ed8753 relpipe-in-initable is fork of relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents: 11
diff changeset
    16
_relpipe_in_initable_completion() {
5
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
	local w0 w1 w2 w3
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
	COMPREPLY=()
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
	w0=${COMP_WORDS[COMP_CWORD]}
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
	w1=${COMP_WORDS[COMP_CWORD-1]}
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
	w2=${COMP_WORDS[COMP_CWORD-2]}
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
	w3=${COMP_WORDS[COMP_CWORD-3]}
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
	DATA_TYPE=(
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
		"string"
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
		"integer"
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
		"boolean"
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
	)
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
30
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    31
	BOOLEAN_VALUES=(
7
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 5
diff changeset
    32
		"true"
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 5
diff changeset
    33
		"false"
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 5
diff changeset
    34
	)
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 5
diff changeset
    35
8
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    36
	MODE=(
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    37
		"string"
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    38
		"boolean"
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    39
		"raw-xml"
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    40
		"line-number"
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    41
		"xpath"
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    42
	)
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    43
5
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
	# FIXME: user must type " and then press TAB otherwise the completion is broken due to the : colon
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
	#
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
	# can be fixed by global modification of environment variable:
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
	#	COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
	# but it will affect other completions (where : is a separator)
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
	#
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    50
	# these functions should help:
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    51
	#	_get_comp_words_by_ref -n : cur
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    52
	#	__ltrim_colon_completions "$cur"
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    53
	# but was not working (despite w0 renamed to cur)
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    54
	XMLNS=(
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    55
		"tag:globalcode.info,2018:relpipe"
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    56
		"http://www.w3.org/1999/xhtml"
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    57
		"http://www.w3.org/2000/svg"
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    58
		"http://www.w3.org/2005/Atom"
11
afeb4e096753 bash-completion: add DocBook XMLNS
František Kučera <franta-hg@frantovo.cz>
parents: 8
diff changeset
    59
		"http://docbook.org/ns/docbook"
5
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    60
	)
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    61
30
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    62
	# TODO: introspection: after moving to alt2xml the available options and their values should be provided by the parser
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    63
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    64
	PARSER_OPTIONS=(
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    65
		"trim-continuing-lines"
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    66
		"allow-sections"
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    67
		"allow-section-tags"
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    68
		"allow-sub-keys"
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    69
		"comment-separators"
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    70
		"key-value-separators"
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    71
		"quotes"
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    72
		"dialect"
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    73
		"unescape-basic"
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    74
		"unescape-java-properties"
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    75
		"unescape-backspace"
31
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    76
		"tree-style"
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    77
		"tree-with-namespaces"
32
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    78
		"root-name"
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    79
		"enable-whitespace"
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    80
		"enable-comments"
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    81
		"enable-sub-keys"
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    82
		"enable-line-numbers"
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
    83
		"enable-event-numbers"
30
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    84
	);
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    85
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    86
	DIALECTS=(
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    87
		"java-properties"
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    88
	);
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    89
31
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    90
	TREE_STYLES=(
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    91
		"standard"
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    92
		"literal"
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    93
	)
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    94
5
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    95
8
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    96
	if   [[ "$w1" == "--relation"                      && "x$w0" == "x" ]];    then COMPREPLY=("''")
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    97
	elif [[ "$w1" == "--records"                       && "x$w0" == "x" ]];    then COMPREPLY=("'/'")
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    98
	elif [[ "$w1" == "--attribute"                     && "x$w0" == "x" ]];    then COMPREPLY=("''")
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
    99
	elif [[ "$w2" == "--attribute"                                      ]];    then COMPREPLY=($(compgen -W "${DATA_TYPE[*]}" -- "$w0"))
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   100
	elif [[ "$w3" == "--attribute"                     && "x$w0" == "x" ]];    then COMPREPLY=("''")
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   101
	elif [[ "$w1" == "--namespace"                     && "x$w0" == "x" ]];    then COMPREPLY=("''")
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   102
	elif [[ "$w2" == "--namespace"                                      ]];    then COMPREPLY=($(compgen -W "${XMLNS[*]}" -- "$w0"))
30
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   103
	elif [[ "$w1" == "--xinclude"                                       ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
8
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   104
	elif [[ "$w1" == "--mode"                                           ]];    then COMPREPLY=($(compgen -W "${MODE[*]}" -- "$w0"))
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   105
	elif [[ "$w1" == "--raw-xml-nodelist-wrapper"                       ]];    then COMPREPLY=("'xml'")
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   106
	elif [[ "$w2" == "--raw-xml-nodelist-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   107
	elif [[ "$w3" == "--raw-xml-nodelist-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   108
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   109
	elif [[ "$w1" == "--raw-xml-attribute-wrapper"                       ]];    then COMPREPLY=("'attribute'")
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   110
	elif [[ "$w2" == "--raw-xml-attribute-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   111
	elif [[ "$w3" == "--raw-xml-attribute-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
30
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   112
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   113
	elif [[ "$w1" == "--parser-option"                                  ]];    then COMPREPLY=($(compgen -W "${PARSER_OPTIONS[*]}" -- "$w0"))
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   114
	elif [[ "$w2" == "--parser-option" && "$w1" == "trim-continuing-lines"                    ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   115
	elif [[ "$w2" == "--parser-option" && "$w1" == "allow-sections"                           ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   116
	elif [[ "$w2" == "--parser-option" && "$w1" == "allow-section-tags"                       ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   117
	elif [[ "$w2" == "--parser-option" && "$w1" == "allow-sub-keys"                           ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   118
	elif [[ "$w2" == "--parser-option" && "$w1" == "unescape-basic"                           ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   119
	elif [[ "$w2" == "--parser-option" && "$w1" == "unescape-java-properties"                 ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   120
	elif [[ "$w2" == "--parser-option" && "$w1" == "unescape-backspace"                       ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   121
	elif [[ "$w2" == "--parser-option" && "$w1" == "dialect"                                  ]];    then COMPREPLY=($(compgen -W "${DIALECTS[*]}" -- "$w0"))
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   122
	elif [[ "$w2" == "--parser-option" && "$w1" == "comment-separators"      && "x$w0" == "x" ]];    then COMPREPLY=("'#;'")
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   123
	elif [[ "$w2" == "--parser-option" && "$w1" == "key-value-separators"    && "x$w0" == "x" ]];    then COMPREPLY=("'=:'")
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   124
	elif [[ "$w2" == "--parser-option" && "$w1" == "quotes"                  && "x$w0" == "x" ]];    then COMPREPLY=("\$'\"\\''")
31
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
   125
	elif [[ "$w2" == "--parser-option" && "$w1" == "tree-style"                               ]];    then COMPREPLY=($(compgen -W "${TREE_STYLES[*]}" -- "$w0"))
c6527b45fbc2 add --parser-option tree-style standard|literal --parser-option tree-with-namespaces true|false
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
   126
	elif [[ "$w2" == "--parser-option" && "$w1" == "tree-with-namespaces"                     ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
32
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
   127
	elif [[ "$w2" == "--parser-option" && "$w1" == "root-name"               && "x$w0" == "x" ]];    then COMPREPLY=("'ini'")
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
   128
	elif [[ "$w2" == "--parser-option" && "$w1" == "enable-whitespace"                        ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
   129
	elif [[ "$w2" == "--parser-option" && "$w1" == "enable-comments"                          ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
   130
	elif [[ "$w2" == "--parser-option" && "$w1" == "enable-sub-keys"                          ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
   131
	elif [[ "$w2" == "--parser-option" && "$w1" == "enable-line-numbers"                      ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
e72546725c77 add --parser-option root-name, enable-comments, enable-whitespace, enable-line-numbers, enable-event-numbers, enable-sub-keys
František Kučera <franta-hg@frantovo.cz>
parents: 31
diff changeset
   132
	elif [[ "$w2" == "--parser-option" && "$w1" == "enable-event-numbers"                     ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
30
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   133
5
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   134
	else
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   135
		OPTIONS=(
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   136
			"--namespace"
30
f686bdaeb9e0 add --parser-option
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
   137
			"--parser-option"
5
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   138
			"--relation"
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   139
			"--records"
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   140
			"--name-is-xpath"
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   141
			"--attribute"
7
ff69af3c67a3 XInclude support – option: --xinclude true
František Kučera <franta-hg@frantovo.cz>
parents: 5
diff changeset
   142
			"--xinclude"
8
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   143
			"--mode"
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   144
			"--raw-xml-nodelist-wrapper"
8730e2d0db0e suport multiple modes of reading from XML: string, boolean, raw-xml, line-number, xpath
František Kučera <franta-hg@frantovo.cz>
parents: 7
diff changeset
   145
			"--raw-xml-attribute-wrapper"
5
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   146
		)
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   147
		COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0"))
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   148
	fi
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   149
}
accf73de6778 bash-completion script (bit broken due to the : colons in xmlns)
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   150
15
f4fb07ed8753 relpipe-in-initable is fork of relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents: 11
diff changeset
   151
complete -F _relpipe_in_initable_completion relpipe-in-initable