+# colon, equal sign will mess up the completion output, just
+# removes the colon-word and equal-word prefix from COMPREPLY items.
+#
+# Implementation of this function refers to the __ltrim_colon_completions
+# function defined in bash_completion module.
+#
+# $1: Current argument
+# $2: $COMP_WORDBREAKS
+# $3: ${COMPREPLY[@]}
+_ovs_vsctl_trim_compreply() {
+ local cur comp_wordbreaks
+ local compreply
+
+ cur=$1 && shift
+ comp_wordbreaks=$1 && shift
+ compreply=( $@ )
+
+ if [[ "$cur" == *:* && "$comp_wordbreaks" == *:* ]]; then
+ local colon_word=${cur%${cur##*:}}
+ local i=${#compreply[*]}
+ cur=${cur##*:}
+ while [ $((--i)) -ge 0 ]; do
+ compreply[$i]=${compreply[$i]#"$colon_word"}
+ done
+ fi
+
+ if [[ "$cur" == *=* && "$comp_wordbreaks" == *=* ]]; then
+ local equal_word=${cur%${cur##*=}}
+ local i=${#compreply[*]}
+ while [ $((--i)) -ge 0 ]; do
+ compreply[$i]=${compreply[$i]#"$equal_word"}
+ done
+ fi
+
+ printf "%s " "${compreply[@]}"
+}
+