bash-completion.sh
branchv_0
changeset 3 3891db9e45b7
parent 1 27c11cea34de
equal deleted inserted replaced
2:f724d805c34a 3:3891db9e45b7
    21 	w1=${COMP_WORDS[COMP_CWORD-1]}
    21 	w1=${COMP_WORDS[COMP_CWORD-1]}
    22 	w2=${COMP_WORDS[COMP_CWORD-2]}
    22 	w2=${COMP_WORDS[COMP_CWORD-2]}
    23 	w3=${COMP_WORDS[COMP_CWORD-3]}
    23 	w3=${COMP_WORDS[COMP_CWORD-3]}
    24 
    24 
    25 	if   [[ "$w1" == "--relation"                      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    25 	if   [[ "$w1" == "--relation"                      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    26 	elif [[ "$w1" == "--endpoint-url"                  && "x$w0" == "x" ]];    then COMPREPLY=("'tcp://*:1234'")
    26 	elif [[ "$w1" == "--connection-string"             && "x$w0" == "x" ]];    then COMPREPLY=("'tcp://*:1234'")
    27 	elif [[ "$w1" == "--message-count"                 && "x$w0" == "x" ]];    then COMPREPLY=("1")
    27 	elif [[ "$w1" == "--message-count"                 && "x$w0" == "x" ]];    then COMPREPLY=("1")
    28 	else
    28 	else
    29 		OPTIONS=(
    29 		OPTIONS=(
    30 			"--relation"
    30 			"--relation"
    31 			"--endpoint-url"
    31 			"--connection-string"
    32 			"--message-count"
    32 			"--message-count"
    33 		)
    33 		)
    34 		COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0"))
    34 		COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0"))
    35 	fi
    35 	fi
    36 }
    36 }