bash-completion.sh
branchv_0
changeset 27 d6d710336e7c
parent 25 0e8a58946c48
equal deleted inserted replaced
26:84ff7c97bfdc 27:d6d710336e7c
    57 		"http://www.w3.org/2000/svg"
    57 		"http://www.w3.org/2000/svg"
    58 		"http://www.w3.org/2005/Atom"
    58 		"http://www.w3.org/2005/Atom"
    59 		"http://docbook.org/ns/docbook"
    59 		"http://docbook.org/ns/docbook"
    60 	)
    60 	)
    61 
    61 
       
    62 	# TODO: introspection: after moving to alt2xml the available options and their values should be provided by the parser
       
    63 
       
    64 	PARSER_OPTIONS=(
       
    65 		"root-name"
       
    66 	);
       
    67 
    62 
    68 
    63 	if   [[ "$w1" == "--relation"                      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    69 	if   [[ "$w1" == "--relation"                      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    64 	elif [[ "$w1" == "--records"                       && "x$w0" == "x" ]];    then COMPREPLY=("'/'")
    70 	elif [[ "$w1" == "--records"                       && "x$w0" == "x" ]];    then COMPREPLY=("'/'")
    65 	elif [[ "$w1" == "--attribute"                     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    71 	elif [[ "$w1" == "--attribute"                     && "x$w0" == "x" ]];    then COMPREPLY=("''")
    66 	elif [[ "$w2" == "--attribute"                                      ]];    then COMPREPLY=($(compgen -W "${DATA_TYPE[*]}" -- "$w0"))
    72 	elif [[ "$w2" == "--attribute"                                      ]];    then COMPREPLY=($(compgen -W "${DATA_TYPE[*]}" -- "$w0"))
    75 
    81 
    76 	elif [[ "$w1" == "--raw-xml-attribute-wrapper"                       ]];    then COMPREPLY=("'attribute'")
    82 	elif [[ "$w1" == "--raw-xml-attribute-wrapper"                       ]];    then COMPREPLY=("'attribute'")
    77 	elif [[ "$w2" == "--raw-xml-attribute-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    83 	elif [[ "$w2" == "--raw-xml-attribute-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    78 	elif [[ "$w3" == "--raw-xml-attribute-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    84 	elif [[ "$w3" == "--raw-xml-attribute-wrapper"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    79 
    85 
    80 	elif [[ "$w1" == "--parser-option"                                  ]];    then COMPREPLY=("''")
    86 	elif [[ "$w1" == "--parser-option"                                   ]];    then COMPREPLY=($(compgen -W "${PARSER_OPTIONS[*]}" -- "$w0"))
    81 	elif [[ "$w2" == "--parser-option"                 && "x$w0" == "x" ]];    then COMPREPLY=("''")
    87 	elif [[ "$w2" == "--parser-option"                  && "x$w0" == "x" ]];    then COMPREPLY=("''")
    82 
    88 
    83 	else
    89 	else
    84 		OPTIONS=(
    90 		OPTIONS=(
    85 			"--namespace"
    91 			"--namespace"
    86 			"--parser-option"
    92 			"--parser-option"