mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Tools: completion: bash better completions for sim_vehicle.py
This commit is contained in:
parent
bee767a9aa
commit
d52c69af81
@ -5,6 +5,8 @@ _sim_vehicle() {
|
|||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
prev="${COMP_WORDS[COMP_CWORD - 1]}"
|
prev="${COMP_WORDS[COMP_CWORD - 1]}"
|
||||||
|
# don't complet =
|
||||||
|
_init_completion -n = || return
|
||||||
|
|
||||||
# TODO: generate for waf help
|
# TODO: generate for waf help
|
||||||
opts="--help -h"
|
opts="--help -h"
|
||||||
@ -87,7 +89,8 @@ _sim_vehicle() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
|
COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") $(compgen -W "${opts}" -- ${cur}) )
|
||||||
|
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
|
||||||
}
|
}
|
||||||
|
|
||||||
complete -F _sim_vehicle sim_vehicle.py
|
complete -F _sim_vehicle sim_vehicle.py
|
||||||
|
Loading…
Reference in New Issue
Block a user