2020-01-19 16:01:58 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
_ap_bin()
|
|
|
|
{
|
|
|
|
local cur opts
|
|
|
|
COMPREPLY=()
|
|
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
|
|
|
|
opts="--help -h"
|
2021-01-02 18:00:37 -04:00
|
|
|
opts+=" --wipe -w"
|
2020-04-03 12:38:17 -03:00
|
|
|
opts+=" --unhide-groups -u"
|
2021-01-02 18:00:37 -04:00
|
|
|
opts+=" --speedup -s"
|
2020-04-03 12:38:17 -03:00
|
|
|
opts+=" --rate -r"
|
|
|
|
opts+=" --console -C"
|
|
|
|
opts+=" --instance -I"
|
|
|
|
opts+=" --synthetic-clock -S"
|
|
|
|
opts+=" --home -O"
|
|
|
|
opts+=" --model -M"
|
|
|
|
opts+=" --fg -F"
|
|
|
|
# Prevent word reuse
|
|
|
|
lim=$((COMP_CWORD - 1))
|
|
|
|
for i in $(seq 0 $lim); do
|
|
|
|
if [[ $opts == *"${COMP_WORDS[i]}"* ]]; then
|
|
|
|
opts=${opts//${COMP_WORDS[i]}/}
|
|
|
|
opts=${opts//--${COMP_WORDS[i]}/}
|
|
|
|
fi
|
|
|
|
done
|
2021-01-02 18:00:37 -04:00
|
|
|
COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") $(compgen -W "${opts}" -- ${cur}) )
|
2020-01-19 16:01:58 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
complete -F _ap_bin arducopter
|
|
|
|
complete -F _ap_bin arduplane
|
|
|
|
complete -F _ap_bin ardusub
|
|
|
|
complete -F _ap_bin arducopter
|