mirror of https://github.com/ArduPilot/ardupilot
Updated changes as requested in waf for shell completion
This commit is contained in:
parent
ea3d8046da
commit
070b7c3202
|
@ -53,8 +53,7 @@ _waf()
|
||||||
|
|
||||||
case $prev in
|
case $prev in
|
||||||
--board)
|
--board)
|
||||||
# get options between board and debug, remove everything before "are", remove everything after "--debug", remove final dot, remove all comma
|
opts=$(./waf list_boards | sed -e '$d')
|
||||||
opts=$(./waf --help | sed -n '/--board=/,/--debug/p' | sed -e 's/.*are //g' -e 's/\(--debug.*\)//g' -e 's/[.]//g' -e 's/[,]//g')
|
|
||||||
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
|
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -39,8 +39,7 @@ _waf() {
|
||||||
|
|
||||||
(( $+functions[_waf_boards] )) ||
|
(( $+functions[_waf_boards] )) ||
|
||||||
_waf_boards() {
|
_waf_boards() {
|
||||||
# get option between board and debug, remove everything before "are", remove everything after "--debug", remove final dot, remove all comma
|
local boards; boards=( $(./waf list_boards | sed -e '$d'))
|
||||||
local boards; boards=( $(./waf --help | sed -n '/--board=/,/--debug/p' | sed -e 's/.*are //g' -e 's/\(--debug.*\)//g' -e 's/[.]//g' -e 's/[,]//g') )
|
|
||||||
_describe -t boards 'board' boards "$@" && ret=0
|
_describe -t boards 'board' boards "$@" && ret=0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue