bash-completion.sh
branchv_0
changeset 25 0e8a58946c48
parent 20 e67584a06be6
child 27 d6d710336e7c
equal deleted inserted replaced
24:ee72fccc5267 25:0e8a58946c48
    26 		"string"
    26 		"string"
    27 		"integer"
    27 		"integer"
    28 		"boolean"
    28 		"boolean"
    29 	)
    29 	)
    30 
    30 
    31 	XINCLUDE=(
    31 	BOOLEAN_VALUES=(
    32 		"true"
    32 		"true"
    33 		"false"
    33 		"false"
    34 	)
    34 	)
    35 
    35 
    36 	MODE=(
    36 	MODE=(
    65 	elif [[ "$w1" == "--attribute"                     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    65 	elif [[ "$w1" == "--attribute"                     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    66 	elif [[ "$w2" == "--attribute"                                      ]];    then COMPREPLY=($(compgen -W "${DATA_TYPE[*]}" -- "$w0"))
    66 	elif [[ "$w2" == "--attribute"                                      ]];    then COMPREPLY=($(compgen -W "${DATA_TYPE[*]}" -- "$w0"))
    67 	elif [[ "$w3" == "--attribute"                     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    67 	elif [[ "$w3" == "--attribute"                     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    68 	elif [[ "$w1" == "--namespace"                     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    68 	elif [[ "$w1" == "--namespace"                     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    69 	elif [[ "$w2" == "--namespace"                                      ]];    then COMPREPLY=($(compgen -W "${XMLNS[*]}" -- "$w0"))
    69 	elif [[ "$w2" == "--namespace"                                      ]];    then COMPREPLY=($(compgen -W "${XMLNS[*]}" -- "$w0"))
    70 	elif [[ "$w1" == "--xinclude"                                       ]];    then COMPREPLY=($(compgen -W "${XINCLUDE[*]}" -- "$w0"))
    70 	elif [[ "$w1" == "--xinclude"                                       ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
    71 	elif [[ "$w1" == "--mode"                                           ]];    then COMPREPLY=($(compgen -W "${MODE[*]}" -- "$w0"))
    71 	elif [[ "$w1" == "--mode"                                           ]];    then COMPREPLY=($(compgen -W "${MODE[*]}" -- "$w0"))
    72 	elif [[ "$w1" == "--raw-xml-nodelist-wrapper"                       ]];    then COMPREPLY=("'xml'")
    72 	elif [[ "$w1" == "--raw-xml-nodelist-wrapper"                       ]];    then COMPREPLY=("'xml'")
    73 	elif [[ "$w2" == "--raw-xml-nodelist-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    73 	elif [[ "$w2" == "--raw-xml-nodelist-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    74 	elif [[ "$w3" == "--raw-xml-nodelist-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    74 	elif [[ "$w3" == "--raw-xml-nodelist-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    75 
    75 
    76 	elif [[ "$w1" == "--raw-xml-attribute-wrapper"                       ]];    then COMPREPLY=("'attribute'")
    76 	elif [[ "$w1" == "--raw-xml-attribute-wrapper"                       ]];    then COMPREPLY=("'attribute'")
    77 	elif [[ "$w2" == "--raw-xml-attribute-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    77 	elif [[ "$w2" == "--raw-xml-attribute-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    78 	elif [[ "$w3" == "--raw-xml-attribute-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    78 	elif [[ "$w3" == "--raw-xml-attribute-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
       
    79 
       
    80 	elif [[ "$w1" == "--parser-option"                                  ]];    then COMPREPLY=("''")
       
    81 	elif [[ "$w2" == "--parser-option"                 && "x$w0" == "x" ]];    then COMPREPLY=("''")
       
    82 
    79 	else
    83 	else
    80 		OPTIONS=(
    84 		OPTIONS=(
    81 			"--namespace"
    85 			"--namespace"
       
    86 			"--parser-option"
    82 			"--relation"
    87 			"--relation"
    83 			"--records"
    88 			"--records"
    84 			"--name-is-xpath"
    89 			"--name-is-xpath"
    85 			"--attribute"
    90 			"--attribute"
    86 			"--xinclude"
    91 			"--xinclude"