#!/bin/bash

__contains_word () {
		local w word=$1; shift
		for w in "$@"; do
				[[ $w = "$word" ]] && return
		done
}

_voxl_configure_vrx(){

	local OPTS=('--help --list --frequency --bandwidth --enable --disable --blackout-mode --osd-on-link-loss
				--link-loss-indicator --factory_enable_mini_pini --factory_enable_spark_lan
				--factory_enable_fiber --factory_enable_lte --factory_enable_doodle --factory_enable_dtc
				--factory_enable_dgcs_tower --factory_enable_dgcs_pilot --wizard')
	local OPTS_SHORT=('-h -l -f -b -e -d -f -L -D -w')

	COMPREPLY=()
	if [ "$COMP_CWORD" -eq 1 ]; then
		COMPREPLY=( $(compgen -W '${OPTS}' -- ${COMP_WORDS[COMP_CWORD]}) )
		return 0
	fi

}

complete -F _voxl_configure_vrx voxl-configure-vrx
