bash-completion.sh
branchv_0
changeset 9 7d309accc639
parent 0 28294b895e5e
equal deleted inserted replaced
8:3192dc8772de 9:7d309accc639
    30 	# TODO: introspection: after moving to alt2xml the available options and their values should be provided by the parser
    30 	# TODO: introspection: after moving to alt2xml the available options and their values should be provided by the parser
    31 
    31 
    32 	PARSER_OPTIONS=(
    32 	PARSER_OPTIONS=(
    33 		"encoding"
    33 		"encoding"
    34 		"parse-encapsulated"
    34 		"parse-encapsulated"
    35 		"tree-style"
    35 		"bit-string-symbol-0"
    36 		"tree-with-namespaces"
    36 		"bit-string-symbol-1"
    37 		"root-name"
       
    38 	);
    37 	);
    39 
    38 
    40 	ENCODINGS=(
    39 	ENCODINGS=(
    41 		"BER"
    40 		"BER"
    42 		"DER"
    41 		"DER"
    54 	if   [[ "$w1" == "--relation"                      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    53 	if   [[ "$w1" == "--relation"                      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    55 	elif [[ "$w1" == "--mode"                                           ]];    then COMPREPLY=($(compgen -W "${MODES[*]}" -- "$w0"))
    54 	elif [[ "$w1" == "--mode"                                           ]];    then COMPREPLY=($(compgen -W "${MODES[*]}" -- "$w0"))
    56 	elif [[ "$w1" == "--parser-option"                                  ]];    then COMPREPLY=($(compgen -W "${PARSER_OPTIONS[*]}" -- "$w0"))
    55 	elif [[ "$w1" == "--parser-option"                                  ]];    then COMPREPLY=($(compgen -W "${PARSER_OPTIONS[*]}" -- "$w0"))
    57 	elif [[ "$w2" == "--parser-option" && "$w1" == "encoding"                                 ]];    then COMPREPLY=($(compgen -W "${ENCODINGS[*]}" -- "$w0"))
    56 	elif [[ "$w2" == "--parser-option" && "$w1" == "encoding"                                 ]];    then COMPREPLY=($(compgen -W "${ENCODINGS[*]}" -- "$w0"))
    58 	elif [[ "$w2" == "--parser-option" && "$w1" == "parse-encapsulated"                       ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
    57 	elif [[ "$w2" == "--parser-option" && "$w1" == "parse-encapsulated"                       ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
       
    58 	elif [[ "$w2" == "--parser-option" && "$w1" == "bit-string-symbol-0"     && "x$w0" == "x" ]];    then COMPREPLY=("'0'")
       
    59 	elif [[ "$w2" == "--parser-option" && "$w1" == "bit-string-symbol-1"     && "x$w0" == "x" ]];    then COMPREPLY=("'1'")
    59 	else
    60 	else
    60 		OPTIONS=(
    61 		OPTIONS=(
    61 			"--relation"
    62 			"--relation"
    62 			"--mode"
    63 			"--mode"
    63 			"--parser-option"
    64 			"--parser-option"